/* ==========================================================================
   BESTEA — shop chrome: cart bar, cart sheet, form fields

   Loaded by index.html (for the cart) and by checkout.html (for everything).

   It deliberately repeats the brand tokens, the font faces and the .btn/.toast
   base that index.html already carries inline. index.html links this file
   BEFORE its own <style>, so its inline copy still wins every conflict and the
   shop page looks exactly as it did — but the shop page also never depends on
   this file for its colours. If this stylesheet ever fails to fetch, the shop
   loses a cart bar; it does not lose its brand.
   ========================================================================== */

@font-face{font-family:"Fredoka";src:url("/fonts/fredoka-500.woff2") format("woff2");font-weight:500;font-display:swap}
@font-face{font-family:"Fredoka";src:url("/fonts/fredoka-600.woff2") format("woff2");font-weight:600;font-display:swap}
@font-face{font-family:"Fredoka";src:url("/fonts/fredoka-700.woff2") format("woff2");font-weight:700;font-display:swap}

:root{
  --forest:#0B4B3B;
  --forest-900:#052a20;
  --forest-800:#083a2d;
  --forest-700:#0d5540;
  --matcha:#8AB43C;
  --matcha-bright:#A6CE4E;
  --matcha-soft:#CFE6A0;
  --ube:#C6A8FF;
  --hojicha:#D9A164;
  --cream:#FFF3C1;
  --cream-2:#F6ECC4;
  --milk:#F5F0E4;
  --ink:#0B4B3B;
  --danger:#FF9B87;

  --font-display:"Fredoka","Segoe UI",system-ui,-apple-system,sans-serif;
  --font-body:"Segoe UI Variable Text","Segoe UI",system-ui,-apple-system,Roboto,sans-serif;

  --r-card:24px;
  --r-lg:32px;
  --r-pill:999px;

  --col:440px;
  --pad:22px;
  color-scheme:dark;
}

/* ---------------------------------------------------------------- base --- */
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}

