/* ===== Theme ===== */
:root{
  --bg:#fffaf5; --ink:#17181b; --muted:#6a6f76; --card:#ffffff; --line:#ece8e2;
  --accent:#7c5cff; --accent-2:#ff8aa0; --good:#27ae60;
  --shadow:0 10px 30px rgba(18,23,35,.08); --radius:18px;
}
*{box-sizing:border-box} html,body{margin:0;padding:0}
body{font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;background:var(--bg);color:var(--ink);line-height:1.6;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}

/* ===== Layout ===== */
.container{max-width:1080px;margin:0 auto;padding:0 20px}
.section{padding:64px 0}
.section-title{font-size:clamp(22px,6vw,32px);margin:0 0 18px}
.bullets{margin:12px 0 0 20px;padding:0}.bullets li{margin:6px 0}

/* ===== Background helpers ===== */
.has-bg{position:relative;background:center/cover no-repeat}
.has-bg::after{content:"";position:absolute;inset:0;z-index:0;background:linear-gradient(180deg,rgba(255,255,255,.55),rgba(255,255,255,.18))}
.has-bg > *{position:relative;z-index:1}
.site-footer.has-bg-optional{position:relative;background:center/cover no-repeat}
.site-footer.has-bg-optional::before{content:"";position:absolute;inset:0;z-index:0;opacity:.25;background:inherit}
.site-footer.has-bg-optional > *{position:relative;z-index:1}

