/* ===== TOKENS ===== */
:root {
  --terra:     #A0522D;
  --terra-dk:  #7A3B1E;
  --wheat:     #F5DEB3;
  --wheat-lt:  #FDF6E3;
  --green:     #4A6741;
  --green-lt:  #6B8F68;
  --brown:     #3E2723;
  --brown-lt:  #5D4037;
  --cream:     #FAF3E0;
  --gold:      #C9A84C;
  --text:      #2C1810;
  --text-lt:   #6B4C3B;
  --border:    #D4B896;
  --shadow:    rgba(62,39,35,.15);
  --ff-serif:  'Playfair Display', Georgia, serif;
  --ff-sans:   'Lato', system-ui, sans-serif;
  --radius:    12px;
  --radius-lg: 20px;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--ff-sans); background: var(--cream); color: var(--text); line-height: 1.6; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* ===== CONTAINER ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 28px; border-radius: 50px; font-family: var(--ff-sans);
  font-weight: 700; font-size: .95rem; cursor: pointer; transition: all .25s;
  border: 2px solid transparent;
}
.btn-primary { background: var(--terra); color: #fff; border-color: var(--terra); }
.btn-primary:hover { background: var(--terra-dk); border-color: var(--terra-dk); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(160,82,45,.35); }
.btn-outline { background: transparent; color: var(--terra); border-color: var(--terra); }
.btn-outline:hover { background: var(--terra); color: #fff; }
.btn-ghost { background: rgba(255,255,255,.15); color: #fff; border-color: rgba(255,255,255,.5); backdrop-filter: blur(8px); }
.btn-ghost:hover { background: rgba(255,255,255,.28); }
.btn-cart { background: #FFFFFF !important; color: #1A100D !important; border: 2px solid var(--terra) !important; padding: 10px 20px; font-size: 1rem; position: relative; box-shadow: 0 4px 12px rgba(0,0,0,0.1); font-weight: 700; }
.btn-cart:hover { background: #FAF3E0 !important; border-color: var(--terra-dk) !important; transform: translateY(-2px); }
.cart-count { background: var(--terra) !important; color: #FFFFFF !important; border-radius: 50%; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; font-size: .78rem; font-weight: 700; margin-left: 6px; }

/* ===== HEADER TOP ===== */
.header-top { background: var(--brown); color: var(--wheat); font-size: .82rem; padding: 7px 0; }
.header-top-inner { display: flex; justify-content: space-between; align-items: center; }
.header-tagline { opacity: .85; }
.header-lang { display: flex; gap: 4px; }
.lang-btn { background: none; border: 1px solid transparent; color: var(--wheat); font-size: .78rem; padding: 2px 7px; border-radius: 4px; cursor: pointer; opacity: .65; transition: all .2s; }
.lang-btn:hover, .lang-btn.active { border-color: var(--gold); color: var(--gold); opacity: 1; }

/* ===== MAIN NAV LOGO ===== */
.main-nav { 
  background: var(--wheat-lt); 
  border-bottom: 2px solid var(--border); 
  position: sticky; 
  top: 0; 
  z-index: 100; 
  box-shadow: 0 2px 12px var(--shadow); 
  overflow: visible !important; 
}
.nav-inner { display: flex; align-items: center; gap: 32px; padding: 14px 24px; }
.logo { display: flex; align-items: center; gap: 10px; position: relative; z-index: 10; }
.logo-icon { font-size: 1.8rem; }
.logo-icon-img {
  height: 130px;
  width: 130px;
  object-fit: cover;
  object-position: center;
  border-radius: 50%;
  border: 3.5px solid var(--terra);
  display: block;
  transition: transform .3s;
  filter: drop-shadow(0 6px 16px rgba(62,39,35,.4));
  background: #fff;
  margin-top: -10px;
  margin-bottom: -60px;
}
.logo:hover .logo-icon-img {
  transform: scale(1.06);
}
.logo-text { display: none !important; } .logo-text { display: none !important; }
.nav-links { display: flex; gap: 28px; margin-left: auto; }
.nav-links a { font-size: .95rem; font-weight: 700; color: var(--text-lt); transition: color .2s; }
.nav-links a:hover { color: var(--terra); }
.nav-actions { display: flex; gap: 12px; align-items: center; }
.nav-toggle { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; color: var(--terra); }

/* ===== HERO ===== */
.hero { position: relative; min-height: 92vh; display: flex; align-items: center; overflow: hidden; }
.hero-bg {
  position: absolute; inset: 0;
  background: url('images/hero-bg.jpg') center/cover no-repeat;
}
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(160deg, rgba(20,35,50,.78) 0%, rgba(40,70,45,.50) 60%, rgba(62,39,35,.35) 100%); }
.hero-content { position: relative; z-index: 2; max-width: 700px; padding: 80px 0 60px; }
.hero-label { color: var(--wheat); font-size: .9rem; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; margin-bottom: 18px; opacity: .9; }
.hero-title { font-family: var(--ff-serif); font-size: clamp(2.4rem, 5vw, 4rem); color: #fff; line-height: 1.15; margin-bottom: 22px; }
.hero-title em { color: var(--gold); font-style: italic; }
.hero-sub { color: var(--wheat); font-size: 1.1rem; line-height: 1.7; margin-bottom: 36px; max-width: 560px; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 56px; }
.hero-stats { display: flex; align-items: center; gap: 24px; }
.stat { text-align: center; }
.stat-n { display: block; font-family: var(--ff-serif); font-size: 1.9rem; color: var(--gold); font-weight: 700; }
.stat-l { display: block; font-size: .78rem; color: var(--wheat); text-transform: uppercase; letter-spacing: 1px; opacity: .8; }
.stat-divider { width: 1px; height: 40px; background: rgba(255,255,255,.25); }
.hero-scroll { position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%); color: rgba(255,255,255,.6); font-size: 1.5rem; animation: bounce 2s infinite; }
@keyframes bounce { 0%,100%{transform:translateX(-50%) translateY(0)} 50%{transform:translateX(-50%) translateY(8px)} }

/* ===== SECTIONS ===== */
.section { padding: 80px 0; }
.section-header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; margin-bottom: 48px; }
.section-tag { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 2px; color: var(--terra); background: rgba(160,82,45,.1); padding: 4px 12px; border-radius: 50px; width: 100%; }
.section-title { font-family: var(--ff-serif); font-size: clamp(1.7rem,3vw,2.4rem); color: var(--brown); flex: 1; }
.section-link { font-size: .9rem; font-weight: 700; color: var(--terra); transition: gap .2s; }
.section-link:hover { text-decoration: underline; }
.section-header.light .section-tag { color: var(--wheat); background: rgba(255,255,255,.15); }
.section-header.light .section-title { color: #fff; }

/* ===== CATEGORIES ===== */
.categories-section { background: var(--wheat-lt); padding: 50px 0; }
.categories-section { 
  position: relative;
  background: linear-gradient(180deg, rgba(30, 18, 15, 0.82) 0%, rgba(62, 39, 35, 0.88) 100%), url('images/guerriero-murales.jpg') center 30%/cover no-repeat;
  padding: 64px 0 72px;
}
.categories-section .section-tag { color: var(--gold); background: rgba(201,168,76,0.18); border: 1px solid rgba(201,168,76,0.35); }
.categories-section .section-title { color: #ffffff; text-shadow: 0 2px 10px rgba(0,0,0,0.6); }

.categories-grid { 
  display: grid; 
  grid-template-columns: repeat(7, 1fr); 
  gap: 12px; 
}
.category-card {
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(8px); 
  border: 1.5px solid var(--border); 
  border-radius: 16px;
  padding: 16px 10px; 
  text-align: center; 
  transition: all .25s ease; 
  display: flex; 
  flex-direction: column; 
  align-items: center;
  justify-content: center;
  gap: 6px;
  position: relative; 
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(62,39,35,.04);
}
.category-card::before { 
  content: ''; 
  position: absolute; 
  inset: 0; 
  background: linear-gradient(135deg, var(--terra), var(--brown)); 
  opacity: 0; 
  transition: opacity .25s ease; 
}
.category-card:hover::before { opacity: 1; }
.category-card:hover { 
  transform: translateY(-4px); 
  box-shadow: 0 10px 24px var(--shadow); 
  border-color: transparent; 
}
.category-card:hover h3, .category-card:hover p, .category-card:hover .cat-arrow { 
  color: #fff !important; 
  position: relative; 
  z-index: 1; 
}
.cat-img { 
  width: 58px; 
  height: 58px; 
  border-radius: 50%; 
  object-fit: cover; 
  object-position: center;
  border: 2px solid var(--terra);
  position: relative; 
  z-index: 1; 
  transition: transform .25s ease, border-color .25s ease;
  box-shadow: 0 4px 10px rgba(0,0,0,.12);
}
.category-card:hover .cat-img {
  transform: scale(1.1);
  border-color: var(--gold);
}
.category-card h3 { 
  font-family: var(--ff-serif); 
  font-size: .88rem; 
  font-weight: 700;
  color: var(--brown); 
  position: relative; 
  z-index: 1; 
  transition: color .25s; 
  line-height: 1.25;
}
.category-card p { 
  font-size: .72rem; 
  color: var(--text-lt); 
  position: relative; 
  z-index: 1; 
  transition: color .25s;
  opacity: .9;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cat-arrow { 
  display: none;
}

@media (max-width: 1024px) {
  .categories-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 10px;
  }
  .category-card {
    min-width: 140px;
    scroll-snap-align: start;
    flex-shrink: 0;
  }
}

/* ===== PRODUCTS GRID ===== */
.products-section { background: var(--cream); }
.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px,1fr)); gap: 24px; }
.product-card {
  background: #fff; border: 1.5px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; transition: all .3s; display: flex; flex-direction: column;
}
.product-card:hover { transform: translateY(-5px); box-shadow: 0 16px 40px var(--shadow); border-color: var(--terra); }
.product-img { width: 100%; aspect-ratio: 4/3; object-fit: cover; background: var(--wheat); display: flex; align-items: center; justify-content: center; font-size: 4rem; }
.product-body { padding: 18px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.product-tag { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--terra); }
.product-name { font-family: var(--ff-serif); font-size: 1.05rem; color: var(--brown); }
.product-producer { font-size: .8rem; color: var(--text-lt); }
.product-footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border); }
.product-price { font-family: var(--ff-serif); font-size: 1.25rem; font-weight: 700; color: var(--terra); }
.product-price small { font-size: .75rem; color: var(--text-lt); font-family: var(--ff-sans); font-weight: 400; }
.btn-add { background: var(--terra); color: #fff; border: none; border-radius: 50%; width: 38px; height: 38px; font-size: 1.2rem; cursor: pointer; transition: all .2s; display: flex; align-items: center; justify-content: center; }
.btn-add:hover { background: var(--terra-dk); transform: scale(1.1); }

/* ===== HOW IT WORKS ===== */
.how-section {
  position: relative;
  background: var(--brown-dk);
  color: var(--wheat);
  overflow: hidden;
}

.how-bg {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(180deg, rgba(30, 18, 15, 0.82) 0%, rgba(62, 39, 35, 0.88) 100%), 
              url('images/guerriero-murales.jpg') center 30%/cover no-repeat;
}
.how-section .container { position: relative; z-index: 2; }
.steps-grid { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: center; }
.step { background: rgba(255,255,255,.1); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.2); border-radius: var(--radius-lg); padding: 36px 28px; text-align: center; flex: 1; min-width: 180px; max-width: 220px; }
.step-num { font-family: var(--ff-serif); font-size: 3rem; color: var(--gold); opacity: .6; line-height: 1; margin-bottom: 8px; }
.step-img { 
  width: 72px; 
  height: 72px; 
  border-radius: 50%; 
  object-fit: cover; 
  border: 2px solid var(--gold); 
  margin-bottom: 12px; 
  box-shadow: 0 6px 16px rgba(0,0,0,0.3);
  transition: transform .25s ease, border-color .25s ease;
}
.step:hover .step-img { transform: scale(1.1); border-color: #ffffff; }
.step h3 { font-family: var(--ff-serif); font-size: 1.2rem; color: #fff; margin-bottom: 10px; }
.step p { font-size: .85rem; color: var(--wheat); line-height: 1.6; }
.step-arrow { font-size: 1.8rem; color: var(--gold); opacity: .6; }

/* ===== PRODUCERS ===== */
.producers-section { background: var(--wheat-lt); }
.producers-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 24px; }
.producer-card { background: #fff; border: 1.5px solid var(--border); border-radius: var(--radius-lg); padding: 28px; display: flex; gap: 18px; transition: all .3s; }
.producer-card:hover { transform: translateY(-3px); box-shadow: 0 12px 32px var(--shadow); border-color: var(--terra); }
.producer-avatar { width: 60px; height: 60px; border-radius: 50%; background: var(--wheat); display: flex; align-items: center; justify-content: center; font-size: 2rem; flex-shrink: 0; border: 3px solid var(--terra); }
.producer-info h3 { font-family: var(--ff-serif); font-size: 1rem; color: var(--brown); margin-bottom: 4px; }
.producer-info p { font-size: .8rem; color: var(--text-lt); margin-bottom: 8px; }
.producer-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.producer-tag { font-size: .7rem; background: rgba(160,82,45,.1); color: var(--terra); border-radius: 50px; padding: 2px 10px; font-weight: 700; }

/* ===== SELL CTA ===== */
.sell-cta-section { background: var(--cream); }
.sell-cta-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }
.sell-cta-text .section-tag { width: auto; display: inline-block; }
.sell-cta-text h2 { font-family: var(--ff-serif); font-size: clamp(1.7rem,3vw,2.4rem); color: var(--brown); margin: 16px 0 24px; }
.sell-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 32px; }
.sell-list li { font-size: .95rem; color: var(--text-lt); }
.sell-cta-card { background: #fff; border: 2px solid var(--border); border-radius: var(--radius-lg); padding: 28px; box-shadow: 0 16px 48px var(--shadow); }
.sell-card-header { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.sell-card-avatar { font-size: 2.5rem; }
.sell-card-header strong { display: block; font-size: 1rem; color: var(--brown); }
.sell-card-header small { font-size: .8rem; color: var(--text-lt); }
.sell-card-stat { display: flex; gap: 12px; margin-bottom: 24px; }
.sell-stat-item { flex: 1; text-align: center; background: var(--wheat-lt); border-radius: var(--radius); padding: 12px 8px; }
.sell-stat-n { display: block; font-family: var(--ff-serif); font-size: 1.2rem; font-weight: 700; color: var(--terra); }
.sell-stat-l { display: block; font-size: .7rem; color: var(--text-lt); }
.sell-card-chart { display: flex; align-items: flex-end; gap: 6px; height: 80px; background: var(--wheat-lt); border-radius: var(--radius); padding: 12px; }
.bar { flex: 1; background: var(--border); border-radius: 4px 4px 0 0; transition: background .2s; }
.bar.active { background: var(--terra); }

/* ===== FOOTER ===== */
.site-footer { background: var(--brown); color: var(--wheat); padding: 64px 0 32px; margin-top: auto; }
.footer-inner { 
  display: flex; 
  justify-content: space-between; 
  align-items: flex-start; 
  gap: 48px; 
  margin-bottom: 48px;
  width: 100%;
}
.footer-brand { flex: 0 0 320px; }
.footer-brand .logo { margin-bottom: 16px; }
.footer-brand .logo-icon-img { width: 48px; height: 48px; margin: 0; border-width: 2px; }
.footer-brand .logo-text { color: var(--wheat); }
.footer-brand p { font-size: .9rem; color: #e2d1c3; margin: 16px 0 16px; opacity: .9; line-height: 1.6; }
.footer-socials { display: flex; gap: 14px; align-items: center; }
.footer-social-link { 
  display: inline-flex; 
  align-items: center; 
  justify-content: center; 
  width: 36px; 
  height: 36px; 
  border-radius: 50%; 
  background: rgba(255,255,255,.12); 
  color: var(--wheat); 
  transition: all .25s ease; 
  border: 1px solid rgba(255,255,255,.2);
}
.footer-social-link svg { width: 18px; height: 18px; fill: currentColor; }
.footer-social-link:hover { 
  background: var(--gold); 
  color: var(--brown); 
  transform: translateY(-2px); 
  border-color: var(--gold);
}
.footer-links { 
  flex: 1; 
  display: flex; 
  justify-content: space-between; 
  gap: 32px; 
}
.footer-col { flex: 1; }
.footer-col h4 { font-family: var(--ff-serif); font-size: 1.05rem; color: var(--gold); margin-bottom: 16px; font-weight: 700; }
.footer-col ul { display: flex; flex-direction: column; gap: 12px; }
.footer-col a { font-size: .9rem; color: #e2d1c3; transition: color .2s; opacity: .88; white-space: nowrap; }
.footer-col a:hover { color: #ffffff; opacity: 1; text-decoration: underline; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.15); padding-top: 24px; font-size: .85rem; color: #e2d1c3; }
.footer-bottom .container { display:flex; justify-content:space-between; width:100%; align-items:center; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .sell-cta-inner { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; gap: 36px; }
  .footer-brand { flex: 1 1 auto; width: 100%; }
  .footer-links { width: 100%; }
  .steps-grid { gap: 8px; }
  .step-arrow { display: none; }
}
@media (max-width: 640px) {
  .nav-inner { padding: 8px 12px; gap: 8px; justify-content: space-between; width: 100%; }
  .logo { gap: 6px !important; flex-shrink: 1; min-width: 0; }
  .logo-icon-img {
    height: 48px !important;
    width: 48px !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    border-width: 2px !important;
  }
  .logo-text { display: none !important; }
  .nav-actions { gap: 6px !important; flex-shrink: 0; }
  .btn-cart { padding: 6px 12px !important; font-size: 0.82rem !important; white-space: nowrap; }
  .nav-links, .nav-actions .btn-outline { display: none; }
  .nav-toggle { display: block; }
  .hero-actions { flex-direction: column; }
  .categories-grid { grid-template-columns: repeat(2,1fr); }
  .footer-links { flex-direction: column; gap: 24px; }
  .footer-bottom .container { flex-direction: column; gap: 8px; text-align: center; }
}


.promo-badge {
  display: inline-block;
  background: #dc2626;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  vertical-align: middle;
  margin-right: 4px;
}

.promo-ribbon {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 4;
  background: #dc2626;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

.promo-remaining {
  display: block;
  font-size: 0.72rem;
  color: var(--green);
  font-weight: 700;
  margin-top: 2px;
}

/* ── MOBILE PWA & BOTTOM NAV STYLES ── */
:root {
  --mobile-nav-height: 62px;
}

@keyframes slideUpPwa {
  from { transform: translateY(100px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

#mobile-bottom-nav {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  max-width: 100vw !important;
  z-index: 99999 !important;
  display: none;
  align-items: stretch;
  justify-content: space-around;
  height: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px));
  min-height: var(--mobile-nav-height);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: #FAF3E0;
  border-top: 1.5px solid var(--border);
  box-shadow: 0 -4px 16px rgba(0,0,0,0.08);
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  contain: layout style;
}

@media (min-width: 641px) {
  #mobile-bottom-nav {
    display: none !important;
  }
  body.has-mobile-nav {
    padding-bottom: 0 !important;
  }
}

.mb-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #6b7280;
  text-decoration: none;
  font-size: 0.65rem;
  font-weight: 700;
  gap: 2px;
  flex: 1 1 0;
  min-width: 0;
  padding: 6px 4px;
  transition: color 0.2s ease, background 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.mb-nav-item .mb-text {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.1;
  text-align: center;
}

.mb-nav-item .mb-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.mb-icon-cart {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mb-cart-count {
  position: absolute;
  top: -6px;
  right: -12px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--terra);
  color: #fff;
  font-size: 0.58rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.mb-cart-count[hidden] {
  display: none !important;
}

.mb-nav-item.active,
.mb-nav-item:hover {
  color: #4a6741;
}

.mb-nav-item.active {
  background: rgba(74, 103, 65, 0.08);
}

@media (max-width: 640px) {
  #mobile-bottom-nav {
    display: flex !important;
  }

  body.has-mobile-nav {
    padding-bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px) + 8px) !important;
  }

  body.has-mobile-nav .scroll-top-btn,
  body.has-mobile-nav #marsorum-back-to-top,
  body.has-mobile-nav #marsorum-accessibility-btn {
    bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px) + 12px) !important;
  }
}


/* ── WORLD-CLASS MOBILE RESPONSIVE DESIGN SYSTEM ── */
@media (max-width: 768px) {
  /* Prevent iOS WebKit input zoom */
  input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="number"], select, textarea {
    font-size: 16px !important;
  }

  html {
    max-width: 100%;
  }

  body {
    max-width: 100%;
  }

  /* Non usare overflow-x su html/body: rompe position:fixed della bottom nav su iOS/Android */
  main,
  .site-header,
  .site-footer,
  .reg-page,
  .dash-layout {
    max-width: 100vw;
    overflow-x: clip;
  }

  img, video, iframe {
    max-width: 100%;
    height: auto;
  }

  /* Partner dashboard (produttori) */
  .dash-layout .container {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  .dash-form-grid,
  .dash-docs-grid {
    grid-template-columns: 1fr !important;
  }
  #product-modal .modal-box {
    width: 96vw !important;
    max-width: 96vw !important;
  }

  /* Header & Navigation on Mobile */
  .main-nav {
    padding: 6px 0 !important;
  }
  .nav-inner {
    padding: 6px 14px !important;
    gap: 8px !important;
    justify-content: space-between !important;
    width: 100% !important;
  }
  .logo {
    gap: 8px !important;
    flex-shrink: 1;
    min-width: 0;
  }
  .logo-icon-img {
    height: 44px !important;
    width: 44px !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    border-width: 2px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
  }
  .logo-text { display: none !important; }
  .nav-actions {
    gap: 6px !important;
    flex-shrink: 0;
    align-items: center;
  }
  .nav-actions .btn-outline {
    display: none !important;
  }
  .btn-cart {
    padding: 6px 12px !important;
    font-size: 0.85rem !important;
    border-radius: 20px !important;
  }
  .nav-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: rgba(160,82,45,0.12);
    color: var(--terra);
    font-size: 1.3rem;
    border: none;
    cursor: pointer;
  }

  /* Slide-Down Mobile Drawer Navigation */
  .nav-links {
    display: none;
    flex-direction: column !important;
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    background: #FAF3E0 !important;
    border-bottom: 2px solid var(--border) !important;
    padding: 16px 20px !important;
    gap: 10px !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2) !important;
    z-index: 9999 !important;
  }
  .nav-links.open {
    display: flex !important;
  }
  .nav-links a {
    font-size: 1rem !important;
    padding: 10px 14px !important;
    border-radius: 8px !important;
    background: rgba(255,255,255,0.7) !important;
    color: var(--text) !important;
    font-weight: 700 !important;
    text-align: left !important;
  }

  /* Hero Section on Mobile */
  .hero {
    min-height: auto !important;
    padding: 36px 0 48px !important;
  }
  .hero-content {
    padding: 16px 0 !important;
    text-align: center !important;
  }
  .hero-title {
    font-size: 2.1rem !important;
    line-height: 1.2 !important;
  }
  .hero-sub {
    font-size: 0.95rem !important;
    margin-bottom: 20px !important;
  }
  .hero-actions {
    justify-content: center !important;
    flex-direction: column !important;
    gap: 10px !important;
    margin-bottom: 30px !important;
  }
  .hero-actions .btn {
    width: 100% !important;
    justify-content: center !important;
  }
  .hero-stats {
    justify-content: center !important;
    gap: 12px !important;
  }
  .stat-n {
    font-size: 1.5rem !important;
  }

  /* 2-Column Touch Grid for Products on Mobile */
  .products-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
  .product-card {
    border-radius: 12px !important;
    overflow: hidden !important;
  }
  .product-card img {
    height: 130px !important;
  }
  .product-body {
    padding: 10px !important;
  }
  .product-title, .product-name {
    font-size: 0.9rem !important;
    line-height: 1.3 !important;
  }
  .product-producer {
    font-size: 0.72rem !important;
  }
  .product-price {
    font-size: 1.05rem !important;
  }

  /* 2-Column Grid for Categories on Mobile */
  .categories-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
  .category-card {
    padding: 10px 6px !important;
  }
  .category-card img {
    height: 75px !important;
  }
  .category-card h3 {
    font-size: 0.85rem !important;
  }

  /* Touch Horizontal Scroll for Filter Pills */
  .cat-pills, .filter-pills, #cat-pills, #filter-pills {
    display: flex !important;
    overflow-x: auto !important;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    padding-bottom: 8px !important;
    margin-bottom: 16px !important;
    gap: 8px !important;
  }
  .cat-pill, .filter-pill {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    padding: 8px 14px !important;
    font-size: 0.82rem !important;
  }

  /* Responsive Tables & Containers */
  .table-responsive, table {
    display: block !important;
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .container {
    padding: 0 16px !important;
  }

  /* Modals on Mobile */
  #global-product-modal > div, #product-detail-modal > div, .modal-content, .dash-modal-content {
    width: 94vw !important;
    max-height: 88vh !important;
    overflow-y: auto !important;
    border-radius: 16px !important;
    margin: auto !important;
  }

  /* Compact top bar — more room for content on phones */
  .header-top {
    display: none !important;
  }

  /* Section spacing */
  .section {
    padding: 40px 0 !important;
  }

  /* Cart page — stack rows on narrow screens */
  .cart-item {
    flex-wrap: wrap !important;
    gap: 12px !important;
  }
  .cart-item-info {
    flex: 1 1 calc(100% - 90px) !important;
    min-width: 0 !important;
  }
  .cart-qty-ctrl,
  .cart-item-remove {
    flex-shrink: 0 !important;
  }

  /* Steps / how-it-works */
  .steps-grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }

  /* Reviews ticker */
  .reviews-ticker-wrap {
    height: 240px !important;
  }
  .reviews-ticker-host {
    min-height: 220px !important;
  }

  /* PWA banner above bottom nav */
  #pwa-install-banner {
    left: 16px !important;
    right: 16px !important;
    width: auto !important;
    max-width: none !important;
  }
}


