/* ============================================================
   PASTIFICIO CARDAMONE — Stile elegante minimalista
   Font: Cormorant Garamond (titoli) + Outfit (corpo)
   Palette: Avorio caldo, Verde bosco, Oro antico
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;0,700;1,300;1,400&family=Outfit:wght@300;400;500;600&display=swap');

:root {
  --bg:        #F9F7F4;
  --bg2:       #F0EDE7;
  --surface:   #FFFFFF;
  --border:    #E8E2D9;
  --text:      #1A1814;
  --text2:     #6C6459;
  --text3:     #A09890;
  --accent:    #1D3A0F;
  --accent2:   #2E5518;
  --accent3:   #3F7022;
  --gold:      #A67C3A;
  --gold2:     #C49A52;
  --danger:    #9B3228;
  --success:   #1A6B3E;
  --radius:    14px;
  --radius-sm: 8px;
  --shadow-sm: 0 2px 8px rgba(28,28,26,.06);
  --shadow:    0 4px 20px rgba(28,28,26,.08);
  --shadow-lg: 0 12px 48px rgba(28,28,26,.12);
  --nav-h:     72px;
  --font-head: "Cormorant Garamond", Georgia, serif;
  --font-body: "Outfit", sans-serif;
  --transition: .3s cubic-bezier(.4,0,.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* ── Animazioni globali ───────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideRight {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(.96); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-6px); }
}
@keyframes pulse-ring {
  0%   { transform: scale(1); opacity: .6; }
  100% { transform: scale(1.4); opacity: 0; }
}

.animate-fade-up   { animation: fadeUp .6s var(--transition) both; }
.animate-fade-in   { animation: fadeIn .5s ease both; }
.animate-scale-in  { animation: scaleIn .4s var(--transition) both; }

/* ── Navbar ───────────────────────────────────────────────────── */
.navbar {
  position: sticky;
  position: -webkit-sticky;
  top: 0;
  z-index: 999;
  background: rgba(247,245,240,.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  height: var(--nav-h);
  display: flex;
  align-items: center;
  transition: box-shadow var(--transition), background var(--transition);
  width: 100%;
}
.navbar.scrolled {
  background: rgba(247,245,240,.98);
  box-shadow: 0 4px 32px rgba(28,28,26,.08);
}

.nav-container {
  max-width: 1320px;
  width: 100%;
  margin: auto;
  padding: 0 2.5rem;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-logo {
  font-family: var(--font-head);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: .6rem;
  white-space: nowrap;
  letter-spacing: .01em;
  transition: opacity var(--transition);
}
.nav-logo:hover { opacity: .75; }
.nav-logo-img {
  height: 64px;
  width: auto;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  -ms-interpolation-mode: bicubic;
}
.logo-icon {
  color: var(--gold);
  font-size: .9rem;
}

.nav-links {
  display: flex;
  gap: .25rem;
  flex: 1;
}
.nav-links a {
  padding: .5rem 1.1rem;
  border-radius: var(--radius-sm);
  font-weight: 400;
  font-size: .88rem;
  letter-spacing: .02em;
  color: var(--text2);
  transition: background var(--transition), color var(--transition);
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 1.1rem;
  right: 1.1rem;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform var(--transition);
  transform-origin: left;
}
.nav-links a:hover { color: var(--accent); }
.nav-links a:hover::after,
.nav-links a.active::after { transform: scaleX(1); }
.nav-links a.active { color: var(--accent); font-weight: 500; }

.nav-actions {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-left: auto;
}

.btn-icon {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .5rem .9rem;
  border-radius: var(--radius-sm);
  font-size: .84rem;
  font-weight: 400;
  color: var(--text2);
  background: none;
  border: none;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  position: relative;
}
.btn-icon:hover {
  background: var(--bg2);
  color: var(--accent);
}

.cart-badge {
  position: absolute;
  top: 1px; right: 1px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  width: 17px; height: 17px;
  font-size: .62rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: scaleIn .2s var(--transition);
}

/* User dropdown */
.user-menu { position: relative; }
.user-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 210px;
  padding: .6rem;
  padding-top: 1rem;
  z-index: 100;
  animation: scaleIn .18s var(--transition);
}
.user-dropdown a {
  display: block;
  padding: .6rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .86rem;
  color: var(--text);
  transition: background var(--transition), color var(--transition);
}
.user-dropdown a:hover {
  background: var(--bg2);
  color: var(--accent);
}
.user-dropdown hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: .3rem 0;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: .5rem;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}

