:root {
  --bg: rgb(200 200 255);
  --brand: rgb(104 122 255);
  --border: #B7B4B3;
  --card-bg: rgb(230 230 255);
  --card-border: gray;
  --text: #000;
}

* {
  box-sizing: border-box;
  font-family: "Inter", sans-serif;
  font-optical-sizing: auto;
  font-size: 16px;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background-color: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  text-decoration: none;
  color: inherit;
}

.logo {
  width: 128px;
  height: auto;
  display: block;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header */
header {
  background-color: var(--brand);
  border-bottom: 3px solid var(--border);
  padding: 8px 0;
  box-shadow: 0px 2.5px rgb(150, 150, 175);
}

header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

header .menu {
  display: flex;
  gap: 16px;
}

header .menu a {
  color: #fff;
  font-weight: 600;
}

header .menu a:hover {
  text-decoration: underline;
}

.cart-icon {
  position: relative;
  display: inline-block;
}

/* badge */
.cart-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: red;
  color: white;
  font-size: 12px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 50%;
  line-height: 1;
}


/* Main */
main {
  flex: 1;
  padding: 16px 0 24px;
}

/* Cards (home) */
.cards {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  align-items: stretch;
}

.cards .card {
  color: var(--text);
  background-color: var(--card-bg);
  border: 5px solid var(--card-border);
  padding: 14px;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-shadow: 2.5px 2.5px 5px 5px black;
}

.cards .card img {
  width: 100%;
  height: 120px;
  object-fit: contain;
  display: block;
  margin: 0 0 10px;
}

.cards .card h3 {
  margin: 0 0 10px;
  font-size: 20px;
  line-height: 1.2;
}

.cards .card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  flex: 1;
}

/* Dettaglio prodotto */
.dettaglio {
  display: grid;
  grid-template-columns: minmax(320px, 520px) minmax(0, 1fr);
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px;
  align-items: start;
}

.dettaglio .left {
  position: sticky;
  top: 16px;
  align-self: start;
}

.dettaglio .left img {
  width: 100%;
  height: min(70vh, 620px);
  object-fit: contain;
  display: block;
}

.dettaglio .right {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 280px;
}

.dettaglio .right span {
  font-weight: 730;
}

.dettaglio .right a {
  color: rgb(15, 17, 17);
  background-color: rgb(255, 216, 20);
  border-radius: 10px;
  cursor: pointer;
  border: 2px solid rgb(255, 216, 20);
  padding: 10px 12px;
  font-weight: 600;
  width: fit-content;
}

.dettaglio .right a:hover {
  filter: brightness(0.95);
}

/* Login */
.login {
  color: var(--text);
  background-color: var(--card-bg);
  border: 5px solid var(--card-border);
  padding: 14px;
  display: flex;
  height: 100%;
  box-shadow: 2.5px 2.5px 5px 5px black;
  justify-content: center;
  align-items: center;
  width: 50%;
  transform: translateX(50%);
}

.login input[type=text],
.login input[type=password] {
  width: 100%;
  padding: 12px 20px;
  margin: 8px 0;
  display: inline-block;
  border: 1px solid #ccc;
  box-sizing: border-box;
}

.login input[type="submit"] {
  width: 100%;
  background-color: rgb(255, 216, 20);
  border-radius: 10px;
  cursor: pointer;
  border: 2px solid rgb(255, 216, 20);
  font-weight: 600;
  width: 100%;
  height: 30px;
}

.login input[type="submit"]:hover {
  filter: brightness(0.95);
}

/* Carrello */

.carrello {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  align-items: stretch;
  /* height: 100%; */
}

.carrello .card {
  color: var(--text);
  background-color: var(--card-bg);
  border: 5px solid var(--card-border);
  padding: 14px;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-shadow: 2.5px 2.5px 5px 5px black;
  align-items: center;
}

.carrello .card h3 {
  margin: 0 0 10px;
  font-size: 20px;
  line-height: 1.2;
}

.carrello .card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  flex: 1;
}

.carrello .card span {
  font-weight: 730;
}

