/* ===========================================================
   Caffè Unique — E-commerce
   Palette e tipografia riprese da www.caffeunique.it
   =========================================================== */
:root {
  --brown: #492518;          /* marrone caffè del sito */
  --brown-dark: #33190f;
  --cream: #FBF7E8;          /* fondo crema chiaro */
  --cream-dark: #F4F0E1;     /* fondo crema */
  --blue: #8CD2F6;           /* azzurro del logo */
  --blue-dark: #5db4e3;
  --text: #333333;
  --white: #ffffff;
  --font-display: "Playfair Display", serif;
  --font-body: "Playfair", "Playfair Display", serif;
  --shadow: 0 6px 24px rgba(51, 25, 15, .12);
  --radius: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--cream);
  line-height: 1.65;
  font-size: 17px;
}

img { max-width: 100%; display: block; }

a { color: var(--brown); text-decoration: none; }

h1, h2, h3, h4 { font-family: var(--font-display); color: var(--brown); line-height: 1.2; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* ---------- Bottoni ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  padding: 13px 30px;
  border-radius: 40px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all .25s ease;
  text-align: center;
}
.btn-primary { background: var(--brown); color: var(--cream); }
.btn-primary:hover { background: var(--brown-dark); transform: translateY(-2px); }
.btn-light { background: var(--blue); color: var(--brown-dark); }
.btn-light:hover { background: var(--blue-dark); transform: translateY(-2px); }
.btn-outline { border-color: var(--brown); color: var(--brown); background: transparent; }
.btn-outline:hover { background: var(--brown); color: var(--cream); }
.btn-sm { padding: 9px 20px; font-size: 14px; }
.btn-block { display: block; width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ---------- Header ---------- */
.site-header {
  background: var(--brown);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 14px rgba(0,0,0,.25);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  max-width: 1180px;
  margin: 0 auto;
}
.logo img { height: 62px; width: auto; }
.main-nav { display: flex; gap: 30px; align-items: center; }
.main-nav a {
  color: var(--cream);
  font-family: var(--font-display);
  font-size: 16px;
  position: relative;
  padding: 6px 0;
}
.main-nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 2px;
  background: var(--blue);
  transition: width .25s;
}
.main-nav a:hover::after, .main-nav a.active::after { width: 100%; }
.main-nav a.active { color: var(--blue); }

.header-actions { display: flex; align-items: center; gap: 18px; }
.cart-link { position: relative; color: var(--cream); display: flex; }
.cart-link svg { width: 26px; height: 26px; }
.cart-badge {
  position: absolute;
  top: -8px; right: -10px;
  background: var(--blue);
  color: var(--brown-dark);
  font-size: 12px;
  font-weight: 700;
  min-width: 20px; height: 20px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}
.cart-badge.visible { display: flex; }

.menu-toggle {
  display: none;
  background: none; border: none;
  color: var(--cream);
  font-size: 26px;
  cursor: pointer;
}

/* ---------- Annuncio spedizione ---------- */
.announce {
  background: var(--blue);
  color: var(--brown-dark);
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  padding: 7px 16px;
  font-family: var(--font-display);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background:
    linear-gradient(rgba(20, 8, 4, .62), rgba(20, 8, 4, .72)),
    url("../img/top-view-coffee-machine-with-cups-wooden-table-closeup-scaled.jpg") center/cover no-repeat;
  padding: 90px 24px;
}
.hero-content { max-width: 760px; }
.hero-logo { max-width: 340px; margin: 0 auto 24px; }
.hero h1 {
  color: var(--white);
  font-size: clamp(30px, 4.6vw, 52px);
  margin-bottom: 16px;
}
.hero h1 em { color: var(--blue); font-style: normal; }
.hero p { color: rgba(255,255,255,.88); font-size: 19px; margin-bottom: 32px; }
.hero .btn { margin: 0 8px 10px; }

/* ---------- Divider orsetti (pattern del sito originale) ---------- */
.teddy-divider {
  height: 56px;
  background: url("../img/teddy.svg") center repeat-x;
  background-size: auto 44px;
  opacity: .9;
}

/* ---------- Sezioni ---------- */
.section { padding: 76px 0; }
.section-alt { background: var(--cream-dark); }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 48px; }
.section-head h2 { font-size: clamp(26px, 3.4vw, 40px); margin-bottom: 14px; }
.section-head p { color: #6b5a50; font-size: 18px; }
.eyebrow {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--blue-dark);
  font-weight: 700;
  margin-bottom: 10px;
}