/* ===== Header / Nav ===== */
.site-header{position:sticky;top:0;z-index:50;background:rgba(255,250,245,.75);backdrop-filter:blur(8px);border-bottom:1px solid var(--line)}
.header-inner{display:flex;align-items:center;justify-content:space-between;height:64px}
.brand{display:flex;align-items:center;gap:10px;text-decoration:none;color:var(--ink)}
.brand-logo{width:34px;height:34px;object-fit:contain;border-radius:8px;border:1px solid var(--line);background:#0b0f1a}
.nav{display:flex;gap:18px}
.nav a{color:var(--ink);text-decoration:none;font-weight:600;opacity:.9}
.nav a:hover{opacity:1}

/* Mobile nav toggle */
.nav-toggle{display:none;appearance:none;background:transparent;border:0;padding:8px;margin:-8px;border-radius:8px}
.nav-toggle:focus-visible{outline:2px solid var(--accent)}
.nav-toggle .bar{display:block;width:24px;height:2px;background:#111;margin:5px 0;border-radius:2px;transition:.2s}

/* ===== Buttons ===== */
.btn{display:inline-block;font-weight:700;border-radius:999px;padding:14px 18px;text-decoration:none;transition:.2s}
.btn-primary{background:var(--accent);color:#fff;box-shadow:var(--shadow)}
.btn-primary:hover{transform:translateY(-1px)}
.btn-ghost{background:transparent;color:var(--ink);border:1px solid var(--line)}
.btn-ghost:hover{background:#fff}

/* ===== Hero (parallax) ===== */
.hero{overflow:hidden;padding:42px 0 32px;border-bottom:1px solid var(--line);position:relative}
.hero .parallax-bg{
  position:absolute;inset:-20% -10% 0 -10%;background:center/cover no-repeat;z-index:0;will-change:transform;transform:translate3d(0,0,0);
  background-attachment:fixed;
}
.hero::after{content:"";position:absolute;inset:0;z-index:1;background:linear-gradient(180deg,rgba(255,255,255,.55),rgba(255,255,255,.15))}
.hero-inner,.hero-copy,.hero-card{position:relative;z-index:2}
.hero-inner{display:grid;grid-template-columns:1.2fr .8fr;gap:32px;align-items:center}
.hero-copy h1{font-size:clamp(28px,8vw,46px);line-height:1.1;margin:0 0 10px;background:rgba(255,255,255,.75);display:inline-block;padding:8px 12px;border-radius:10px}
.hero-copy p{margin:0 0 18px;color:var(--muted)}
.hero-cta{display:flex;gap:12px;margin:12px 0 8px;flex-wrap:wrap}
.hero-meta{display:flex;gap:12px;flex-wrap:wrap;color:var(--muted);font-size:14px}
.hero-card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:22px;box-shadow:var(--shadow)}
.muffin-stack{display:grid;gap:12px}
.muffin-stack .m1,.m2,.m3{height:70px;border-radius:14px;border:1px solid var(--line);background:linear-gradient(180deg,rgba(255,255,255,.6),rgba(255,255,255,0)),repeating-linear-gradient(45deg,#f5d9aa 0 10px,#f7e6be 10px 20px);box-shadow:0 6px 18px rgba(0,0,0,.05)}
.muffin-stack .m2{background:linear-gradient(180deg,rgba(255,255,255,.6),rgba(255,255,255,0)),repeating-linear-gradient(45deg,#d7d0ff 0 10px,#e6e1ff 10px 20px)}
.muffin-stack .m3{background:linear-gradient(180deg,rgba(255,255,255,.6),rgba(255,255,255,0)),repeating-linear-gradient(45deg,#ffd4dd 0 10px,#ffe2e8 10px 20px)}

/* ===== Steps ===== */
.steps{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin-top:12px}
.step{background:var(--card);border:1px solid var(--line);border-radius:16px;padding:18px;box-shadow:var(--shadow)}
.step-icon{font-size:22px;width:36px;height:36px;display:grid;place-items:center;border-radius:10px;background:#fff3;border:1px solid var(--line);margin-bottom:8px}
.step h3{margin:4px 0 6px}

/* ===== Shop (used on Muffins page) ===== */
.shop .grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:18px}
.product{background:var(--card);border:1px solid var(--line);border-radius:18px;box-shadow:var(--shadow)}
.product.card{display:grid;grid-template-columns:1fr;gap:12px;padding:12px}
.product .product-info h3{margin:0 0 6px}
.product-desc{color:var(--muted);margin:4px 0 12px}
.badge{display:inline-block;background:#efe9ff;color:#3a2d80;border:1px solid #ddd0ff;padding:4px 10px;border-radius:999px;font-size:12px;font-weight:700}
.highlight{display:grid;grid-template-columns:1.2fr .8fr;gap:18px;padding:20px;margin-bottom:22px}
.highlight .product-info{padding:6px 4px 6px 8px}
.product .hint{color:var(--muted);font-size:13px;margin-top:10px}
.product-art{position:relative;min-height:180px;border-left:1px dashed var(--line);display:grid;place-items:center}
.box{width:140px;height:100px;border-radius:14px;border:1px solid var(--line);box-shadow:var(--shadow)}
.box-a{background:linear-gradient(145deg,#ffe9f1,#fff)}
.box-b{background:linear-gradient(145deg,#eceaff,#fff);position:absolute;transform:rotate(-8deg) translate(30px, 20px)}

/* Product images — fill without warping */
.thumb-wrap{width:100%;height:180px;border-radius:14px;border:1px solid var(--line);overflow:hidden;background:#fff}
.thumb-img{width:100%;height:100%;object-fit:cover;object-position:center;display:block;transition:transform .25s ease}
.product.card:hover .thumb-img{transform:scale(1.02)}
.buy stripe-buy-button{display:block;margin-top:6px}

/* ===== FAQ / Contact / About ===== */
.faq.has-bg{background:center/cover no-repeat}
.faq.has-bg::after{background:linear-gradient(180deg,rgba(255,255,255,.72),rgba(255,255,255,.82))}
.faq-list{display:grid;gap:20px;margin-top:20px}
.faq-item{background:#fff;border:1px solid var(--line);border-radius:18px;padding:16px;box-shadow:var(--shadow)}
.faq-item h3{margin:0 0 8px;font-size:18px}

.contact.has-bg{background:center/cover no-repeat}
.contact.has-bg::after{background:linear-gradient(180deg,rgba(255,255,255,.78),rgba(255,255,255,.9))}
.contact-intro{margin-top:6px;color:var(--muted)}
.contact-grid{display:grid;gap:20px;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));margin-top:20px}
.contact-card{background:#fff;border:1px solid var(--line);border-radius:18px;padding:16px;box-shadow:var(--shadow)}
.contact-card h3{margin:0 0 6px;font-size:18px}
.contact-card a{color:var(--accent);font-weight:600;text-decoration:none}
.contact-card a:hover{text-decoration:underline}

.about-hero{padding:56px 0 24px;border-bottom:1px solid var(--line)}
.about-title{font-size:clamp(28px,8vw,44px);margin:0 0 6px}
.about-sub{color:var(--muted);margin:0}
.about-prose{max-width:820px}
.about-prose h2{margin:18px 0 8px}
.about-prose p{margin:10px 0}
.about-quote{margin:14px 0;padding:14px 16px;border-left:4px solid var(--accent);background:#fff;border:1px solid var(--line);border-left-color:var(--accent);border-radius:12px}
.about-quote .sig{color:var(--muted);font-style:italic}
.about-cta{display:flex;gap:12px;flex-wrap:wrap;margin-top:16px}

/* ===== Footer ===== */
.site-footer{border-top:1px solid var(--line);padding:24px 0;background:#fff}
.footer-inner{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.foot-brand{display:flex;align-items:center;gap:10px;font-weight:800}
.foot-meta{color:var(--muted);font-size:14px}

/* ===== Cart UI ===== */
.cart-button{
  margin-left:12px; display:flex; align-items:center; gap:8px;
  background:#111827; color:#fff; border:1px solid #2a2f39;
  padding:8px 12px; border-radius:999px; box-shadow:var(--shadow); cursor:pointer;
}
.cart-count{
  min-width:20px; height:20px; line-height:20px; text-align:center;
  background:#ff5a7a; color:#fff; border-radius:999px; font-size:12px; font-weight:800; padding:0 6px;
}

.cart-backdrop{
  position:fixed; inset:0; background:rgba(17,24,39,.45);
  opacity:0; pointer-events:none; transition:opacity .2s; z-index:80;
}
.cart-backdrop.open{opacity:1; pointer-events:auto}
/* NEW: match JS which toggles .show */
.cart-backdrop.show{opacity:1; pointer-events:auto}

.cart-drawer{
  position:fixed; top:0; right:0; width:min(92vw, 380px); height:100vh; background:#fff;
  border-left:1px solid var(--line); box-shadow:-10px 0 30px rgba(0,0,0,.08);
  transform:translateX(100%); transition:transform .25s; z-index:81; display:flex; flex-direction:column;
}
.cart-drawer.open{transform:translateX(0)}
.cart-header{display:flex; align-items:center; justify-content:space-between; padding:16px; border-bottom:1px solid var(--line)}
.cart-header h2{margin:0; font-size:20px}
.cart-close{background:transparent; border:0; font-size:20px; cursor:pointer}
.cart-items{flex:1; overflow:auto; padding:12px 12px 0}
.cart-item{
  display:grid; grid-template-columns:1fr auto; gap:8px; align-items:center;
  border:1px solid var(--line); border-radius:12px; padding:10px; margin-bottom:10px;
}
/* NEW: base styles for new cart item structure */
.cart-item .ci-info{display:flex; align-items:flex-start; justify-content:space-between; gap:8px;}
.cart-item .ci-name{font-weight:700; word-break:break-word;}
.cart-item .ci-qty{display:flex; align-items:center; gap:8px;}
.cart-item .ci-qty .qty{width:32px; height:32px; border-radius:8px; border:1px solid var(--line); background:#fff; cursor:pointer;}
.cart-item .ci-qty .qty-input{width:54px; height:32px; text-align:center; border:1px solid var(--line); border-radius:8px;}
.cart-item .ci-qty .remove{margin-left:auto; width:32px; height:32px; border-radius:8px; border:1px solid var(--line); background:#fff; cursor:pointer;}

.cart-item-name{font-weight:700}
.cart-qty{display:flex; align-items:center; gap:8px}
.cart-qty button{
  width:28px; height:28px; border-radius:8px; border:1px solid var(--line); background:#fff; cursor:pointer
}
.cart-footer{border-top:1px solid var(--line); padding:12px}
.cart-total-row{display:flex; align-items:center; justify-content:space-between; margin:8px 0 12px}
.cart-actions{display:flex; gap:10px}
.cart-note{color:var(--muted); font-size:12px; margin-top:8px}

/* NEW: small cutoff note under checkout */
.cart-cutoff{
  color:var(--muted);
  font-size:12px;
  margin-top:8px;
}

/* ===== Service bar + cutoff warning ===== */
.service-bar{
  display:flex; align-items:center; justify-content:center; flex-wrap:wrap;
  gap:10px; height:34px; font-size:13px; color:#3a2f1f;
  background:#fff; border-top:1px solid var(--line); border-bottom:1px solid var(--line);
}
.cutoff-msg{
  font-weight:800; color:#8a1f1f; background:#ffe9e9;
  border:1px solid #ffd5d5; padding:4px 8px; border-radius:999px;
}

/* ===== A11y + Toasts ===== */
.visually-hidden{
  position:absolute !important; height:1px; width:1px; overflow:hidden;
  clip:rect(1px,1px,1px,1px); white-space:nowrap; border:0; padding:0; margin:-1px;
}
.toast-container{position:fixed;bottom:16px;left:50%;transform:translateX(-50%);z-index:120;display:grid;gap:8px;pointer-events:none}
.toast{
  pointer-events:auto; background:#111827; color:#fff; border:1px solid #2a2f39;
  padding:10px 14px; border-radius:12px; box-shadow:var(--shadow);
  animation:toastIn .18s ease-out;
}
/* NEW: fade-out support for JS-dismissed toasts */
.toast.out{opacity:0; transition: opacity .15s ease-out;}
@keyframes toastIn{from{opacity:0;transform:translate(-50%,8px)}to{opacity:1;transform:translate(-50%,0)}}

/* ===== Generic product grid ===== */
.grid-products{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(220px, 1fr));
  gap:18px;
}
.subs-grid .product.card { padding:16px; }
.subs-grid .product-top { display:flex; align-items:center; gap:10px; }

/* ===== Responsive ===== */
@media (max-width:980px){
  .hero-inner{grid-template-columns:1fr;gap:22px}
  .hero .parallax-bg{background-attachment:scroll}
  .highlight{grid-template-columns:1fr;gap:14px}
  .shop .grid{grid-template-columns:repeat(2,1fr)}
  .thumb-wrap{height:160px}
}
@media (max-width:720px){
  .nav-toggle{display:inline-block}
  .nav{
    position:absolute; top:64px; left:0; right:0;
    background:#fff; border-bottom:1px solid var(--line);
    display:grid; gap:0; transform-origin:top;
    max-height:0; overflow:hidden; transition:max-height .25s ease;
  }
  .nav a{padding:14px 20px; border-top:1px solid var(--line)}
  .nav.open{max-height:280px}

  .section{padding:48px 0}
  .steps{grid-template-columns:1fr}
  .shop .grid{grid-template-columns:1fr}
  .thumb-wrap{height:180px}
  #muffin-tapper{right:12px;bottom:12px}
}
@media (max-width:400px){
  .container{padding:0 14px}
  .thumb-wrap{height:160px}
  .hero-copy h1{padding:6px 10px}
}

/* Active link helper */
.nav a.active { color: var(--accent); }


/* Cart: small note under checkout */
.cart-cutoff{ color:var(--muted); font-size:12px; margin-top:8px; }

/* Cart: delivery form */
.cart-delivery{
  border-top:1px solid var(--line);
  padding-top:12px;
  margin-top:8px;
}
.cart-delivery h3{
  margin:0 0 8px;
  font-size:16px;
}
.cart-delivery .row{
  display:grid; gap:10px; grid-template-columns:1fr 1fr;
}
.cart-delivery label{ font-weight:700; display:block; margin:6px 0 4px; }
.cart-delivery input[type="date"],
.cart-delivery select{
  width:100%; padding:10px 12px; border:1px solid var(--line); border-radius:10px; background:#fff;
  font:inherit;
}

/* Service bar cutoff pill (already present) */
.cutoff-msg{
  font-weight:800; color:#8a1f1f; background:#ffe9e9;
  border:1px solid #ffd5d5; padding:4px 8px; border-radius:999px;
}

/* ===== Floating Muffin Tapper (bottom-right) ===== */
#muffin-tapper{
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 56px;
  height: 56px;
  border-radius: 9999px;
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  gap: 0;
  cursor: pointer;
  z-index: 79; /* under cart backdrop (80) & drawer (81); raise to 82 if you want it above */
  padding: 0;
  line-height: 1;
  transition: transform .15s ease, box-shadow .15s ease;
}
#muffin-tapper:hover { transform: translateY(-1px); }
#muffin-tapper:active { transform: translateY(0); }

/* Click “pop” feedback (app.js toggles .pop on click) */
#muffin-tapper.pop { transform: scale(1.08); }
/* NEW: pop the emoji slightly for extra feedback */
#muffin-tapper .mt-emoji{ transition: transform .15s ease; }
#muffin-tapper.pop .mt-emoji{ transform: scale(1.15); }

/* Emoji + counter badge */
#muffin-tapper .mt-emoji{ font-size: 26px; }
#muffin-tapper .mt-count{
  position: absolute;
  top: -6px; right: -6px;
  min-width: 22px; height: 22px;
  padding: 0 6px;
  border-radius: 9999px;
  background: var(--accent-2);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  display: grid; place-items: center;
  border: 1px solid #fff3;
  box-shadow: 0 4px 10px rgba(0,0,0,.08);
}

/* Compact spacing on very small screens */
@media (max-width: 480px){
  #muffin-tapper{ right: 14px; bottom: 14px; width: 52px; height: 52px; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce){
  #muffin-tapper{ transition: none; }
}

/* Cookies */
.cookie-banner{position:fixed;left:0;right:0;bottom:0;background:#111;color:#fff;z-index:99999;padding:0 12px}
.cookie-banner .cookie-inner{max-width:960px;margin:0 auto;display:flex;gap:12px;align-items:center;justify-content:space-between;padding:14px 0}
.cookie-banner a{color:#fff;text-decoration:underline}
.cookie-actions .btn{background:#fff;color:#111;border:1px solid #fff}
@media (max-width:700px){.cookie-banner .cookie-inner{flex-direction:column;align-items:flex-start}}

/* Subs disabled helpers */
.badge-soon{background:#fff0d6;color:#7a3b00}
.card.is-disabled .buy{display:none}

/* === Mobile cart polish === */
@media (max-width: 640px){
  #cart-drawer{ width:100vw; max-width:none; }
  .cart-item{ display:flex; flex-direction:column; gap:8px; padding:12px 0; border-bottom:1px solid #eee; }
  .cart-item .ci-info{ display:flex; justify-content:space-between; align-items:flex-start; gap:8px; }
  .cart-item .ci-name{ font-size:16px; line-height:1.3; flex:1; word-break:break-word; }
  .cart-item .ci-meta{ font-size:14px; white-space:nowrap; }
  .cart-item .ci-qty{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
  .cart-item .qty{ width:44px; height:44px; border-radius:10px; font-size:18px; }
  .cart-item .qty-input{ width:64px; height:44px; text-align:center; font-size:16px; }
  .cart-item .remove{ margin-left:auto; }
  /* FIX: make the real cart footer sticky on mobile */
  .cart-footer{ position:sticky; bottom:0; background:#fff; padding:12px 16px 16px; border-top:1px solid #eee; }
  .btn, .btn-primary{ min-height:44px; }
  .product .buy .btn{ width:100%; }
}

/* Tap target + layering improvements */
button, .btn { touch-action: manipulation; }
#cart-backdrop{ touch-action: none; }
.product .buy .btn{ position:relative; z-index:2; }
.product.card{ overflow:hidden; }
/* Disabled delivery windows appear dim */
#delivery-time option[disabled]{ color:#a0a4aa; }
.per-driver-note { margin-top:.5rem; font-size:.9rem; opacity:.85; }
.per-driver-note .note-title { font-weight:600; margin-bottom:.25rem; }