/* ── Flash ────────────────────────────────────────────────────── */
.flash {
  max-width: 1320px;
  margin: 1rem auto 0;
  padding: .85rem 1.5rem;
  border-radius: var(--radius);
  font-size: .88rem;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
  animation: slideRight .3s var(--transition);
}
.flash button { background: none; border: none; cursor: pointer; font-size: 1.1rem; opacity: .5; }
.flash-success { background: #e8f5ee; color: #1a5c35; border: 1px solid #c3e6cb; }
.flash-error   { background: #fdf0ef; color: #7a1f1a; border: 1px solid #f5c6cb; }
.flash-info    { background: #eef6fb; color: #1a5170; border: 1px solid #bee5eb; }

/* ── Layout base ─────────────────────────────────────────────── */
.main-content { flex: 1; }
.container { max-width: 1320px; margin: auto; padding: 0 2.5rem; }
.section { padding: 5rem 0; }

/* ── Titoli sezione ───────────────────────────────────────────── */
.section-title {
  font-family: var(--font-head);
  font-size: 2.8rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: .4rem;
  letter-spacing: -.01em;
  line-height: 1.15;
}
.section-subtitle {
  color: var(--text2);
  font-size: .95rem;
  margin-bottom: 3rem;
  font-weight: 300;
  letter-spacing: .01em;
}

/* ── Bottoni ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .8rem 2rem;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  font-weight: 500;
  letter-spacing: .04em;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.15);
  opacity: 0;
  transition: opacity var(--transition);
}
.btn:hover::after { opacity: 1; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent2);
  border-color: var(--accent2);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(42,74,18,.25);
}
.btn-outline {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}
.btn-outline:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-1px);
}
.btn-gold {
  background: var(--gold);
  color: #fff;
  border-color: var(--gold);
}
.btn-gold:hover {
  background: var(--gold2);
  border-color: var(--gold2);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(184,146,42,.3);
}
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { opacity: .88; }
.btn-sm { padding: .45rem 1.1rem; font-size: .8rem; }
.btn-block { width: 100%; justify-content: center; }

/* ── Hero ─────────────────────────────────────────────────────── */
.hero {
  background: #0F1F08;
  color: #fff;
  padding: 7rem 2.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  min-height: 560px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 70% at 50% -10%, rgba(42,74,18,.9) 0%, transparent 65%),
    radial-gradient(ellipse 50% 50% at 100% 100%, rgba(166,124,58,.15) 0%, transparent 50%),
    radial-gradient(ellipse 40% 40% at 0% 100%, rgba(42,74,18,.2) 0%, transparent 50%);
  z-index: 0;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 32px 32px;
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: rgba(166,124,58,.15);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(166,124,58,.35);
  color: var(--gold2);
  padding: .4rem 1.1rem;
  border-radius: 30px;
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 1.75rem;
  animation: fadeUp .6s var(--transition) .1s both;
}

.hero h1 {
  font-family: var(--font-head);
  font-size: 4.2rem;
  font-weight: 600;
  line-height: 1.1;
  margin-bottom: 1.25rem;
  letter-spacing: -.02em;
  animation: fadeUp .6s var(--transition) .2s both;
}

.hero h1 em {
  font-style: italic;
  font-weight: 300;
  color: rgba(255,255,255,.8);
}

.hero p {
  font-size: 1.05rem;
  opacity: .8;
  margin-bottom: 2.5rem;
  font-weight: 300;
  line-height: 1.7;
  animation: fadeUp .6s var(--transition) .3s both;
}

.hero .btn {
  animation: fadeUp .6s var(--transition) .4s both;
  padding: 1rem 2.5rem;
  font-size: .9rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* Scroll indicator */
.hero-scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  color: rgba(255,255,255,.4);
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  animation: fadeIn 1s ease 1s both;
}
.hero-scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, rgba(255,255,255,.4), transparent);
  animation: float 2s ease-in-out infinite;
}

