/* ==========================================================================
   SWAGATH SWEETS — storefront styles
   Palette lifted from the logo: crimson red, marigold yellow, cream, ink.
   Mobile-first; tuned for the WhatsApp in-app browser.
   ========================================================================== */

:root{
  --red:#C8102E;
  --red-dk:#9E0C24;
  --red-lt:#E8354E;
  --gold:#FFC72C;
  --gold-dk:#E0A800;
  --cream:#FFF8EE;
  --card:#FFFFFF;
  --ink:#2B1A14;
  --ink-2:#6B5A52;
  --line:#EFE2D2;
  --ok:#12855B;
  --shadow:0 2px 10px rgba(43,26,20,.08);
  --shadow-lg:0 -8px 40px rgba(43,26,20,.22);
  --r:14px;
  --serif:Georgia,'Times New Roman',serif;
  --sans:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,'Helvetica Neue',Arial,sans-serif;
  --safe-b:env(safe-area-inset-bottom,0px);
}

*{box-sizing:border-box;margin:0;padding:0}
/* Several rules below set display on elements we also toggle with [hidden]
   (.fld, .sheet, .cartbar). Without this the attribute would be ignored. */
[hidden]{display:none!important}
html{-webkit-text-size-adjust:100%}
body{
  font-family:var(--sans);
  background:var(--cream);
  color:var(--ink);
  line-height:1.45;
  overflow-x:hidden;
  -webkit-font-smoothing:antialiased;
}
body.locked{overflow:hidden}
svg{width:1em;height:1em;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
button{font:inherit;color:inherit;background:none;border:0;cursor:pointer}
input,textarea{font:inherit;color:inherit}

/* ============================ HEADER ============================ */
/* The branding header scrolls away; only the filter bar pins. That keeps the
   most vertical space free on a phone, which matters in the WhatsApp browser.
   Cart access stays available via the sticky bottom bar. */
.hdr{
  position:relative;z-index:50;
  background:var(--red);
  box-shadow:0 2px 0 var(--gold);
}
.hdr__in{
  max-width:960px;margin:0 auto;
  padding:9px 14px;
  display:flex;align-items:center;justify-content:space-between;gap:12px;
}
.logo{text-decoration:none;display:block;line-height:1}
.logo__mark{display:block}
.logo__name{
  display:block;
  font-family:var(--serif);
  font-size:26px;letter-spacing:.055em;
  color:#fff;font-weight:400;
}
.logo__band{
  display:block;
  font-family:var(--serif);font-style:italic;
  font-size:10.5px;color:var(--ink);
  background:var(--gold);
  padding:1px 7px 2px;margin-top:2px;
  border-radius:2px;
}
.logo__sub{
  display:block;margin-top:3px;
  font-size:8.5px;letter-spacing:.22em;font-weight:700;
  color:var(--gold);
}
.cartbtn{
  position:relative;flex:none;
  width:42px;height:42px;border-radius:50%;
  display:grid;place-items:center;
  background:rgba(255,255,255,.14);
  color:#fff;font-size:21px;
}
.cartbtn:active{background:rgba(255,255,255,.26)}
.cartbtn__badge{
  position:absolute;top:-2px;right:-2px;
  min-width:19px;height:19px;padding:0 5px;
  border-radius:10px;
  background:var(--gold);color:var(--ink);
  font-size:11px;font-weight:800;
  display:grid;place-items:center;
  border:2px solid var(--red);
}

/* ============================ HERO ============================ */
.hero{
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(255,199,44,.30), transparent 60%),
    linear-gradient(180deg,#fffdf8,var(--cream));
  border-bottom:1px solid var(--line);
}
.hero__in{max-width:960px;margin:0 auto;padding:22px 16px 20px}
.hero__eyebrow{
  font-size:11px;font-weight:700;letter-spacing:.16em;
  text-transform:uppercase;color:var(--red);
}
.hero__title{
  font-family:var(--serif);font-weight:400;
  font-size:27px;line-height:1.22;margin-top:6px;
  letter-spacing:-.01em;
}
.hero__meta{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px}
.pill{
  display:inline-flex;align-items:center;gap:6px;
  font-size:12px;font-weight:600;
  background:#fff;border:1px solid var(--line);
  padding:5px 11px;border-radius:99px;color:var(--ink-2);
}
.pill--open{color:var(--ok)}
.pill--open i{width:7px;height:7px;border-radius:50%;background:var(--ok);flex:none}
.hero__acts{display:flex;gap:9px;margin-top:14px}
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:7px;
  border-radius:11px;font-weight:700;font-size:14px;
  padding:11px 16px;text-decoration:none;
  transition:transform .06s ease,filter .15s ease;
}
.btn:active{transform:scale(.98)}
.btn--ghost{background:#fff;border:1px solid var(--line);color:var(--ink);box-shadow:var(--shadow)}
.btn--ghost svg{font-size:15px;color:var(--red)}

/* ============================ FILTERS ============================ */
.filters{
  position:sticky;top:0;z-index:40;
  background:rgba(255,248,238,.96);
  backdrop-filter:saturate(1.6) blur(8px);
  -webkit-backdrop-filter:saturate(1.6) blur(8px);
  border-bottom:1px solid var(--line);
  padding:10px 0 9px;
}
.search{
  max-width:960px;margin:0 auto 9px;padding:0 16px;
  position:relative;display:flex;align-items:center;
}
.search svg{
  position:absolute;left:28px;font-size:16px;color:var(--ink-2);pointer-events:none;
}
.search input{
  width:100%;border:1px solid var(--line);background:#fff;
  border-radius:11px;padding:10px 12px 10px 36px;font-size:15px;
  outline:none;
}
.search input:focus{border-color:var(--red);box-shadow:0 0 0 3px rgba(200,16,46,.10)}
.tabs{
  display:flex;gap:8px;overflow-x:auto;
  padding:0 16px;scrollbar-width:none;-webkit-overflow-scrolling:touch;
}
.tabs::-webkit-scrollbar{display:none}
.tab{
  flex:none;white-space:nowrap;
  padding:7px 15px;border-radius:99px;
  font-size:13.5px;font-weight:700;
  background:#fff;border:1px solid var(--line);color:var(--ink-2);
}
.tab[aria-selected="true"]{background:var(--red);border-color:var(--red);color:#fff}

/* ============================ GRID ============================ */
.wrap{max-width:960px;margin:0 auto;padding:16px 16px 120px}
.grid{
  display:grid;gap:13px;
  grid-template-columns:repeat(2,1fr);
}
@media(min-width:620px){.grid{grid-template-columns:repeat(3,1fr);gap:16px}}
@media(min-width:860px){.grid{grid-template-columns:repeat(4,1fr)}}

.card{
  background:var(--card);border:1px solid var(--line);
  border-radius:var(--r);overflow:hidden;
  box-shadow:var(--shadow);
  display:flex;flex-direction:column;
}
.card__img{
  position:relative;display:block;width:100%;
  aspect-ratio:3/4;background:#F5EADC;
}
.card__img img{width:100%;height:100%;object-fit:cover;display:block}
/* Branded placeholder for items without a photo */
.card__ph{
  width:100%;height:100%;
  display:grid;place-items:center;text-align:center;padding:12px;
  background:
    radial-gradient(90% 70% at 50% 0%, rgba(255,199,44,.55), transparent 70%),
    linear-gradient(160deg,#FDEBD2,#F6DDBE);
}
.card__ph span{
  font-family:var(--serif);font-size:15px;line-height:1.25;
  color:var(--red-dk);
}
.card__ph small{
  display:block;margin-top:7px;
  font-family:var(--sans);font-size:9px;letter-spacing:.18em;
  font-weight:700;color:var(--gold-dk);
}
.card__bd{padding:10px 11px 12px;display:flex;flex-direction:column;flex:1}
.card__name{
  font-size:14px;font-weight:700;line-height:1.28;
  overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;
  min-height:2.56em;
}
.card__price{margin-top:5px;font-size:15px;font-weight:800;color:var(--red)}
.card__price span{font-size:11px;font-weight:600;color:var(--ink-2)}

/* weight chooser */
.wts{display:flex;gap:5px;margin-top:9px}
.wt{
  flex:1;padding:6px 0;border-radius:8px;
  font-size:11.5px;font-weight:700;
  background:var(--cream);border:1px solid var(--line);color:var(--ink-2);
}
.wt[aria-pressed="true"]{background:var(--gold);border-color:var(--gold-dk);color:var(--ink)}

.card__act{margin-top:10px}
.add{
  width:100%;padding:9px 0;border-radius:10px;
  background:var(--red);color:#fff;font-weight:800;font-size:13.5px;
  box-shadow:0 2px 8px rgba(200,16,46,.28);
}
.add:active{background:var(--red-dk)}
.step{
  display:flex;align-items:center;justify-content:space-between;
  background:var(--red);border-radius:10px;color:#fff;overflow:hidden;
}
.step button{
  width:38px;height:36px;font-size:20px;font-weight:700;color:#fff;
  display:grid;place-items:center;
}
.step button:active{background:var(--red-dk)}
.step b{font-size:14px;font-weight:800}

.empty{text-align:center;color:var(--ink-2);padding:40px 0;font-size:14px}

/* ============================ FOOTER ============================ */
.ftr{background:var(--red);color:#fff;padding:26px 16px calc(96px + var(--safe-b))}
.ftr__in{max-width:960px;margin:0 auto;text-align:center}
.ftr__brand{font-family:var(--serif);font-size:22px;letter-spacing:.05em}
.ftr__brand span{display:block;font-size:9px;letter-spacing:.2em;font-weight:700;color:var(--gold);font-family:var(--sans);margin-top:3px}
.ftr__addr{font-size:12.5px;opacity:.9;margin-top:12px;line-height:1.6}
.ftr__note{font-size:11px;opacity:.72;margin-top:12px;line-height:1.6}

/* ============================ STICKY CART BAR ============================ */
.cartbar{
  position:fixed;left:12px;right:12px;
  bottom:calc(12px + var(--safe-b));
  z-index:45;
  display:flex;align-items:center;justify-content:space-between;
  padding:14px 18px;border-radius:14px;
  background:var(--red);color:#fff;
  box-shadow:0 8px 26px rgba(200,16,46,.38);
  animation:rise .22s ease;
}
@media(min-width:620px){.cartbar{max-width:520px;margin:0 auto}}
.cartbar__l{font-size:13px;opacity:.9;font-weight:600}
.cartbar__r{font-size:15px;font-weight:700}
@keyframes rise{from{transform:translateY(120%)}to{transform:none}}

/* ============================ SHEETS ============================ */
.scrim{position:fixed;inset:0;background:rgba(43,26,20,.5);z-index:60;animation:fade .2s ease}
@keyframes fade{from{opacity:0}to{opacity:1}}

.sheet{
  position:fixed;left:0;right:0;bottom:0;z-index:70;
  background:var(--cream);
  border-radius:20px 20px 0 0;
  box-shadow:var(--shadow-lg);
  display:flex;flex-direction:column;
  max-height:92dvh;
  animation:up .26s cubic-bezier(.22,1,.36,1);
}
@media(min-width:620px){
  .sheet{max-width:520px;margin:0 auto;border-radius:20px;bottom:16px;left:16px;right:16px}
}
@keyframes up{from{transform:translateY(100%)}to{transform:none}}

.sheet__hd{
  display:flex;align-items:center;gap:10px;
  padding:16px 16px 12px;border-bottom:1px solid var(--line);
  flex:none;
}
.sheet__hd h2{font-family:var(--serif);font-size:19px;font-weight:400;flex:1}
.x,.back{
  width:34px;height:34px;border-radius:50%;flex:none;
  display:grid;place-items:center;font-size:22px;
  background:#fff;border:1px solid var(--line);color:var(--ink-2);
}
.back{font-size:17px}
.sheet__bd{overflow-y:auto;-webkit-overflow-scrolling:touch;padding:14px 16px;flex:1}
.sheet__ft{
  flex:none;padding:13px 16px calc(16px + var(--safe-b));
  border-top:1px solid var(--line);background:#fff;
}

/* cart rows */
.crow{display:flex;gap:11px;padding:11px 0;border-bottom:1px solid var(--line)}
.crow:last-child{border-bottom:0}
.crow__img{width:56px;height:70px;border-radius:9px;object-fit:cover;flex:none;background:#F5EADC}
.crow__ph{
  width:56px;height:70px;border-radius:9px;flex:none;
  display:grid;place-items:center;font-family:var(--serif);font-size:19px;color:var(--red-dk);
  background:linear-gradient(160deg,#FDEBD2,#F6DDBE);
}
.crow__bd{flex:1;min-width:0}
.crow__name{font-size:14px;font-weight:700;line-height:1.3}
.crow__var{font-size:11.5px;color:var(--ink-2);margin-top:2px}
.crow__foot{display:flex;align-items:center;justify-content:space-between;margin-top:8px;gap:10px}
.crow__price{font-size:14px;font-weight:800;color:var(--red)}
.mini{display:flex;align-items:center;gap:2px;background:#fff;border:1px solid var(--line);border-radius:9px}
.mini button{width:30px;height:29px;display:grid;place-items:center;font-size:17px;font-weight:700;color:var(--red)}
.mini b{min-width:20px;text-align:center;font-size:13px;font-weight:800}

.sum{margin-bottom:11px}
.sum__row{display:flex;justify-content:space-between;font-size:13.5px;padding:3px 0;color:var(--ink-2)}
.sum__row--tot{
  font-size:17px;font-weight:800;color:var(--ink);
  border-top:1px dashed var(--line);margin-top:7px;padding-top:9px;
}
.btn--pay{
  width:100%;background:var(--red);color:#fff;padding:14px;font-size:15.5px;
  box-shadow:0 3px 12px rgba(200,16,46,.3);
}
.btn--pay:active{background:var(--red-dk)}
.btn--pay[disabled]{opacity:.55;pointer-events:none}
.btn--wa{
  width:100%;margin-top:8px;padding:12px;font-size:14px;
  background:#fff;border:1.5px solid #25D366;color:#128C4A;
}
.btn--wa svg{font-size:16px}
.fine{font-size:10.5px;color:var(--ink-2);text-align:center;margin-top:9px;line-height:1.5}
.cart-empty{text-align:center;padding:36px 10px;color:var(--ink-2)}
.cart-empty p{font-size:14px;margin-top:8px}
.cart-empty svg{font-size:38px;color:var(--line);stroke-width:1.4}

/* checkout form */
.seg{display:flex;gap:8px;margin-bottom:15px}
.seg label{flex:1;position:relative}
.seg input{position:absolute;opacity:0;pointer-events:none}
.seg span{
  display:block;text-align:center;padding:10px 6px;border-radius:10px;
  font-size:13.5px;font-weight:700;
  background:#fff;border:1px solid var(--line);color:var(--ink-2);
}
.seg input:checked+span{background:var(--red);border-color:var(--red);color:#fff}
.fld{display:block;margin-bottom:13px}
.fld>span{display:block;font-size:12.5px;font-weight:700;margin-bottom:5px}
.fld>span em{font-style:normal;font-weight:500;color:var(--ink-2)}
.fld input,.fld textarea{
  width:100%;border:1px solid var(--line);border-radius:10px;
  padding:11px 12px;font-size:15px;background:#fff;outline:none;resize:vertical;
}
.fld input:focus,.fld textarea:focus{border-color:var(--red);box-shadow:0 0 0 3px rgba(200,16,46,.10)}
.fld.bad input,.fld.bad textarea{border-color:var(--red);background:#FFF5F6}
.err{
  background:#FFF0F2;border:1px solid #F6C9D0;color:var(--red-dk);
  padding:9px 11px;border-radius:9px;font-size:12.5px;
}

/* success */
.sheet--ok{padding:34px 22px calc(30px + var(--safe-b));text-align:center}
.ok__tick{
  width:62px;height:62px;border-radius:50%;margin:0 auto 15px;
  display:grid;place-items:center;background:#E6F6EF;color:var(--ok);font-size:29px;
}
.ok__tick svg{stroke-width:2.6}
.ok h2{font-family:var(--serif);font-size:23px;font-weight:400}
.ok p{font-size:13.5px;color:var(--ink-2);margin:9px 0 20px;line-height:1.6}

/* toast */
.toast{
  position:fixed;left:50%;bottom:calc(86px + var(--safe-b));
  transform:translateX(-50%);z-index:90;
  background:var(--ink);color:#fff;
  padding:10px 17px;border-radius:99px;
  font-size:13px;font-weight:600;white-space:nowrap;
  box-shadow:0 6px 20px rgba(0,0,0,.25);
  animation:fade .18s ease;
}

@media(prefers-reduced-motion:reduce){
  *{animation-duration:.001ms!important;transition-duration:.001ms!important}
}

/* --- share-location control on the checkout form ------------------------- */
.pinbtn{display:inline-flex;align-items:center;gap:7px;margin-top:8px;padding:9px 14px;
  border:1px solid var(--line);border-radius:10px;background:#fff;color:var(--red);
  font-weight:600;font-size:.85rem;cursor:pointer;-webkit-tap-highlight-color:transparent}
.pinbtn:disabled{opacity:.6;cursor:default}
.pinbtn svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;
  stroke-linecap:round;stroke-linejoin:round}
.pinbtn[data-state="done"]{border-color:var(--ok);color:var(--ok)}
.pinhint{display:block;margin-top:6px;font-size:.75rem;color:#9A867B}