.totale {
  color: var(--text);
  background-color: var(--card-bg);
  border: 5px solid var(--card-border);
  max-width: 1200px;
  margin: 25px auto;
  padding: 0 16px;
  display: flex;
  box-shadow: 2.5px 2.5px 5px 5px black;
  align-items: center;
  flex-direction: column;
  width: 50%;
}

.totale p {
  margin: 0;
  font-size: 20px;
  line-height: 1.4;
  flex: 1;
  width: 50%;
  text-align: center;
}

.totale span {
  font-weight: 730;
  font-size: 20px;
}

.totale a {
  color: rgb(15, 17, 17);
  background-color: rgb(255, 216, 20);
  border-radius: 10px;
  cursor: pointer;
  border: 2px solid rgb(255, 216, 20);
  padding: 10px 12px;
  font-weight: 600;
  font-size: 25px;
  width: 50%;
  text-align: center;
  margin: 10px auto;
}

.totale a:hover {
  filter: brightness(0.95);
}

.carrello-vuoto {
  color: var(--text);
  background-color: var(--card-bg);
  border: 5px solid var(--card-border);
  max-width: 1200px;
  margin: 25px auto;
  padding: 0 16px;
  box-shadow: 2.5px 2.5px 5px 5px black;
  width: 50%;
}

.carrello-vuoto h1{
  text-align: center;
  font-size: 30px;
}


/* Login */
.checkout {
  color: var(--text);
  background-color: var(--card-bg);
  border: 5px solid var(--card-border);
  padding: 14px;
  display: flex;
  height: 100%;
  box-shadow: 2.5px 2.5px 5px 5px black;
  justify-content: center;
  align-items: center;
  width: 50%;
  transform: translateX(50%);
}

.checkout input[type=text],
.checkout input[type=email] {
  width: 100%;
  padding: 12px 20px;
  margin: 8px 0;
  display: inline-block;
  border: 1px solid #ccc;
  box-sizing: border-box;
}

.checkout input[type="submit"] {
  width: 100%;
  background-color: rgb(255, 216, 20);
  border-radius: 10px;
  cursor: pointer;
  border: 2px solid rgb(255, 216, 20);
  font-weight: 600;
  width: 100%;
  height: 30px;
}

.checkout input[type="submit"]:hover {
  filter: brightness(0.95);
}

/* Footer */
footer {
  background-color: var(--brand);
  border-top: 3px solid var(--border);
  padding: 18px 0 8px;
  margin-top: auto;
  box-shadow: 0px -2.5px rgb(150, 150, 175);
}

footer .container {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
}

footer .col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 160px;
}

footer .col h4 {
  margin: 0 0 8px;
  color: #fff;
}

footer .col a {
  color: #fff;
}

footer .col a:hover:not(.fa) {
  text-decoration: underline;
}

footer ul {
  list-style-type: none;
  margin: 4px 0 0;
  padding-left: 0;
}

footer li {
  margin: 4px 0;
}

footer .bottom {
  display: flex;
  justify-content: center;
  margin-top: 14px;
  font-size: 18px;
  font-weight: 600;
  color: #fff;
}

footer .bottom p {
  margin: 0;
}

/* Social icons */
.fa {
  padding: 12px;
  font-size: 20px;
  width: 40px;
  text-align: center;
  margin: 5px 2px;
  border-radius: 50%;
}

.fa-shopping-cart {
  font-size: 50px;
  width: 100px;
}

.fa-user-circle-o {
  font-size: 50px;
  width: 100px;
}

.fa:hover {
  opacity: 0.7;
}

.fa-facebook {
  background: rgb(59, 89, 152);
  color: #fff;
}

.fa-instagram {
  background: rgb(18, 86, 136);
  color: #fff;
}

.fa-youtube {
  background: rgb(187, 0, 0);
  color: #fff;
}

/* Utilità */
.text-white {
  color: #fff;
}


@media (max-width: 720px) {
  header .container {
    flex-wrap: wrap;
  }

  .logo {
    width: 110px;
  }

  .dettaglio {
    grid-template-columns: 1fr;
  }

  .dettaglio .left {
    position: static;
  }
}