/* ── Filtri catalogo ──────────────────────────────────────────── */
.catalog-filters {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
  padding: 1.25rem 1.75rem;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.catalog-filters form {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  align-items: center;
  flex: 1;
}
.filter-search {
  display: flex;
  gap: .5rem;
  flex: 1;
  min-width: 220px;
}
.filter-search input {
  flex: 1;
  padding: .6rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: .88rem;
  background: var(--bg);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.filter-search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(42,74,18,.08);
}

.filter-cats {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  align-items: center;
}
.filter-cat-btn {
  padding: .4rem 1rem;
  border-radius: 30px;
  font-size: .8rem;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text2);
  transition: var(--transition);
  white-space: nowrap;
  letter-spacing: .02em;
  cursor: pointer;
}
.filter-cat-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(42,74,18,.05);
}
.filter-cat-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(42,74,18,.2);
}

/* ── Griglia prodotti ─────────────────────────────────────────── */
.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.product-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  animation: fadeUp .5s var(--transition) both;
  cursor: pointer;
}
.product-card:nth-child(1) { animation-delay: .05s; }
.product-card:nth-child(2) { animation-delay: .1s; }
.product-card:nth-child(3) { animation-delay: .15s; }
.product-card:nth-child(4) { animation-delay: .2s; }
.product-card:nth-child(5) { animation-delay: .25s; }
.product-card:nth-child(6) { animation-delay: .3s; }
.product-card:nth-child(7) { animation-delay: .35s; }
.product-card:nth-child(8) { animation-delay: .4s; }

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(42,74,18,.15);
}

.product-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--bg2);
  transition: transform .5s var(--transition);
}
.product-card:hover .product-img { transform: scale(1.03); }

.product-img-placeholder {
  width: 100%;
  height: 200px;
  background: var(--bg2);
  position: relative;
  overflow: hidden;
}
.product-img-placeholder::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,.4) 50%, transparent 60%);
  background-size: 200% 100%;
  animation: shimmer 2.5s infinite;
}

.product-body {
  padding: 1.4rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.product-cat {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: .5rem;
}
.product-name {
  font-family: var(--font-head);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: .5rem;
  color: var(--text);
  letter-spacing: -.01em;
}
.product-desc {
  font-size: .82rem;
  color: var(--text2);
  line-height: 1.6;
  flex: 1;
  margin-bottom: 1.1rem;
  font-weight: 300;
}
.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.product-price { display: flex; flex-direction: column; gap: .1rem; }
.price-new {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--accent);
  font-family: var(--font-head);
  letter-spacing: -.01em;
}
.price-old {
  font-size: .78rem;
  color: var(--text3);
  text-decoration: line-through;
}
.badge-sale {
  background: var(--danger);
  color: #fff;
  font-size: .65rem;
  padding: .2rem .55rem;
  border-radius: 4px;
  font-weight: 600;
  letter-spacing: .05em;
}

/* ── Form generici ────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-group label {
  display: block;
  font-size: .82rem;
  font-weight: 500;
  margin-bottom: .45rem;
  color: var(--text2);
  letter-spacing: .02em;
}
.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: .75rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: .92rem;
  background: var(--bg);
  color: var(--text);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(42,74,18,.08);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* ── Auth card ────────────────────────────────────────────────── */
.auth-wrapper {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 2.75rem;
  width: 100%;
  max-width: 460px;
  box-shadow: var(--shadow);
  animation: scaleIn .3s var(--transition);
}
.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}
.auth-tab {
  flex: 1;
  padding: .8rem;
  text-align: center;
  font-weight: 500;
  font-size: .88rem;
  cursor: pointer;
  border: none;
  background: none;
  color: var(--text2);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: var(--transition);
  letter-spacing: .02em;
}
.auth-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Carrello ─────────────────────────────────────────────────── */
.cart-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 2rem;
  align-items: start;
}
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th {
  text-align: left;
  padding: .75rem 1rem;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text3);
  border-bottom: 1px solid var(--border);
  font-weight: 500;
}
.cart-table td {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.cart-item-img {
  width: 68px;
  height: 68px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--bg2);
}
.qty-control { display: flex; align-items: center; gap: .5rem; }
.qty-btn {
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  color: var(--text2);
}
.qty-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.qty-input {
  width: 46px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .3rem;
  font-size: .88rem;
  font-family: var(--font-body);
}

.cart-summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  position: sticky;
  top: calc(var(--nav-h) + 1rem);
  box-shadow: var(--shadow-sm);
}
.cart-summary h3 {
  font-family: var(--font-head);
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  font-weight: 600;
  letter-spacing: -.01em;
}
.summary-row {
  display: flex;
  justify-content: space-between;
  padding: .55rem 0;
  font-size: .9rem;
  color: var(--text2);
}
.summary-row.total {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text);
  border-top: 1px solid var(--border);
  padding-top: 1rem;
  margin-top: .5rem;
}
.divider { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }

