/* ============================================================
   Twin Bites — storefront styles
   ============================================================ */

:root {
  --cream:        #faf8ee;
  --cream-2:      #f4efe0;
  --tan:          #eee7d4;
  --tan-line:     #e3dcc8;
  /* "brown" tokens repurposed as the navy-blue brand palette */
  --brown:        #1e3a8f;   /* primary royal blue */
  --brown-dark:   #14275e;   /* deep navy — dark sections, footer */
  --brown-800:    #1a3374;
  --accent:       #1e3a8f;   /* accent = brand blue */
  --accent-soft:  #4c68b8;   /* lighter blue */
  --ink:          #1b2440;   /* near-navy ink for body text */
  --muted:        #5f6b86;   /* muted blue-grey */
  --white:        #ffffff;
  --green:        #2f7d54;
  --shadow-sm:    0 1px 3px rgba(20, 39, 94, .10);
  --shadow-md:    0 8px 28px rgba(20, 39, 94, .14);
  --shadow-lg:    0 20px 60px rgba(20, 39, 94, .22);
  --radius:       14px;
  --radius-lg:    22px;
  --serif: "Fraunces", "Georgia", "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --logo: "Fredoka", "Inter", sans-serif;
  --maxw: 1120px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  background: var(--cream);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.eyebrow {
  font-size: 12px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--accent); font-weight: 700; margin-bottom: 16px;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 400; color: var(--brown-dark); line-height: 1.08; letter-spacing: -.01em; }
h2.section-title { font-size: clamp(28px, 4vw, 40px); margin-bottom: 10px; }
.section-lead { color: var(--muted); max-width: 560px; font-size: 17px; }
.section { padding: 88px 0; }

/* ---------- Header ---------- */
header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(250, 249, 245, .82);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, box-shadow .3s;
}
header.scrolled { border-color: var(--tan-line); box-shadow: var(--shadow-sm); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.brand { display: inline-flex; align-items: center; }

/* ---------- Badge logo (exact artwork from the flyer) ---------- */
.tb-logo { height: 48px; width: auto; display: block; }
.footer-brand { justify-content: center; }
.footer-brand .tb-logo { height: 60px; }
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a { font-size: 15px; color: var(--brown); font-weight: 500; transition: color .2s; }
.nav-links a:hover { color: var(--accent); }
.cart-btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1.5px solid var(--brown); color: var(--brown);
  padding: 9px 18px; border-radius: 999px; font-size: 15px; font-weight: 600;
  transition: background .2s, color .2s, transform .1s;
}
.cart-btn:hover { background: var(--brown); color: var(--cream); }
.cart-btn:active { transform: scale(.97); }
.cart-count {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: 12px; font-weight: 700;
  display: none; align-items: center; justify-content: center;
}
.cart-count.show { display: inline-flex; }
.nav-toggle { display: none; font-size: 22px; color: var(--brown); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 15px 26px; border-radius: 999px; font-size: 16px; font-weight: 600;
  transition: transform .12s, box-shadow .2s, background .2s, color .2s;
  white-space: nowrap;
}
.btn-primary { background: var(--brown); color: var(--cream); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--brown-dark); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-ghost { background: transparent; color: var(--brown); border: 1.5px solid var(--tan-line); }
.btn-ghost:hover { border-color: var(--brown); transform: translateY(-2px); }
.btn-block { width: 100%; }
.btn-lg { padding: 17px 30px; font-size: 17px; }

/* ---------- Hero ---------- */
.hero { padding: 60px 0 40px; }
.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.hero h1 { font-size: clamp(44px, 6.5vw, 74px); margin: 8px 0 22px; }
.hero p.lead { font-size: 18px; color: var(--muted); max-width: 460px; margin-bottom: 30px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.hero-photos img {
  width: 100%; height: 420px; object-fit: cover; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}
.hero-photos img:nth-child(2) { margin-top: 34px; }

/* ---------- Trust strip (outlined pills) ---------- */
.trust { background: var(--cream-2); border-top: 1px solid var(--tan-line); border-bottom: 1px solid var(--tan-line); }
.trust-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 14px; padding: 26px 0; }
.trust-row span {
  font-size: 14px; color: var(--brown); font-weight: 600; letter-spacing: .01em;
  border: 1.5px solid var(--brown); border-radius: 999px; padding: 8px 20px;
  background: transparent; transition: background .2s, color .2s;
}
.trust-row span:hover { background: var(--brown); color: var(--cream); }

/* ---------- Story ---------- */
.story-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: center; }
.story-grid h2 { font-size: clamp(30px, 4.4vw, 46px); margin-bottom: 22px; }
.story-grid p { color: var(--muted); font-size: 18px; }
.story-photo img { width: 100%; height: 460px; object-fit: cover; border-radius: var(--radius-lg); box-shadow: var(--shadow-md); }