/* ── STRICT HEADER OVERLAP FIX FOR MOBILE SMARTPHONES ── */
@media (max-width: 768px) {
  .nav-inner {
    padding: 6px 12px !important;
    gap: 6px !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    overflow: hidden !important;
  }
  .logo {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-shrink: 1 !important;
    min-width: 0 !important;
    max-width: 60% !important;
    overflow: hidden !important;
  }
  .logo-icon-img {
    height: 38px !important;
    width: 38px !important;
    min-width: 38px !important;
    margin: 0 !important;
    border-width: 2px !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15) !important;
  }
  .logo-text { display: none !important; }
  .nav-actions {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-shrink: 0 !important;
    max-width: 40% !important;
  }
  /* Hide login/register buttons in header on mobile to leave full room for logo and cart */
  #nav-login, #nav-register, .nav-actions .btn-outline, .nav-actions a:not(.btn-cart):not(.nav-toggle) {
    display: none !important;
  }
  .btn-cart {
    display: inline-flex !important;
    padding: 6px 10px !important;
    font-size: 0.8rem !important;
    white-space: nowrap !important;
    border-radius: 20px !important;
  }
  .nav-toggle {
    display: flex !important;
  }
}

@media (max-width: 400px) {
  .logo-text { display: none !important; }
  .logo-icon-img {
    height: 34px !important;
    width: 34px !important;
    min-width: 34px !important;
  }
  .btn-cart {
    padding: 5px 8px !important;
    font-size: 0.78rem !important;
  }
}


