/* =====================================================================
   NUTRIOESTE — Catálogo digital
   Paleta: navy #1F2673 / cyan #29ABE2 / céu #EAF7FF / mango #FF8A3D
   ===================================================================== */

:root{
  --navy: #1F2673;
  --navy-2: #2B3390;
  --cyan: #29ABE2;
  --cyan-light: #6FCBEF;
  --sky: #EAF7FF;
  --mango: #FF8A3D;
  --mango-dark: #E86F1E;
  --ink: #1B2036;
  --paper: #FFFFFF;
  --line: #DCEBF5;
  --muted: #6B7690;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 8px 24px rgba(31,38,115,0.10);
  --shadow-lg: 0 16px 40px rgba(31,38,115,0.18);
  font-size: 16px;
}

*{ box-sizing: border-box; }
html{
  scroll-behavior: smooth;
  background:#fff;
  overscroll-behavior-y: none;
}
body{
  margin:0;
  font-family:'Inter', system-ui, sans-serif;
  color: var(--ink);
  background: #fff;
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
}
h1,h2,h3{ font-family:'Baloo 2', system-ui, sans-serif; margin:0; }
img{ max-width:100%; display:block; }
button{ font-family: inherit; cursor:pointer; }
input{ font-family: inherit; }
:focus-visible{ outline: 3px solid var(--mango); outline-offset: 2px; }