.btn{
  font-family:var(--font-display);font-weight:600;font-size:1rem;
  border-radius:var(--r-pill);padding:15px 26px;display:inline-flex;align-items:center;gap:9px;
  transition:transform .12s ease, box-shadow .2s ease, background .2s ease;white-space:nowrap;
  cursor:pointer;border:0;
}
.btn:active{transform:translateY(1px) scale(.985)}
.btn:disabled{opacity:.55;cursor:default;transform:none}
.btn-primary{background:var(--cream);color:var(--forest);box-shadow:0 12px 30px rgba(3,26,19,.35)}
.btn-primary:hover:not(:disabled){background:#fff}
.btn .ig,.btn .ic{width:20px;height:20px;fill:none;stroke:currentColor;flex:0 0 auto}

/* the copy/confirm pill — shared with the shop's Instagram buttons */
.toast{
  position:fixed;left:50%;bottom:22px;z-index:90;
  transform:translate(-50%,14px);
  width:max-content;max-width:min(calc(100% - 32px), 360px);
  padding:12px 18px;border-radius:var(--r-pill);
  font-family:var(--font-display);font-weight:600;font-size:.86rem;line-height:1.3;text-align:center;
  color:var(--forest);background:var(--cream);
  box-shadow:0 18px 44px -18px rgba(0,0,0,.85);
  opacity:0;pointer-events:none;
  transition:opacity .25s ease, transform .25s cubic-bezier(.2,.7,.2,1);
}
.toast.on{opacity:1;transform:translate(-50%,0)}
/* the cart bar owns the bottom of the screen once it is up */
body.has-cart .toast{bottom:96px}

/* ===================== Secondary Instagram link on a card =================
   The cards now lead with Add to cart, so the old route keeps its place but
   gives up its weight: a quiet text row rather than a second filled button. */
.btn-ig{
  display:flex;align-items:center;justify-content:center;gap:8px;
  width:100%;margin-top:11px;padding:9px 12px;border-radius:var(--r-pill);
  font-family:var(--font-display);font-weight:600;font-size:.86rem;
  color:rgba(246,236,196,.62);
  transition:color .2s ease, background .2s ease, transform .12s ease;
}
.btn-ig .ig{width:17px;height:17px;fill:none;stroke:currentColor;flex:0 0 auto}
.btn-ig:hover{color:var(--cream);background:rgba(255,255,255,.06)}
.btn-ig:active{transform:scale(.985)}

/* the price riding on the Add button, at its right edge */
.btn-order .addp{
  font-family:var(--font-display);font-weight:700;font-size:1rem;
  font-variant-numeric:tabular-nums;letter-spacing:-.01em;
}
.btn-order .addp i{font-style:normal;font-weight:600;font-size:.72rem;margin-left:2px;opacity:.72}
.btn-order .adddot{opacity:.42;font-weight:600}
/* a card whose button was just pressed says so for a beat */
.btn-order.done .addp,.btn-order.done .adddot{display:none}

/* ============================== Cart bar ==================================
   Fixed to the foot of the phone column, and only there once something is in
   the cart. Left half opens the sheet, right half goes to checkout. */
.cartbar{
  position:fixed;left:50%;bottom:0;z-index:65;
  width:min(100%,var(--col));
  display:flex;align-items:center;gap:10px;
  padding:11px clamp(13px,4vw,22px);
  padding-bottom:calc(11px + env(safe-area-inset-bottom,0px));
  background:rgba(5,36,27,.82);
  backdrop-filter:blur(14px) saturate(150%);-webkit-backdrop-filter:blur(14px) saturate(150%);
  border-top:1px solid rgba(255,243,193,.12);
  box-shadow:0 -18px 40px -24px rgba(0,0,0,.9);
  transform:translate(-50%,130%);
  transition:transform .42s cubic-bezier(.16,1,.3,1);
}
.cartbar.on{transform:translate(-50%,0)}
@media (prefers-reduced-motion:reduce){.cartbar{transition:none}}

.cartbar-open{
  flex:1 1 auto;min-width:0;display:flex;align-items:center;gap:11px;
  padding:6px 4px;border-radius:14px;text-align:left;
  transition:background .2s ease;
}
.cartbar-open:hover{background:rgba(255,255,255,.06)}
.cartbar-open:focus-visible{outline:2px solid var(--matcha-bright);outline-offset:2px}
.cartbar-bag{position:relative;flex:0 0 auto;width:26px;height:26px;color:var(--cream)}
.cartbar-bag svg{width:26px;height:26px;fill:none;stroke:currentColor;stroke-width:2}
.cartbar-count{
  position:absolute;top:-6px;right:-8px;min-width:18px;height:18px;padding:0 5px;
  display:grid;place-items:center;border-radius:var(--r-pill);
  font-family:var(--font-display);font-weight:700;font-size:.68rem;line-height:1;
  color:var(--forest-900);background:var(--matcha-bright);
  box-shadow:0 0 0 2px rgba(5,36,27,.92);
}
.cartbar-txt{min-width:0;display:flex;flex-direction:column;gap:3px}
.cartbar-txt b{
  font-family:var(--font-display);font-weight:700;font-size:1.06rem;line-height:1;color:#fff;
  font-variant-numeric:tabular-nums;
}
.cartbar-txt b i{font-style:normal;font-weight:600;font-size:.7rem;color:var(--matcha-bright);margin-left:2px}
.cartbar-txt span{
  font-size:.72rem;line-height:1;color:rgba(246,236,196,.55);
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.cartbar-go{
  flex:0 0 auto;font-family:var(--font-display);font-weight:600;
  font-size:clamp(.84rem,3.2vw,.95rem);
  display:inline-flex;align-items:center;gap:7px;
  background:var(--matcha-bright);color:#08251b;
  padding:12px clamp(15px,4.4vw,22px);border-radius:var(--r-pill);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.45), 0 14px 30px -16px rgba(166,206,78,.95);
  transition:transform .12s ease, filter .2s ease;
}
.cartbar-go:hover{filter:brightness(1.06)}
.cartbar-go:active{transform:scale(.97)}
.cartbar-go svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2.4;flex:0 0 auto}