/* Pagamento */
.payment-tabs { display: flex; gap: .75rem; margin-bottom: 1.5rem; }
.pay-tab {
  flex: 1;
  padding: .75rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
  cursor: pointer;
  font-weight: 500;
  font-size: .84rem;
  transition: var(--transition);
  color: var(--text2);
}
.pay-tab.active {
  border-color: var(--accent);
  background: rgba(42,74,18,.04);
  color: var(--accent);
}
#paypal-btn-container { min-height: 45px; }
#panel-paypal { min-height: 45px; }

/* ── Account ──────────────────────────────────────────────────── */
.account-layout { display: grid; grid-template-columns: 230px 1fr; gap: 2rem; }
.account-sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  height: fit-content;
  box-shadow: var(--shadow-sm);
}
.account-sidebar h3 {
  font-family: var(--font-head);
  margin-bottom: 1rem;
  font-size: 1.15rem;
  font-weight: 600;
}
.account-nav a {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .65rem .9rem;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  color: var(--text2);
  transition: var(--transition);
  margin-bottom: .2rem;
}
.account-nav a:hover, .account-nav a.active {
  background: var(--bg2);
  color: var(--accent);
}
.account-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.25rem;
  box-shadow: var(--shadow-sm);
}
.account-panel h2 {
  font-family: var(--font-head);
  font-size: 1.75rem;
  margin-bottom: 1.75rem;
  font-weight: 600;
  letter-spacing: -.01em;
}