/* ---------- Griglia categorie ---------- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 18px;
}
.cat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 26px 18px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform .25s;
  border-bottom: 4px solid transparent;
}
.cat-card:hover { transform: translateY(-5px); border-bottom-color: var(--blue); }
.cat-card .cat-icon { font-size: 34px; margin-bottom: 10px; }
.cat-card .cat-img {
  width: 74px; height: 74px;
  object-fit: cover;
  border-radius: 50%;
  margin: 0 auto 12px;
  border: 3px solid var(--cream-dark);
}
.cat-card h3 { font-size: 17px; }
.price-now small { font-size: 13px; font-weight: 400; color: #8a7a6e; }

/* Selettore varianti scheda prodotto */
.variant-picker { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 6px; }
.variant-pill {
  border: 2px solid #e0d8c4;
  background: var(--white);
  border-radius: 12px;
  padding: 10px 18px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 15px;
  text-align: left;
  transition: border-color .2s, background .2s;
}
.variant-pill b { display: block; font-family: var(--font-display); color: var(--brown); }
.variant-pill .v-price { font-size: 14px; color: #55443a; }
.variant-pill.selected { border-color: var(--brown); background: var(--cream); }
.variant-pill:disabled { opacity: .45; cursor: not-allowed; }
.variant-pill .v-out { color: #c0392b; font-size: 12px; font-weight: 700; }

/* ---------- Card prodotto ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 28px;
}
.product-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform .25s;
}
.product-card:hover { transform: translateY(-5px); }
.product-card-img {
  position: relative;
  display: block;
  aspect-ratio: 1 / 0.82;
  overflow: hidden;
  background: var(--cream-dark);
}
.product-card-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .4s;
}
.product-card:hover .product-card-img img { transform: scale(1.06); }
.product-badge {
  position: absolute;
  top: 12px; left: 12px;
  z-index: 2;
  background: var(--blue);
  color: var(--brown-dark);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 30px;
}
.product-badge.sold-out { background: #d9534f; color: #fff; }
.product-card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 6px;
}
.product-cat {
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--blue-dark);
  font-weight: 700;
}
.product-card-body h3 { font-size: 21px; }
.product-sub { font-size: 14px; color: #6b5a50; }

.intensity { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #6b5a50; margin-top: 4px; }
.intensity-dots { display: flex; gap: 3px; }
.intensity-dots i {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #e0d8c4;
}
.intensity-dots i.on { background: var(--brown); }
.intensity b { color: var(--brown); }

.product-card-footer {
  margin-top: auto;
  padding-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.price { display: flex; flex-direction: column; line-height: 1.1; }
.price-old { font-size: 14px; color: #a09585; text-decoration: line-through; }
.price-now { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--brown); }

/* ---------- Filtri shop ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 42px;
}
.filter-btn {
  font-family: var(--font-display);
  font-size: 14px;
  padding: 9px 20px;
  border-radius: 30px;
  border: 2px solid var(--brown);
  background: transparent;
  color: var(--brown);
  cursor: pointer;
  transition: all .2s;
}
.filter-btn:hover, .filter-btn.active { background: var(--brown); color: var(--cream); }

/* ---------- Valori / feature ---------- */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 28px;
}
.feature {
  text-align: center;
  background: var(--white);
  border-radius: var(--radius);
  padding: 36px 26px;
  box-shadow: var(--shadow);
}
.feature img { width: 90px; margin: 0 auto 16px; }
.feature h3 { font-size: 21px; margin-bottom: 10px; }
.feature p { font-size: 15px; color: #6b5a50; }

/* ---------- Split (storia) ---------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}
.split-img img {
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  width: 100%;
  aspect-ratio: 4/4.4;
  object-fit: cover;
}
.split-text h2 { font-size: clamp(26px, 3vw, 36px); margin-bottom: 18px; }
.split-text p { margin-bottom: 14px; color: #55443a; }
.split-text .btn { margin-top: 12px; }

/* ---------- Banner scuro ---------- */
.dark-banner {
  background:
    linear-gradient(rgba(20, 8, 4, .72), rgba(20, 8, 4, .78)),
    url("../img/coffee-machine-making-perfect-cup-coffee-1024x574.jpg") center/cover no-repeat;
  text-align: center;
  padding: 90px 24px;
}
.dark-banner h2 { color: var(--white); font-size: clamp(26px, 3.4vw, 40px); margin-bottom: 14px; }
.dark-banner h2 em { color: var(--blue); font-style: normal; }
.dark-banner p { color: rgba(255,255,255,.85); max-width: 620px; margin: 0 auto 30px; }

/* ---------- Pagina prodotto ---------- */
.breadcrumb { font-size: 14px; color: #8a7a6e; margin: 28px 0; }
.breadcrumb a { color: var(--blue-dark); }
.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: start;
  margin-bottom: 80px;
}
.product-detail-img {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  position: relative;
  background: var(--white);
}
.product-detail-img img { width: 100%; aspect-ratio: 1/0.9; object-fit: cover; }
.product-detail h1 { font-size: clamp(28px, 3.4vw, 42px); }
.product-detail .product-sub { font-size: 18px; margin: 6px 0 18px; }
.product-detail .price-now { font-size: 34px; }
.product-detail .price { flex-direction: row; gap: 14px; align-items: baseline; margin: 18px 0; }
.product-detail .price-old { font-size: 20px; }
.product-desc { margin: 18px 0; color: #55443a; }
.product-details-list { list-style: none; margin: 22px 0; }
.product-details-list li {
  padding: 9px 0 9px 30px;
  border-bottom: 1px solid #eee5d0;
  position: relative;
  font-size: 15px;
}
.product-details-list li::before {
  content: "✓";
  position: absolute;
  left: 4px;
  color: var(--blue-dark);
  font-weight: 700;
}
.qty-row { display: flex; gap: 14px; align-items: center; margin: 26px 0; flex-wrap: wrap; }
.qty-control {
  display: flex;
  align-items: center;
  border: 2px solid var(--brown);
  border-radius: 40px;
  overflow: hidden;
}
.qty-control button {
  background: none; border: none;
  font-size: 20px;
  width: 42px; height: 46px;
  cursor: pointer;
  color: var(--brown);
}
.qty-control input {
  width: 48px;
  border: none;
  text-align: center;
  font-size: 17px;
  font-family: var(--font-display);
  background: transparent;
  color: var(--brown);
}
.shipping-note { font-size: 14px; color: #6b5a50; display: flex; align-items: center; gap: 8px; }

/* ---------- Carrello ---------- */
.page-title { text-align: center; padding: 56px 0 8px; }
.page-title h1 { font-size: clamp(30px, 4vw, 46px); }
.cart-layout {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 40px;
  align-items: start;
  margin: 40px 0 80px;
}
.cart-items { display: flex; flex-direction: column; gap: 18px; }
.cart-item {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 20px;
  background: var(--white);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  align-items: center;
}
.cart-item img {
  width: 110px; height: 96px;
  object-fit: cover;
  border-radius: 10px;
}
.cart-item h3 { font-size: 19px; }
.cart-item .product-sub { margin-bottom: 8px; }
.cart-item-right { text-align: right; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; }
.remove-btn {
  background: none; border: none;
  color: #b0a191;
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
}
.remove-btn:hover { color: var(--brown); }
.cart-item .qty-control { transform: scale(.88); transform-origin: left; }

.summary-box {
  background: var(--white);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 110px;
}
.summary-box h2 { font-size: 24px; margin-bottom: 20px; }
.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  font-size: 16px;
  border-bottom: 1px solid #f0e9d8;
}
.summary-row.total {
  border-bottom: none;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  color: var(--brown);
  padding-top: 16px;
}
.free-shipping-bar { margin: 16px 0; font-size: 14px; color: #6b5a50; }
.free-shipping-bar .bar {
  height: 8px;
  background: #eee5d0;
  border-radius: 10px;
  overflow: hidden;
  margin-top: 8px;
}
.free-shipping-bar .bar i {
  display: block;
  height: 100%;
  background: var(--blue);
  transition: width .4s;
}
.summary-box .btn { margin-top: 18px; }

.empty-state { text-align: center; padding: 60px 20px 90px; }
.empty-state p { margin-bottom: 24px; color: #6b5a50; font-size: 18px; }

/* ---------- Checkout ---------- */
.checkout-layout {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 40px;
  align-items: start;
  margin: 40px 0 80px;
}
.form-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 34px;
  box-shadow: var(--shadow);
  margin-bottom: 26px;
}
.form-card h2 { font-size: 23px; margin-bottom: 22px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { font-size: 14px; font-weight: 600; color: var(--brown); font-family: var(--font-display); }
.form-field input, .form-field select, .form-field textarea {
  padding: 12px 14px;
  border: 1.5px solid #e0d8c4;
  border-radius: 10px;
  font-size: 16px;
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--text);
  transition: border-color .2s;
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  outline: none;
  border-color: var(--blue-dark);
}
.form-field input.invalid { border-color: #d9534f; }
.pay-option {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  border: 1.5px solid #e0d8c4;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.pay-option:has(input:checked) { border-color: var(--blue-dark); background: var(--cream); }
.pay-option input { margin-top: 5px; accent-color: var(--brown); }
.pay-option b { font-family: var(--font-display); color: var(--brown); }
.pay-option p { font-size: 14px; color: #6b5a50; }
.checkout-error { color: #d9534f; font-size: 14px; margin-top: 12px; display: none; }
.checkout-error.show { display: block; }

.mini-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 15px;
  padding: 8px 0;
  border-bottom: 1px solid #f0e9d8;
}
.mini-item span:first-child { color: #55443a; }

/* ---------- Conferma ---------- */
.confirm-box {
  max-width: 640px;
  margin: 70px auto 100px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 56px 44px;
  text-align: center;
}
.confirm-box .check {
  width: 84px; height: 84px;
  border-radius: 50%;
  background: var(--blue);
  color: var(--brown-dark);
  font-size: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 26px;
}
.confirm-box h1 { font-size: 34px; margin-bottom: 14px; }
.confirm-box p { color: #55443a; margin-bottom: 10px; }
.confirm-box .order-num {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--brown);
  background: var(--cream);
  display: inline-block;
  padding: 10px 26px;
  border-radius: 40px;
  margin: 16px 0 26px;
}

/* ---------- Account ---------- */
.account-link { color: var(--cream); display: flex; }
.account-link svg { width: 25px; height: 25px; }
.auth-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; margin-top: 20px; }
.account-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 10px 0 24px;
  flex-wrap: wrap;
}
.account-orders { display: flex; flex-direction: column; gap: 12px; }
.account-order { border: 1.5px solid #eee5d0; border-radius: 12px; overflow: hidden; }
.account-order-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  cursor: pointer;
  flex-wrap: wrap;
}
.account-order-head:hover { background: var(--cream); }
.account-order-head .order-date { color: #8a7a6e; font-size: 14px; }
.account-order-body { border-top: 1px solid #eee5d0; padding: 14px 18px; }
.account-order-body ul { list-style: none; }
.account-order-body li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px dashed #f0e9d8;
  font-size: 14px;
}
.acc-state {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
}
.state-nuovo { background: var(--blue); color: var(--brown-dark); }
.state-lavorazione { background: #fdeeda; color: #b06c00; }
.state-spedito { background: #d9ecf5; color: #1a6a8f; }
.state-consegnato { background: #d9f2e5; color: #1a7f4e; }
.state-annullato { background: #fbdcdb; color: #c0392b; }

@media (max-width: 900px) {
  .auth-grid { grid-template-columns: 1fr; }
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--brown);
  color: rgba(251,247,232,.85);
  padding: 64px 0 0;
  margin-top: 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 44px;
}
.footer-grid img.footer-logo { height: 88px; width: auto; margin-bottom: 14px; }
.footer-grid h4 {
  color: var(--blue);
  font-size: 15px;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.footer-grid p, .footer-grid a { font-size: 15px; color: rgba(251,247,232,.85); }
.footer-grid ul { list-style: none; }
.footer-grid li { margin-bottom: 9px; }
.footer-grid a:hover { color: var(--blue); }
.footer-bottom {
  border-top: 1px solid rgba(251,247,232,.15);
  padding: 20px 0;
  text-align: center;
  font-size: 13px;
  color: rgba(251,247,232,.6);
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  background: var(--brown);
  color: var(--cream);
  padding: 15px 24px;
  border-radius: 50px;
  box-shadow: 0 10px 30px rgba(0,0,0,.3);
  display: flex;
  gap: 16px;
  align-items: center;
  font-size: 15px;
  z-index: 200;
  transition: transform .35s ease;
  max-width: calc(100vw - 40px);
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast a { color: var(--blue); font-weight: 700; white-space: nowrap; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .split, .product-detail, .cart-layout, .checkout-layout { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .summary-box { position: static; }
}
@media (max-width: 720px) {
  .menu-toggle { display: block; }
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--brown-dark);
    flex-direction: column;
    padding: 20px;
    gap: 16px;
  }
  .main-nav.open { display: flex; }
  .form-grid { grid-template-columns: 1fr; }
  .cart-item { grid-template-columns: 80px 1fr; }
  .cart-item img { width: 80px; height: 72px; }
  .cart-item-right { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; }
  .footer-grid { grid-template-columns: 1fr; }
}