/* ============================== Cart sheet ================================ */
.sheet-scrim{
  position:fixed;inset:0;z-index:80;background:rgba(3,20,15,.62);
  backdrop-filter:blur(3px);-webkit-backdrop-filter:blur(3px);
  opacity:0;pointer-events:none;transition:opacity .3s ease;
}
.sheet-scrim.on{opacity:1;pointer-events:auto}
.sheet{
  position:fixed;left:50%;bottom:0;z-index:81;
  width:min(100%,var(--col));
  display:flex;flex-direction:column;
  max-height:min(86vh,760px);max-height:min(86lvh,760px);
  border-radius:26px 26px 0 0;overflow:hidden;
  background:linear-gradient(180deg, rgba(19,86,66,.99) 0, rgba(7,46,35,1) 100%);
  box-shadow:0 -34px 80px -30px rgba(0,0,0,.95), inset 0 1px 0 rgba(255,255,255,.16);
  transform:translate(-50%,100%);
  transition:transform .44s cubic-bezier(.16,1,.3,1);
}
.sheet.on{transform:translate(-50%,0)}
@media (prefers-reduced-motion:reduce){.sheet,.sheet-scrim{transition:none}}
.sheet-grab{width:42px;height:4px;border-radius:var(--r-pill);background:rgba(255,243,193,.28);margin:10px auto 0;flex:0 0 auto}
.sheet-head{
  flex:0 0 auto;display:flex;align-items:center;gap:12px;
  padding:14px clamp(15px,4.6vw,20px) 10px;
}
.sheet-head h2{
  margin:0;font-family:var(--font-display);font-weight:700;font-size:1.28rem;line-height:1;
  letter-spacing:-.02em;color:#fff;
}
.sheet-head .sp{flex:1 1 auto}
.sheet-x{
  flex:0 0 auto;width:34px;height:34px;border-radius:50%;display:grid;place-items:center;
  background:rgba(255,255,255,.08);color:var(--cream-2);transition:background .2s ease,color .2s ease;
}
.sheet-x:hover{background:rgba(255,255,255,.16);color:#fff}
.sheet-x svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:2.6;stroke-linecap:round}
.sheet-body{
  flex:1 1 auto;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch;
  padding:0 clamp(15px,4.6vw,20px) 4px;
}
.sheet-foot{
  flex:0 0 auto;padding:14px clamp(15px,4.6vw,20px);
  padding-bottom:calc(14px + env(safe-area-inset-bottom,0px));
  border-top:1px solid rgba(255,243,193,.1);
  background:rgba(4,28,21,.35);
}