/* ---------- Flavors ---------- */
.flavors { background: var(--cream-2); }
.millet-note {
  font-family: var(--serif); font-style: italic; font-weight: 400;
  color: var(--brown); font-size: clamp(19px, 2.4vw, 26px); line-height: 1.5;
  text-align: center; max-width: 760px; margin: 30px auto 0;
}
.flavor-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; margin-top: 40px; }
.flavor-card {
  background: var(--white); border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-sm); border: 1px solid var(--tan-line);
  transition: transform .25s, box-shadow .25s;
}
.flavor-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.flavor-card img { width: 100%; height: 260px; object-fit: cover; }
.flavor-card .body { padding: 26px 28px 30px; }
.flavor-card h3 { font-size: 26px; margin-bottom: 8px; }
.flavor-card p { color: var(--muted); font-size: 16px; }

/* ---------- Menu ---------- */
.menu-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; margin-top: 40px; }
.menu-group {
  background: var(--white); border: 1px solid var(--tan-line); border-radius: var(--radius-lg);
  padding: 30px; box-shadow: var(--shadow-sm);
}
.menu-group > h3 { font-size: 24px; margin-bottom: 6px; }
.menu-group > .gsub { color: var(--muted); font-size: 15px; margin-bottom: 20px; }
.price-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 0; border-top: 1px solid var(--tan-line);
}
.price-row .pr-name { font-weight: 600; color: var(--ink); font-size: 16px; }
.price-row .pr-meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.price-row .pr-price { font-family: var(--serif); font-size: 20px; color: var(--brown-dark); white-space: nowrap; }
.price-row .pr-right { display: flex; align-items: center; gap: 16px; }
.add-btn {
  border: 1.5px solid var(--brown); color: var(--brown); background: transparent;
  padding: 8px 18px; border-radius: 999px; font-weight: 600; font-size: 14px;
  transition: background .18s, color .18s, transform .1s; white-space: nowrap;
}
.add-btn:hover { background: var(--brown); color: var(--cream); }
.add-btn:active { transform: scale(.94); }
.add-btn.added { background: var(--green); border-color: var(--green); color: #fff; }
.menu-note {
  margin-top: 30px; text-align: center; color: var(--muted); font-size: 14.5px;
  background: var(--tan); border-radius: var(--radius); padding: 16px 22px;
}

/* ---------- Gallery ---------- */
.gallery { background: var(--cream-2); }
.gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 36px; }
.gallery-grid img { width: 100%; height: 220px; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow-sm); transition: transform .3s; }
.gallery-grid img:hover { transform: scale(1.03); }
.gallery-grid img:first-child { grid-column: span 2; grid-row: span 2; height: 454px; }

/* ---------- Reviews ---------- */
.reviews { text-align: center; }
.review-card { max-width: 720px; margin: 36px auto 0; }
.review-card .quote { font-family: var(--serif); font-size: clamp(24px, 3.4vw, 34px); color: var(--brown-dark); line-height: 1.3; }
.review-card .who { margin-top: 20px; color: var(--accent); font-weight: 600; letter-spacing: .02em; }
.stars { color: var(--accent-soft); font-size: 20px; letter-spacing: 3px; margin-bottom: 22px; }

/* ---------- Order CTA ---------- */
.order { background: var(--brown-dark); color: var(--cream); }
.order .eyebrow { color: var(--accent-soft); }
.order h2 { color: var(--cream); font-size: clamp(30px, 4.4vw, 46px); }
.order p.lead { color: rgba(250,249,245,.75); max-width: 520px; margin: 12px auto 30px; font-size: 18px; }
.order-inner { text-align: center; max-width: 640px; margin: 0 auto; }
.order-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.order .btn-ghost { color: var(--cream); border-color: rgba(250,249,245,.35); }
.order .btn-ghost:hover { border-color: var(--cream); background: rgba(250,249,245,.08); }
.order-contact { margin-top: 26px; font-size: 14.5px; color: rgba(250,249,245,.6); }
.order-contact a { color: var(--accent-soft); font-weight: 600; }

/* ---------- Footer ---------- */
footer { background: var(--brown-dark); color: rgba(250,249,245,.55); border-top: 1px solid rgba(250,249,245,.12); padding: 30px 0; text-align: center; font-size: 14px; }
footer .brand { justify-content: center; color: var(--cream); font-size: 20px; margin-bottom: 10px; }

/* ============================================================
   Cart drawer
   ============================================================ */
.overlay {
  position: fixed; inset: 0; background: rgba(44, 28, 17, .5);
  opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s; z-index: 90;
  backdrop-filter: blur(2px);
}
.overlay.open { opacity: 1; visibility: visible; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: 420px; max-width: 92vw;
  background: var(--cream); z-index: 100; transform: translateX(100%);
  transition: transform .34s cubic-bezier(.22,.61,.36,1);
  display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
}
.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 24px; border-bottom: 1px solid var(--tan-line); }
.drawer-head h3 { font-size: 22px; }
.drawer-close { font-size: 26px; color: var(--muted); line-height: 1; padding: 4px 8px; border-radius: 8px; transition: background .2s; }
.drawer-close:hover { background: var(--tan); }
.drawer-body { flex: 1; overflow-y: auto; padding: 8px 24px; }
.cart-empty { text-align: center; color: var(--muted); padding: 60px 10px; }
.cart-empty .em-ico { font-size: 40px; margin-bottom: 14px; opacity: .5; }