/* Ordini tabella */
.orders-table { width: 100%; border-collapse: collapse; }
.orders-table th, .orders-table td {
  padding: .85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: .88rem;
}
.orders-table th {
  background: var(--bg2);
  font-weight: 500;
  text-transform: uppercase;
  font-size: .72rem;
  letter-spacing: .08em;
  color: var(--text2);
}
.status-badge {
  padding: .25rem .75rem;
  border-radius: 30px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .04em;
}
.status-pagato    { background: #e8f5ee; color: #1a5c35; }
.status-in_attesa { background: #fef9ec; color: #7a5a0a; }
.status-spedito   { background: #eef4fd; color: #1a3d7a; }
.status-consegnato{ background: #e8f5ee; color: #1a5c35; }
.status-annullato { background: #fdf0ef; color: #7a1f1a; }

/* ── Chi siamo ────────────────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: center;
}
.about-img {
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: var(--bg2);
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  transition: transform var(--transition);
}
.about-img:hover { transform: scale(1.01); }
.values-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.value-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  transition: var(--transition);
}
.value-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: rgba(42,74,18,.15);
}
.value-icon { font-size: 2rem; margin-bottom: 1rem; }
.value-card h3 {
  font-family: var(--font-head);
  font-size: 1.1rem;
  margin-bottom: .5rem;
  font-weight: 600;
}
.value-card p { font-size: .84rem; color: var(--text2); line-height: 1.65; font-weight: 300; }

/* ── Dove trovarci ────────────────────────────────────────────── */
.map-container {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.map-container iframe { width: 100%; height: 420px; border: none; display: block; }
.contacts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.25rem; }
.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: var(--transition);
}
.contact-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.contact-icon { font-size: 1.75rem; margin-bottom: .85rem; }
.contact-card h4 { font-size: .88rem; font-weight: 600; margin-bottom: .4rem; letter-spacing: .02em; }
.contact-card p, .contact-card a { font-size: .84rem; color: var(--text2); font-weight: 300; }
.contact-card a:hover { color: var(--accent); }

/* ── Contratti ────────────────────────────────────────────────── */
.legal-layout { display: grid; grid-template-columns: 220px 1fr; gap: 2rem; }
.legal-toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  position: sticky;
  top: calc(var(--nav-h) + 1rem);
  height: fit-content;
}
.legal-toc a {
  display: block;
  padding: .5rem .75rem;
  font-size: .86rem;
  color: var(--text2);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.legal-toc a:hover { background: var(--bg2); color: var(--accent); }
.legal-content h2 {
  font-family: var(--font-head);
  font-size: 1.6rem;
  color: var(--accent);
  margin: 2rem 0 .75rem;
  padding-top: 1rem;
  font-weight: 600;
}
.legal-content h3 { font-size: 1rem; font-weight: 600; margin: 1.5rem 0 .5rem; }
.legal-content p, .legal-content li {
  font-size: .9rem;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: .75rem;
  font-weight: 300;
}
.legal-content ul { padding-left: 1.5rem; list-style: disc; }

/* ── Footer ───────────────────────────────────────────────────── */
.footer {
  background: var(--text);
  color: rgba(255,255,255,.6);
  margin-top: 5rem;
  padding: 4rem 2.5rem 0;
}
.footer-grid {
  max-width: 1320px;
  margin: auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.footer-logo {
  font-family: var(--font-head);
  font-size: 1.5rem;
  color: #fff;
  margin-bottom: .85rem;
  font-weight: 600;
  letter-spacing: -.01em;
}
.footer-col p { font-size: .84rem; line-height: 1.7; font-weight: 300; }
.footer-col h4 {
  color: rgba(255,255,255,.85);
  font-size: .75rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 1.1rem;
  font-weight: 500;
}
.footer-col ul { display: flex; flex-direction: column; gap: .5rem; }
.footer-col li { font-size: .84rem; }
.footer-col a { transition: color var(--transition); }
.footer-col a:hover { color: var(--gold2); }
.footer-bottom {
  max-width: 1320px;
  margin: auto;
  padding: 1.5rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .78rem;
  color: rgba(255,255,255,.35);
}
.payment-icons { display: flex; gap: .75rem; }

/* ── Page banner ──────────────────────────────────────────────── */
.page-banner {
  background: var(--accent);
  color: #fff;
  padding: 4rem 2.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.page-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 100% at 50% 0%, rgba(93,140,48,.4) 0%, transparent 70%);
}
.page-banner h1 {
  font-family: var(--font-head);
  font-size: 3rem;
  margin-bottom: .5rem;
  font-weight: 600;
  letter-spacing: -.02em;
  position: relative;
  animation: fadeUp .5s var(--transition) both;
}
.page-banner p {
  opacity: .75;
  font-size: .95rem;
  position: relative;
  font-weight: 300;
  animation: fadeUp .5s var(--transition) .1s both;
}

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .products-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 960px) {
  .cart-layout,
  .account-layout,
  .legal-layout   { grid-template-columns: 1fr; }
  .footer-grid    { grid-template-columns: 1fr 1fr; }
  .about-grid,
  .values-grid    { grid-template-columns: 1fr; }
  .form-row       { grid-template-columns: 1fr; }
  .products-grid  { grid-template-columns: repeat(2, 1fr); }
  .hero h1        { font-size: 3.2rem; }
}

@media (max-width: 768px) {
  /* Navbar mobile */
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .nav-container { padding: 0 1.25rem; gap: .75rem; }
  .nav-logo { font-size: 1.15rem; }
  .logo-icon { display: none; }
  .btn-icon { padding: .4rem .5rem; }
  .btn-icon span { display: none; } /* nasconde testo "Accedi" su mobile */
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    background: rgba(247,245,240,.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 1.5rem;
    z-index: 998;
    animation: fadeUp .2s var(--transition);
  }

  /* Hero mobile */
  .hero { padding: 5rem 1.5rem 4rem; min-height: 340px; }
  .hero h1 { font-size: 2.2rem; line-height: 1.15; }
  .hero p { font-size: .9rem; margin-bottom: 2rem; }
  .hero .btn { padding: .85rem 2rem; font-size: .82rem; }
  .hero-scroll { display: none; }

  /* Testi sezione */
  .section-title { font-size: 1.8rem; }
  .section-subtitle { font-size: .88rem; margin-bottom: 2rem; }
  .container { padding: 0 1rem; }
  .section { padding: 3rem 0; }

  /* Filtri catalogo */
  .catalog-filters { padding: 1rem; gap: .75rem; }
  .catalog-filters form { gap: .5rem; }
  .filter-search { width: 100%; }
  .filter-search input { flex: 1; min-width: 0; font-size: .88rem; }
  .filter-cats { display: flex; flex-wrap: wrap; gap: .4rem; width: 100%; }
  .filter-cat-btn { padding: .3rem .75rem; font-size: .75rem; }

  /* Griglia prodotti */
  .products-grid { grid-template-columns: repeat(2, 1fr); gap: .75rem; }
  .product-desc { display: none; }
  .product-body { padding: .85rem; }
  .price-new { font-size: 1rem; }
  .product-name { font-size: .9rem; }

  /* Page banner */
  .page-banner { padding: 2.5rem 1.25rem; }
  .page-banner h1 { font-size: 1.8rem; }
  .page-banner p { font-size: .88rem; }

  /* Footer */
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }

  /* Flash message */
  .flash { margin: .75rem 1rem 0; padding: .75rem 1rem; font-size: .84rem; }

  /* Carrello mobile */
  .cart-table thead { display: none; }
  .cart-table tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .5rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
    align-items: center;
  }
  .cart-table td {
    padding: .25rem .5rem;
    border-bottom: none;
  }
  .cart-table td:first-child { display: none; }
  .cart-table td:nth-child(2) { grid-column: 1 / -1; font-weight: 600; font-size: .95rem; }
  .cart-table td:nth-child(3) { font-size: .9rem; }
  .cart-table td:last-child {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
  }
  .cart-item-img { display: none; }
  .cart-summary { padding: 1.25rem; }

  /* Checkout card consegna */
  .consegna-card { padding: .75rem .5rem !important; }

  /* Account mobile */
  .account-layout { grid-template-columns: 1fr; }
  .account-sidebar { margin-bottom: 0; }
  .orders-table { font-size: .78rem; }
  .orders-table th, .orders-table td { padding: .5rem .4rem; }
  .orders-table th:nth-child(4),
  .orders-table td:nth-child(4),
  .orders-table th:nth-child(5),
  .orders-table td:nth-child(5) { display: none; }
  .account-panel { padding: 1.25rem; }
  .account-panel h2 { font-size: 1.4rem; margin-bottom: 1.25rem; }

  /* Form generici */
  .form-group input,
  .form-group select,
  .form-group textarea {
    font-size: 16px; /* previene zoom automatico su iOS */
  }

  /* User dropdown */
  .user-dropdown {
    right: -1rem;
    min-width: 180px;
  }

  /* ── Pagina Prodotto mobile ───────────────────────────── */
  .prodotto-layout {
    grid-template-columns: 1fr !important;
    gap: 1.75rem !important;
    margin-bottom: 3rem !important;
  }

  /* Immagine prodotto: aspect-ratio più compatto su mobile */
  .prodotto-layout > div:first-child {
    aspect-ratio: 3/2 !important;
    border-radius: var(--radius-sm) !important;
  }

  /* Info prodotto: rimuove padding-top eccessivo */
  .prodotto-layout > div:last-child {
    padding-top: 0 !important;
  }

  /* Titolo prodotto più piccolo */
  .prodotto-layout h1 {
    font-size: 2rem !important;
    margin-bottom: .75rem !important;
  }

  /* Prezzo */
  .prodotto-layout [style*="font-size:2rem"] {
    font-size: 1.5rem !important;
  }

  /* Form aggiungi al carrello: impilato verticalmente */
  .prodotto-layout form {
    flex-direction: column !important;
    gap: .75rem !important;
  }

  /* Selettore quantità: larghezza piena */
  .prodotto-layout form > div {
    width: 100% !important;
    justify-content: center;
  }

  /* Bottone carrello: larghezza piena */
  .prodotto-layout form .btn {
    width: 100% !important;
    justify-content: center;
    padding: .9rem 1rem !important;
    font-size: .9rem !important;
  }

  /* Input quantità più alto (touch-friendly) */
  .prodotto-layout input[type="number"] {
    height: 48px !important;
    font-size: 1rem !important;
  }

  /* Pulsanti +/- più grandi */
  .prodotto-layout form button[type="button"] {
    width: 48px !important;
    height: 48px !important;
    flex-shrink: 0;
  }

  /* Info spedizione */
  .prodotto-layout [style*="background:var(--bg2)"] {
    font-size: .8rem !important;
  }

  /* Valori nutrizionali: 2 colonne su mobile */
  .prodotto-layout ~ div [style*="grid-template-columns:repeat(5"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Sezione nutrizionale titolo */
  .prodotto-layout ~ div h2 {
    font-size: 1.5rem !important;
  }

  /* Ricetta */
  .prodotto-layout ~ div [style*="padding:2.5rem"] {
    padding: 1.5rem 1.25rem !important;
  }
}

@media (max-width: 400px) {
  .products-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.9rem; }
  .nav-logo-img { height: 48px; }

  /* Prodotto: titolo ancora più compatto */
  .prodotto-layout h1 { font-size: 1.7rem !important; }
}