/* -------- one line in the cart -------- */
.cline{
  display:grid;grid-template-columns:54px 1fr auto;column-gap:12px;row-gap:9px;
  align-items:start;padding:15px 0;
}
.cline + .cline{border-top:1px solid rgba(255,243,193,.09)}
.cline-img{
  grid-column:1;grid-row:1 / span 2;
  width:54px;height:54px;border-radius:14px;object-fit:cover;
  box-shadow:0 0 0 1px rgba(255,255,255,.14), 0 10px 22px -14px rgba(0,0,0,.9);
  background:rgba(255,255,255,.06);
}
.cline-t{grid-column:2;grid-row:1;min-width:0}
.cline-t b{
  display:block;font-family:var(--font-display);font-weight:600;font-size:.98rem;line-height:1.15;
  color:#fff;overflow-wrap:break-word;
}
.cline-t span{display:block;margin-top:4px;font-size:.76rem;color:rgba(246,236,196,.52);font-variant-numeric:tabular-nums}
.cline-p{
  grid-column:3;grid-row:1;justify-self:end;text-align:right;white-space:nowrap;
  font-family:var(--font-display);font-weight:700;font-size:1.1rem;line-height:1.2;color:#fff;
  font-variant-numeric:tabular-nums;
}
.cline-p i{font-style:normal;font-weight:600;font-size:.68rem;color:var(--matcha-bright);margin-left:2px}
.cline-q{
  grid-column:2;grid-row:2;justify-self:start;
  display:inline-flex;align-items:center;gap:2px;padding:3px;border-radius:var(--r-pill);
  background:rgba(255,255,255,.07);box-shadow:inset 0 0 0 1px rgba(255,255,255,.12);
}
.cline-q button{
  width:28px;height:28px;border-radius:50%;display:grid;place-items:center;
  color:var(--cream-2);transition:background .18s ease,color .18s ease;
}
.cline-q button:hover:not(:disabled){background:rgba(255,255,255,.14);color:#fff}
.cline-q button:disabled{opacity:.3;cursor:default}
.cline-q button svg{width:13px;height:13px;fill:none;stroke:currentColor;stroke-width:2.8;stroke-linecap:round}
.cline-q b{
  min-width:26px;text-align:center;font-family:var(--font-display);font-weight:700;font-size:.92rem;
  color:#fff;font-variant-numeric:tabular-nums;
}
.cline-x{
  grid-column:3;grid-row:2;justify-self:end;align-self:center;
  font-family:var(--font-display);font-weight:600;font-size:.76rem;
  color:rgba(246,236,196,.42);padding:4px 2px;transition:color .2s ease;
}
.cline-x:hover{color:var(--danger)}

/* -------- the running sum -------- */
.sum{margin:2px 0 0;padding:14px 0 2px;border-top:1px solid rgba(255,243,193,.12)}
.sum-row{display:flex;align-items:baseline;justify-content:space-between;gap:14px;padding:5px 0;
  font-size:.92rem;color:rgba(246,236,196,.68)}
.sum-row b{font-family:var(--font-display);font-weight:600;color:var(--cream);font-variant-numeric:tabular-nums;white-space:nowrap}
.sum-row b i,.sum-row.tot b i{font-style:normal;font-weight:600;font-size:.68rem;color:var(--matcha-bright);margin-left:2px}
.sum-row.tot{margin-top:6px;padding-top:12px;border-top:1px solid rgba(255,243,193,.12)}
.sum-row.tot span{font-family:var(--font-display);font-weight:600;font-size:1.02rem;color:var(--cream)}
.sum-row.tot b{font-size:1.5rem;line-height:1;color:#fff}
.sum-note{margin:10px 0 0;font-size:.78rem;line-height:1.45;color:rgba(246,236,196,.45)}

.sheet-empty{padding:34px 4px 30px;text-align:center}
.sheet-empty p{margin:0 0 18px;color:rgba(246,236,196,.6);font-size:.95rem}

.btn-go{
  width:100%;justify-content:center;
  background:linear-gradient(180deg, var(--matcha-bright), rgba(166,206,78,.85));
  color:#08251b;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.5), 0 16px 34px -16px rgba(166,206,78,.8);
}
.btn-go:hover:not(:disabled){filter:brightness(1.06)}
.btn-ghost{
  width:100%;justify-content:center;background:rgba(255,255,255,.07);color:var(--cream-2);
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.14);
}
.btn-ghost:hover:not(:disabled){background:rgba(255,255,255,.13);color:#fff}

/* ============================== Form fields ===============================
   Used by the checkout page, kept here so the sheet and the checkout share
   one set of controls. */
.field{margin-top:15px}
.field > label,.legend{
  display:block;margin:0 0 8px;
  font-family:var(--font-display);font-weight:600;font-size:.72rem;letter-spacing:.07em;
  text-transform:uppercase;color:rgba(246,236,196,.55);
}
.field input,.field textarea{
  width:100%;font-family:var(--font-body);font-size:1rem;line-height:1.4;color:#fff;
  background:rgba(255,255,255,.06);
  border:0;border-radius:15px;padding:14px 15px;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.14);
  transition:box-shadow .2s ease, background .2s ease;
  -webkit-appearance:none;appearance:none;
}
.field textarea{min-height:82px;resize:vertical}
.field input::placeholder,.field textarea::placeholder{color:rgba(246,236,196,.3)}
.field input:focus,.field textarea:focus{
  outline:none;background:rgba(255,255,255,.1);
  box-shadow:inset 0 0 0 1.5px var(--matcha-bright), 0 0 0 4px rgba(166,206,78,.16);
}
.field.bad input,.field.bad textarea{box-shadow:inset 0 0 0 1.5px var(--danger)}
.field-err{display:none;margin:7px 0 0;font-size:.8rem;line-height:1.35;color:var(--danger)}
.field.bad .field-err{display:block}
.field-hint{margin:7px 0 0;font-size:.78rem;line-height:1.4;color:rgba(246,236,196,.42)}