/* ── HIDE MARSORUM LOGO TEXT EXCLUSIVELY ON MOBILE PHONES ── */
@media (max-width: 768px) {
  .logo-text {
    display: none !important;
  }
  .logo {
    gap: 0 !important;
  }
  .logo-icon-img {
    height: 42px !important;
    width: 42px !important;
    margin: 0 !important;
  }
}


/* ── ABSOLUTE FORCE HIDE MOBILE LOGO TEXT ── */
@media (max-width: 768px) {
  .logo-text, span.logo-text, header .logo-text, .logo .logo-text {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    position: absolute !important;
  }
}
@media (max-width: 640px) {
  .logo-text, span.logo-text, header .logo-text, .logo .logo-text {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    position: absolute !important;
  }
}

/* ── Homepage: recensioni a scorrimento ── */
.reviews-ticker-host {
  min-height: 280px;
}

.reviews-ticker-wrap {
  height: 300px;
  overflow: hidden;
  position: relative;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 10%, #000 90%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 10%, #000 90%, transparent 100%);
}

.reviews-ticker-track {
  display: flex;
  flex-direction: column;
  gap: 14px;
  will-change: transform;
  animation: reviewsTickerScroll var(--reviews-duration, 40s) linear infinite;
}

.reviews-ticker-wrap:hover .reviews-ticker-track {
  animation-play-state: paused;
}

.reviews-ticker-static {
  height: auto;
  max-height: 320px;
  overflow-y: auto;
  mask-image: none;
  -webkit-mask-image: none;
}

.reviews-ticker-static .reviews-ticker-track {
  animation: none;
}

.review-card {
  background: #fff;
  padding: 16px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
  flex-shrink: 0;
}

.review-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.review-stars {
  color: #eab308;
  white-space: nowrap;
  font-size: 0.9rem;
}

.review-text {
  font-style: italic;
  font-size: 0.9rem;
  color: var(--text);
  margin: 0 0 8px;
  line-height: 1.45;
}

.review-meta {
  font-size: 0.78rem;
  color: var(--text-lt);
  line-height: 1.5;
  display: block;
}

@keyframes reviewsTickerScroll {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(0, -50%, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .reviews-ticker-wrap:not(.reviews-ticker-static) {
    height: auto;
    max-height: 320px;
    overflow-y: auto;
    mask-image: none;
    -webkit-mask-image: none;
  }

  .reviews-ticker-wrap:not(.reviews-ticker-static) .reviews-ticker-track {
    animation: none !important;
  }
}