.cart-item { display: flex; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--tan-line); }
.cart-item img { width: 66px; height: 66px; border-radius: 12px; object-fit: cover; flex: none; }
.ci-main { flex: 1; min-width: 0; }
.ci-name { font-weight: 600; font-size: 15px; color: var(--ink); }
.ci-variant { font-size: 13px; color: var(--muted); margin-top: 1px; }
.ci-price { font-family: var(--serif); font-size: 15px; color: var(--brown-dark); margin-top: 4px; }
.ci-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--tan-line); border-radius: 999px; overflow: hidden; }
.qty button { width: 30px; height: 30px; font-size: 17px; color: var(--brown); display: grid; place-items: center; transition: background .15s; }
.qty button:hover { background: var(--tan); }
.qty span { min-width: 30px; text-align: center; font-weight: 600; font-size: 14px; }
.ci-remove { font-size: 12.5px; color: var(--muted); text-decoration: underline; }
.ci-remove:hover { color: #b1442f; }

.drawer-foot { border-top: 1px solid var(--tan-line); padding: 20px 24px 24px; background: var(--cream-2); }
.subtotal-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.subtotal-row .label { color: var(--muted); font-size: 14px; }
.subtotal-row .val { font-family: var(--serif); font-size: 26px; color: var(--brown-dark); }
.savings { color: var(--green); font-size: 13px; font-weight: 600; margin-bottom: 14px; }
.foot-note { font-size: 12.5px; color: var(--muted); margin-top: 12px; text-align: center; }

/* ============================================================
   Checkout modal
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(44, 28, 17, .55);
  opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s; z-index: 110;
  display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 40px 16px;
  backdrop-filter: blur(3px);
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal {
  background: var(--cream); border-radius: var(--radius-lg); width: 100%; max-width: 480px;
  box-shadow: var(--shadow-lg); transform: translateY(16px); transition: transform .3s; overflow: hidden;
}
.modal-overlay.open .modal { transform: translateY(0); }
.modal-head { padding: 24px 28px 6px; }
.modal-head h3 { font-size: 24px; }
.modal-head p { color: var(--muted); font-size: 14.5px; margin-top: 4px; }
.modal-body { padding: 16px 28px 8px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--brown); margin-bottom: 6px; }
.field label .req { color: #b1442f; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--tan-line); border-radius: 12px;
  font-family: inherit; font-size: 15px; color: var(--ink); background: var(--white);
  transition: border-color .2s, box-shadow .2s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(30,58,143,.15);
}
.field textarea { resize: vertical; min-height: 68px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.field.error input, .field.error select { border-color: #cc5540; }
.field .err-msg { color: #b1442f; font-size: 12px; margin-top: 5px; display: none; }
.field.error .err-msg { display: block; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.modal-foot { padding: 8px 28px 26px; }
.order-summary { background: var(--tan); border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; font-size: 14px; }
.order-summary .os-line { display: flex; justify-content: space-between; padding: 3px 0; color: var(--muted); }
.order-summary .os-total { display: flex; justify-content: space-between; padding-top: 8px; margin-top: 6px; border-top: 1px solid var(--tan-line); font-weight: 700; color: var(--brown-dark); font-size: 16px; }
.pay-note { font-size: 12px; color: var(--muted); text-align: center; margin-top: 12px; display: flex; align-items: center; justify-content: center; gap: 6px; }

.spinner { width: 18px; height: 18px; border: 2px solid rgba(250,249,245,.4); border-top-color: var(--cream); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* toast */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--brown-dark); color: var(--cream); padding: 13px 22px; border-radius: 999px;
  font-size: 14.5px; font-weight: 500; box-shadow: var(--shadow-md); z-index: 200;
  opacity: 0; visibility: hidden; transition: opacity .25s, transform .25s, visibility .25s; white-space: nowrap;
}
.toast.show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid, .story-grid { grid-template-columns: 1fr; gap: 34px; }
  .hero-photos img { height: 300px; }
  .story-photo { order: -1; }
  .story-photo img { height: 320px; }
  .flavor-cards, .menu-groups { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid img:first-child { grid-column: span 2; height: 260px; grid-row: auto; }
  .section { padding: 64px 0; }
}
@media (max-width: 620px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex; position: absolute; top: 68px; left: 0; right: 0; flex-direction: column;
    background: var(--cream); padding: 18px 24px; gap: 18px; border-bottom: 1px solid var(--tan-line);
    box-shadow: var(--shadow-md);
  }
  .nav-toggle { display: block; }
  .tb-logo { height: 40px; }
  .footer-brand .tb-logo { height: 52px; }
  .hero-photos { grid-template-columns: 1fr 1fr; gap: 10px; }
  .hero-photos img { height: 200px; }
  .hero-photos img:nth-child(2) { margin-top: 20px; }
  .two-col { grid-template-columns: 1fr; }
  .wrap { padding: 0 18px; }
}