/* ===================== TOPBAR ===================== */
.topbar{
  position: sticky; top:0; z-index: 40;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.topbar-inner{
  max-width: 1180px; margin:0 auto;
  padding: 10px 20px;
  display:flex; align-items:center; gap:20px;
}
.logo{ height: 52px; width:auto; flex-shrink:0; }
.topbar-search{
  flex:1;
  display:flex; align-items:center; gap:8px;
  background: var(--sky);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 16px;
  max-width: 480px;
}
.topbar-search input{
  border:none; background:transparent; outline:none;
  width:100%; font-size: 0.95rem; color: var(--ink);
}
.icon-search{ width:18px; height:18px; fill: var(--muted); flex-shrink:0; }
.cart-btn{
  margin-left:auto;
  display:flex; align-items:center; gap:8px;
  background: var(--navy); color:#fff;
  border:none; border-radius: 999px;
  padding: 11px 18px 11px 14px;
  font-weight:700; font-size:0.92rem;
  position:relative;
  transition: transform .15s ease, background .15s ease;
}
.cart-btn:hover{ background: var(--navy-2); transform: translateY(-1px); }
.icon-cart{ width:20px; height:20px; fill:#fff; }
.cart-count{
  background: var(--mango); color:#fff;
  font-size:0.75rem; font-weight:800;
  min-width:20px; height:20px; border-radius:999px;
  display:flex; align-items:center; justify-content:center;
  padding: 0 5px;
}

/* ===================== HERO ===================== */
.hero{
  position:relative; overflow:hidden;
  background: #DEDDD8;
  padding: 28px 20px 0;
  height: 255px;
}
.hero-inner{
  max-width: 1180px; margin:0 auto; position:relative; z-index:1;
  height: 100%;
  display:flex; align-items:flex-end; justify-content:space-between; gap:28px;
}
.hero-text{ flex:1 1 420px; padding-bottom: 30px; }
.hero h1{
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  line-height:1.16; font-weight:800; color: var(--navy);
  text-shadow: 0 2px 0 rgba(31,38,115,0.12);
}
.hero-sub{
  margin: 10px 0 16px; color: #3C4670; max-width: 480px;
  font-size:1rem; line-height:1.48;
}
.hero-tags{ display:flex; flex-wrap:wrap; gap:8px; }
.hero-tags .tag{
  background:#fff;
  border: 1.5px solid rgba(31,38,115,0.12);
  color: var(--navy);
  padding: 8px 15px; border-radius: 999px;
  font-size: 0.85rem; font-weight:700;
  box-shadow: 0 4px 14px rgba(31,38,115,0.08);
}
.hero-photo{
  flex: 0 0 auto; width: 460px; max-width: 460px;
  align-self: flex-end;
  line-height:0;
}
.hero-photo img{
  width:100%; height:auto; display:block;
}
.hero-photo .hero-photo-mobile{ display:none; }

@media (max-width: 900px){
  .hero{ height: 335px; }
  .hero-inner{ flex-direction:column; align-items:center; justify-content:flex-end; text-align:center; gap:0; }
  .hero-text{ flex: 0 0 auto; padding-bottom:6px; }
  .hero h1{ font-size: 1.42rem; line-height:1.2; }
  .hero-sub{ margin-left:auto; margin-right:auto; margin-top:6px; margin-bottom:10px; font-size:0.88rem; line-height:1.4; }
  .hero-tags{ justify-content:center; gap:8px; }
  .hero-tags .tag{ padding:6px 12px; font-size:0.8rem; }
  .hero-photo{ flex: 0 0 auto; width:88%; max-width:440px; margin:0 auto; align-self:center; }
  .hero-photo .hero-photo-desktop{ display:none; }
  .hero-photo .hero-photo-mobile{ display:block; }
}

/* ===================== CATEGORY SHOWCASE (cartões grandes e fofos) ===================== */
.cat-showcase{ background:#fff; padding: 34px 20px 10px; }
.cat-showcase-inner{ max-width: 1180px; margin:0 auto; }
.cat-showcase-title{
  font-size: 1.5rem; font-weight:800; color: var(--navy);
  margin-bottom: 18px; text-align:center;
}
.cat-grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 14px;
}
.cat-card{
  background: var(--cat-bg, var(--sky));
  border: 2px solid transparent;
  border-radius: 20px;
  padding: 18px 10px 14px;
  display:flex; flex-direction:column; align-items:center; gap:8px;
  text-align:center;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.cat-card:hover{ transform: translateY(-4px); box-shadow: 0 10px 24px rgba(31,38,115,0.14); }
.cat-card.active{ border-color: var(--navy); box-shadow: 0 10px 24px rgba(31,38,115,0.16); }
.cat-card-badge{
  width:64px; height:64px; border-radius:50%;
  background:#fff; padding:6px;
  display:flex; align-items:center; justify-content:center;
  box-shadow: 0 4px 10px rgba(31,38,115,0.10);
}
.cat-card-badge img{ width:68%; height:68%; object-fit:contain; display:block; }
.cat-card-name{ font-weight:800; font-size:0.92rem; color: var(--navy); font-family:'Baloo 2',sans-serif; }

/* ===================== FLOATING WHATSAPP BUTTON ===================== */
.float-whatsapp{
  position: fixed; right: 20px;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: 45;
  display:flex; align-items:center; gap:10px;
  background:#25D366; color:#fff; text-decoration:none;
  padding: 14px; border-radius: 999px;
  box-shadow: 0 10px 24px rgba(37,211,102,0.45);
  transition: transform .18s ease, padding .18s ease, box-shadow .18s ease;
  overflow:hidden;
  transform: translateZ(0);
  will-change: transform;
}
.float-whatsapp .icon-wa{ width:26px; height:26px; fill:#fff; flex-shrink:0; }
.float-whatsapp-text{
  font-weight:800; font-size:0.9rem;
  max-width:0; opacity:0; white-space:nowrap;
  transition: max-width .25s ease, opacity .2s ease;
}
.float-whatsapp:hover{
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(37,211,102,0.55);
}
.float-whatsapp:hover .float-whatsapp-text{ max-width:160px; opacity:1; margin-right:2px; }

@media (max-width: 640px){
  .float-whatsapp{ right:16px; bottom:16px; padding:13px; }
  .float-whatsapp-text{ display:none; }
}

/* ===================== SUBCATEGORY ROW ===================== */
.subcat-row{
  max-width: 1180px; margin:0 auto;
  padding: 18px 20px 0;
  display:flex; gap:10px; flex-wrap:wrap;
  justify-content:center;
  scroll-margin-top: 90px;
}
.subcat-chip{
  background:#fff; border:2px solid var(--line);
  color: var(--navy); font-weight:700; font-size:0.85rem;
  padding: 8px 16px; border-radius: 999px;
  transition: all .15s ease;
}
.subcat-chip:hover{ border-color: var(--cyan); }
.subcat-chip.active{ background: var(--mango); border-color: var(--mango); color:#fff; }

/* ===================== CATALOG ===================== */
.catalog{ max-width: 1180px; margin: 0 auto; padding: 26px 20px 70px; }
.catalog-header{
  display:flex; align-items:baseline; justify-content:space-between;
  margin-bottom: 18px; gap:12px; flex-wrap:wrap;
}
.catalog-header h2{ font-size: 1.35rem; color: var(--navy); font-weight:800; }
.catalog-count{ color: var(--muted); font-size:0.88rem; margin:0; }
.empty-state{ text-align:center; color: var(--muted); padding: 60px 0; font-size:1rem; }

.product-grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
  scroll-margin-top: 90px;
}
.product-card{
  background:#fff; border-radius: var(--radius);
  border:1px solid var(--line);
  padding: 16px;
  display:flex; flex-direction:column; gap:6px;
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease;
}
.product-card:hover{ transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.product-media{
  height: 160px; border-radius: var(--radius-sm);
  background: #fff;
  display:flex; align-items:center; justify-content:center;
  overflow:hidden;
}
.product-media img{ width:100%; height:100%; object-fit:contain; padding:8px; box-sizing:border-box; }
.media-icon{ width:56%; height:56%; display:flex; align-items:center; justify-content:center; }
.media-icon img{ width:100%; height:100%; object-fit:contain; }
.product-sub{
  font-size:0.72rem; font-weight:700; letter-spacing:.03em;
  text-transform:uppercase; color: var(--cyan); margin:0;
}
.product-name{
  font-size:0.98rem; font-weight:700; color: var(--ink);
  line-height:1.25; margin:0; min-height: 2.4em;
}
.product-price{
  font-family:'Baloo 2', sans-serif;
  font-size:1.2rem; font-weight:700; color: var(--navy);
}
.product-price .unit{ font-size:0.72rem; font-weight:600; color: var(--muted); }
.product-price-pending{ font-size:0.95rem; color: var(--muted); font-style:italic; }
.add-btn:disabled{ background: var(--line); color: var(--muted); cursor:not-allowed; }
.add-btn:disabled:hover{ transform:none; }

.qty-row{ display:flex; align-items:center; gap:6px; margin-top:auto; }
.stepper{
  display:flex; align-items:center; border:1.5px solid var(--line);
  border-radius: 999px; overflow:hidden; flex-shrink:0;
}
.stepper button{
  width:26px; height:26px; border:none; background:#fff; color: var(--navy);
  font-size:1rem; font-weight:700; display:flex; align-items:center; justify-content:center;
}
.stepper button:hover{ background: var(--sky); }
.stepper .qty-val{ width:22px; text-align:center; font-weight:700; font-size:0.85rem; }
.weight-select{
  flex:1; min-width:0; border:1.5px solid var(--line); border-radius: 999px;
  padding: 6px 8px; font-size:0.8rem; font-weight:600; color: var(--navy);
  background:#fff;
}
.add-btn{
  background: var(--mango); color:#fff; border:none;
  width:32px; height:32px; border-radius: 50%; padding:0;
  flex-shrink:0; margin-left:auto;
  display:flex; align-items:center; justify-content:center;
  transition: background .15s ease, transform .15s ease;
}
.add-btn:hover{ background: var(--mango-dark); transform: translateY(-1px) scale(1.05); }
.add-btn svg{ width:16px; height:16px; fill:#fff; }

/* ===================== FOOTER ===================== */
.site-footer{
  background: var(--navy); color: #C7D3F0;
  text-align:center; padding: 34px 20px 40px;
}
.footer-logo{ height:56px; margin: 0 auto 14px; display:block; background:#fff; padding:8px 14px; border-radius: 14px; }
.site-footer p{ margin:4px 0; font-size:0.88rem; }
.footer-sub{ color:#8E9DCB; font-size:0.8rem !important; }

/* ===================== CART DRAWER ===================== */
.drawer-overlay{
  position:fixed; inset:0; background:rgba(15,20,50,0.45);
  opacity:0; pointer-events:none; transition: opacity .2s ease; z-index:50;
}
.drawer-overlay.open{ opacity:1; pointer-events:auto; }

.cart-drawer{
  position:fixed; top:0; right:0; height:100%;
  width: min(420px, 100vw);
  background:#fff; z-index:51;
  display:flex; flex-direction:column;
  overflow-y:auto;
  transform: translateX(100%);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  box-shadow: -12px 0 40px rgba(15,20,50,0.25);
}
.cart-drawer.open{ transform: translateX(0); }

.cart-header{
  display:flex; align-items:center; justify-content:space-between;
  padding: 18px 20px; border-bottom: 1px solid var(--line);
  position:sticky; top:0; background:#fff; z-index:2; flex-shrink:0;
}
.cart-header h2{ font-size:1.2rem; color: var(--navy); }
.close-btn{
  background: var(--sky); border:none; width:34px; height:34px; border-radius:50%;
  font-size:1.4rem; line-height:1; color: var(--navy); display:flex; align-items:center; justify-content:center;
}

.cart-body{ padding: 16px 20px; }
.cart-empty{ text-align:center; padding: 60px 10px; color: var(--muted); }
.cart-empty p:first-child{ font-size:1.1rem; margin-bottom:6px; }
.cart-empty-sub{ font-size:0.85rem; }

.cart-item{
  display:flex; gap:12px; padding: 14px 0; border-bottom: 1px solid var(--line);
}
.cart-item-media{
  width:52px; height:52px; border-radius:10px; background: var(--sky);
  flex-shrink:0; display:flex; align-items:center; justify-content:center; overflow:hidden;
}
.cart-item-media img{ width:100%; height:100%; object-fit:cover; }
.cart-item-media svg, .cart-item-media img[src*="icones"]{ width:60%; height:60%; object-fit:contain; }
.cart-item-info{ flex:1; min-width:0; }
.cart-item-name{ font-weight:700; font-size:0.9rem; color: var(--ink); margin:0 0 2px; }
.cart-item-meta{ font-size:0.78rem; color: var(--muted); margin:0 0 8px; }
.cart-item-row{ display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:6px; }
.cart-item-price{ font-weight:700; color: var(--navy); font-size:0.9rem; }
.cart-item-stepper{
  display:flex; align-items:center; gap:0; border:1.5px solid var(--line);
  border-radius: 999px; overflow:hidden;
}
.cart-item-stepper button{
  width:26px; height:26px; border:none; background:#fff; color: var(--navy);
  font-size:1rem; font-weight:700; display:flex; align-items:center; justify-content:center;
}
.cart-item-stepper button:hover{ background: var(--sky); }
.cart-item-stepper .qty-val{ width:24px; text-align:center; font-weight:700; font-size:0.85rem; }
.remove-btn{
  background:none; border:none; color: var(--muted); font-size:0.78rem;
  text-decoration:underline; padding:0;
}
.remove-btn:hover{ color: var(--mango-dark); }

.cart-footer{ border-top:1px solid var(--line); padding: 16px 20px 20px; background:#fff; }
.cart-summary{ margin-bottom:16px; }
.summary-row{ display:flex; justify-content:space-between; font-size:0.9rem; color: var(--muted); padding: 4px 0; }
.summary-row.total{ color: var(--navy); font-weight:800; font-size:1.15rem; padding-top:8px; border-top:1px dashed var(--line); margin-top:6px; font-family:'Baloo 2',sans-serif; }

.field-label{ display:block; font-size:0.82rem; font-weight:700; color: var(--navy); margin-bottom:6px; }
.fulfillment{ margin-bottom:16px; }
.fulfillment-options{ display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.fulfillment-btn{
  border:2px solid var(--line); background:#fff; border-radius: var(--radius-sm);
  padding:10px 8px; text-align:left; display:flex; flex-direction:column; gap:2px;
}
.fulfillment-btn .fb-title{ font-weight:700; font-size:0.85rem; color: var(--ink); }
.fulfillment-btn .fb-sub{ font-size:0.75rem; color: var(--muted); }
.fulfillment-btn.active{ border-color: var(--cyan); background: var(--sky); }
.fulfillment-btn.active .fb-title{ color: var(--navy); }

.checkout-fields{ margin-bottom:16px; }
.checkout-fields input{
  width:100%; border:1.5px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 12px; font-size:0.9rem; margin-bottom:10px; outline:none;
}
.checkout-fields input:focus{ border-color: var(--cyan); }
.field-hint{ font-size:0.76rem; color: var(--muted); margin: -4px 0 10px; }

.checkout-btn{
  width:100%; background:#25D366; color:#fff; border:none;
  border-radius: 999px; padding: 14px; font-weight:800; font-size:0.98rem;
  display:flex; align-items:center; justify-content:center; gap:8px;
  transition: background .15s ease, transform .15s ease;
}
.checkout-btn:hover{ background:#1EB958; transform: translateY(-1px); }
.checkout-btn:disabled{ background:#B9C2D6; cursor:not-allowed; transform:none; }
.icon-wa{ width:20px; height:20px; fill:#fff; }

/* ===================== TOAST ===================== */
.toast{
  position:fixed; bottom:24px; left:50%; transform: translateX(-50%) translateY(20px);
  background: var(--navy); color:#fff; padding: 12px 22px; border-radius: 999px;
  font-size:0.88rem; font-weight:600; box-shadow: var(--shadow-lg);
  opacity:0; pointer-events:none; transition: all .25s ease; z-index:60;
}
.toast.show{ opacity:1; transform: translateX(-50%) translateY(0); }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 640px){
  .logo{ height:40px; }
  .topbar-inner{ flex-wrap:wrap; }
  .cart-btn span:not(.cart-count){ display:none; }
  .topbar-search{ order:3; max-width:none; flex-basis:100%; }
  .hero{ padding: 26px 16px 0; }
  .cat-showcase{ padding: 26px 16px 6px; }
  .cat-grid{ grid-template-columns: repeat(3, 1fr); gap:10px; }
  .cat-card{ padding:14px 6px 10px; border-radius:16px; }
  .cat-card-badge{ width:50px; height:50px; }
  .cat-card-name{ font-size:0.78rem; }
  .cat-card-count{ font-size:0.68rem; }
  .product-grid{ grid-template-columns: repeat(auto-fill, minmax(155px,1fr)); gap:12px; }
  .product-card{ padding:12px; }
  .product-media{ height:130px; }
  .cart-drawer{ width:100vw; }
}

@media (prefers-reduced-motion: reduce){
  *{ transition: none !important; scroll-behavior:auto !important; }
}
