/* BAEBAKES — customer site styles */
@import url('tokens.css');

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { overflow-x: hidden; max-width: 100%; } /* belt-and-suspenders: nothing on the page can ever force horizontal scroll */
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; margin: 0 0 .5em; color: var(--text); overflow-wrap: break-word; }
p { margin: 0 0 1em; overflow-wrap: break-word; }
.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; width: 100%; }
@media (max-width: 640px) { .container { padding: 0 18px; } }
section { padding: 72px 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 40px; }
.section-head .eyebrow { color: var(--accent); letter-spacing: .12em; text-transform: uppercase; font-size: .78rem; font-weight: 600; }
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
.section-head p { color: var(--text-muted); }

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 28px; border-radius: 999px; font-weight: 600; font-size: .92rem;
  border: 1px solid transparent; cursor: pointer; transition: all .18s ease;
  letter-spacing: .02em;
}
.btn-primary { background: var(--accent); color: var(--accent-contrast); }
.btn-primary:hover { background: var(--accent-dark); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-outline { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn-outline:hover { background: var(--burgundy-soft); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--cream-soft); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 18px; font-size: .82rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* ── Header ──────────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 40; background: rgba(255,255,255,.92);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--border);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 76px; }
.logo { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; letter-spacing: .04em; color: var(--accent); display: flex; align-items: center; }
.logo-img { height: 34px; width: auto; display: block; }
.nav-main { display: flex; gap: 36px; }
.nav-main a { font-weight: 500; font-size: .92rem; letter-spacing: .03em; padding: 6px 0; border-bottom: 2px solid transparent; }
.nav-main a:hover, .nav-main a.active { border-color: var(--accent); color: var(--accent); }
.header-actions { display: flex; align-items: center; gap: 18px; }
.icon-btn { background: none; border: none; cursor: pointer; display: flex; align-items: center; color: var(--text); padding: 0; }
.icon-btn:hover { color: var(--accent); }
.header-search { display: flex; align-items: center; }
.header-search input {
  width: 0; opacity: 0; padding: 0; margin-left: 0; border: none; border-bottom: 1px solid var(--border);
  background: none; transition: width .22s ease, opacity .18s ease, margin-left .22s ease; font-size: .88rem;
}
.header-search.open input { width: 160px; opacity: 1; margin-left: 10px; padding: 4px 2px; }
.lang-switch { display: flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--text-muted); }
.lang-switch button { background: none; border: none; cursor: pointer; padding: 2px 3px; color: var(--text-muted); font-weight: 500; font-family: inherit; font-size: inherit; }
.lang-switch button.active { color: var(--accent); font-weight: 700; }
.lang-switch span { color: var(--border); }
.cart-btn { position: relative; display: flex; align-items: center; }
.cart-count {
  position: absolute; top: -8px; right: -10px; background: var(--accent); color: var(--accent-contrast);
  font-size: .68rem; font-weight: 700; min-width: 18px; height: 18px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}
.nav-toggle { display: none; background: none; border: none; cursor: pointer; }
.mobile-nav { display: none; }
.mobile-nav-search, .mobile-nav-extra { display: none; }
/* Keep the header itself to logo/menu/cart on mobile, per spec — search,
   language and WhatsApp move into the slide-out menu instead of adding
   more icons to an already-tight mobile header row. */
@media (max-width: 860px) {
  .nav-main { display: none; }
  .header-search, .header-whatsapp { display: none; }
  .nav-toggle { display: block; }
  .mobile-nav.open {
    display: flex; flex-direction: column; gap: 4px; position: absolute; top: 76px; left: 0; right: 0;
    background: var(--surface); border-bottom: 1px solid var(--border); padding: 12px 24px 20px; box-shadow: var(--shadow);
  }
  .mobile-nav a { padding: 12px 0; border-bottom: 1px solid var(--border); font-weight: 500; }
  .mobile-nav-search { display: block; margin: 10px 0; }
  .mobile-nav-search input { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); }
  .mobile-nav-extra { display: flex; align-items: center; justify-content: space-between; padding-top: 12px; }
}

/* ── Hero ────────────────────────────────────────────────────────────── */
.hero {
  padding: 90px 0; text-align: center; background:
    radial-gradient(circle at 20% 20%, var(--cream-soft), transparent 60%),
    var(--bg);
}
.hero .eyebrow { color: var(--accent); letter-spacing: .18em; text-transform: uppercase; font-size: .8rem; font-weight: 700; }
.hero h1 { font-size: clamp(2.6rem, 7vw, 4.6rem); margin: 8px 0 6px; }
.hero .tagline { font-size: clamp(1.1rem, 2vw, 1.35rem); color: var(--text-muted); font-style: italic; margin-bottom: 32px; }
.hero-cta { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-bottom: 48px; }
.hero-image { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg); max-width: 920px; margin: 0 auto; aspect-ratio: 16/8; }
.hero-image img { width: 100%; height: 100%; object-fit: cover; }
.placeholder-photo {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--cream-soft), var(--burgundy-soft));
  color: var(--accent); font-family: var(--font-display); font-size: 1.1rem;
}

/* ── Sliding Information Block — slim strip below the hero ───────────── */
.info-slider {
  position: relative; background: var(--accent); color: var(--accent-contrast);
  height: 46px; overflow: hidden; display: flex; align-items: center; justify-content: center;
  padding: 0 60px;
}
.info-slider-track { position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.info-slider-item, .info-slider-dot {
  position: absolute; left: 0; right: 0; text-align: center; opacity: 0; transition: opacity .5s ease;
  font-size: .82rem; letter-spacing: .04em; font-weight: 600; text-transform: uppercase; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.info-slider-item.active { opacity: 1; position: relative; }
.info-slider-dot { display: none; } /* separators only matter in the raw source order; hidden from the cycling display */
.info-slider-sub { font-weight: 400; text-transform: none; letter-spacing: 0; opacity: .85; }
.info-slider-arrow {
  position: absolute; top: 0; bottom: 0; width: 40px; background: none; border: none; color: var(--accent-contrast);
  opacity: .7; cursor: pointer; font-size: 1.3rem;
}
.info-slider-arrow:hover { opacity: 1; }
.info-slider-arrow.prev { left: 12px; } .info-slider-arrow.next { right: 12px; }
.info-slider-dots { position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%); display: flex; gap: 5px; }
.info-slider-indicator { width: 5px; height: 5px; border-radius: 50%; background: rgba(255,255,255,.4); cursor: pointer; }
.info-slider-indicator.active { background: var(--accent-contrast); }
@media (max-width: 640px) { .info-slider { padding: 0 44px; height: 40px; } .info-slider-item { font-size: .72rem; } }

/* ── Category / craving tiles ───────────────────────────────────────── */
.craving-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.craving-tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  text-align: center; transition: all .18s ease; overflow: hidden;
}
.craving-tile:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--accent); }
.craving-tile .tile-photo { aspect-ratio: 4/3; overflow: hidden; }
.craving-tile .tile-photo img { width: 100%; height: 100%; object-fit: cover; }
.craving-tile .tile-body { padding: 16px 12px 20px; }
.craving-tile .icon { font-size: 2rem; margin-bottom: 10px; }
.craving-tile h3 { font-size: 1.05rem; margin: 0; }
.craving-tile .tile-desc { color: var(--text-muted); font-size: .85rem; margin: 6px 0 0; }
@media (max-width: 760px) { .craving-grid { grid-template-columns: repeat(2, 1fr); } }

/* ── Product cards / grid ───────────────────────────────────────────── */
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 26px; }
@media (max-width: 1020px) { .product-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) { .product-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; } }
@media (max-width: 480px) { .product-grid { grid-template-columns: 1fr 1fr; gap: 12px; } }

/* Featured Bakes on the homepage swipes horizontally on mobile instead of
   reflowing to a smaller grid — the Shop page's own #shopGrid keeps the
   normal grid above (it's a browsing grid, not a curated scroller). */
@media (max-width: 760px) {
  #featuredGrid { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 16px; margin: 0 -20px; padding: 0 20px 4px; }
  #featuredGrid .product-card { flex: 0 0 72%; scroll-snap-align: start; }
}

.product-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .18s ease, transform .18s ease;
}
.product-card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.product-card .thumb { aspect-ratio: 1/1; background: var(--cream-soft); position: relative; overflow: hidden; }
.product-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-card .badge {
  position: absolute; top: 10px; left: 10px; background: var(--accent); color: var(--accent-contrast);
  font-size: .68rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px;
}
.product-card .badge.soldout { background: var(--brown-soft); }
.product-card .badge.preorder { background: var(--warning); }
.product-card .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-card h3 { font-size: 1.05rem; margin: 0; }
.product-card .desc { color: var(--text-muted); font-size: .85rem; margin: 0; flex: 1; }
.product-card .price-row { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.product-card .price { font-weight: 700; color: var(--accent); font-size: 1.05rem; }

/* ── Section: preorder / story / instagram ─────────────────────────── */
.section-alt { background: var(--cream-soft); }
.preorder-section { text-align: center; }
.story-section { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.story-section .photo { border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 4/3; box-shadow: var(--shadow); }
@media (max-width: 820px) { .story-section { grid-template-columns: 1fr; } }
.ig-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
@media (max-width: 760px) {
  /* Swipeable on mobile (~2 tiles visible) rather than a smaller grid —
     matches the same scroll-snap technique used for #featuredGrid below. */
  .ig-grid { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 10px; margin: 0 -20px; padding: 0 20px 4px; }
  .ig-grid a { flex: 0 0 46%; scroll-snap-align: start; }
}
.ig-grid a { aspect-ratio: 1/1; border-radius: var(--radius-sm); overflow: hidden; }

/* ── Footer ──────────────────────────────────────────────────────────── */
.site-footer { background: var(--brown); color: var(--cream); padding: 56px 0 28px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 40px; }
.footer-grid .logo { color: var(--cream); }
.footer-grid p { color: #C9B9AF; font-size: .9rem; }
.footer-col h4 { color: var(--cream); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 14px; }
.footer-col a { display: block; color: #D8CBC2; font-size: .9rem; padding: 5px 0; }
.footer-col a:hover { color: var(--cream); }
.footer-bottom { border-top: 1px solid rgba(251,246,239,.15); padding-top: 20px; font-size: .8rem; color: #B8A89E; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }

/* ── WhatsApp floating button ───────────────────────────────────────── */
.whatsapp-fab {
  position: fixed; bottom: 24px; right: 24px; z-index: 50; width: 58px; height: 58px; border-radius: 50%;
  background: var(--accent); color: var(--accent-contrast); display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-lg); transition: transform .15s ease;
}
.whatsapp-fab:hover { transform: scale(1.07); }

/* ── Cart drawer ─────────────────────────────────────────────────────── */
.overlay { position: fixed; inset: 0; background: rgba(54,38,33,.4); z-index: 60; opacity: 0; pointer-events: none; transition: opacity .2s ease; }
.overlay.open { opacity: 1; pointer-events: auto; }
.cart-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); background: var(--surface); z-index: 70;
  transform: translateX(100%); transition: transform .25s ease; display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
}
.cart-drawer.open { transform: translateX(0); }
.cart-drawer .drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; border-bottom: 1px solid var(--border); }
.cart-drawer .drawer-items { flex: 1; overflow-y: auto; padding: 12px 22px; }
.cart-drawer .drawer-foot { padding: 18px 22px 22px; border-top: 1px solid var(--border); }
.close-btn { background: none; border: none; cursor: pointer; font-size: 1.3rem; color: var(--text-muted); }

.cart-line { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.cart-line .thumb { width: 68px; height: 68px; border-radius: var(--radius-sm); overflow: hidden; background: var(--cream-soft); flex-shrink: 0; }
.cart-line .thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-line .info { flex: 1; min-width: 0; }
.cart-line .info .name { font-weight: 600; font-size: .92rem; }
.cart-line .info .price { color: var(--text-muted); font-size: .85rem; }
.qty-stepper { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; margin-top: 6px; }
.qty-stepper button { width: 26px; height: 26px; border: none; background: var(--cream-soft); cursor: pointer; font-size: 1rem; }
.qty-stepper span { min-width: 28px; text-align: center; font-size: .85rem; }
.remove-link { color: var(--danger); font-size: .78rem; cursor: pointer; background: none; border: none; padding: 0; margin-top: 6px; }
.summary-row { display: flex; justify-content: space-between; font-size: .92rem; padding: 4px 0; color: var(--text-muted); }
.summary-row.total { color: var(--text); font-weight: 700; font-size: 1.1rem; border-top: 1px solid var(--border); margin-top: 8px; padding-top: 12px; }
.empty-state { text-align: center; padding: 40px 0; color: var(--text-muted); }

/* ── Forms ───────────────────────────────────────────────────────────── */
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: 6px; }
.field .hint { font-size: .78rem; color: var(--text-muted); margin-top: 4px; }
input, select, textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: .92rem; background: var(--surface); color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 620px) { .field-row { grid-template-columns: 1fr; } }
.radio-cards { display: flex; gap: 12px; }
.radio-card {
  flex: 1; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; cursor: pointer;
  display: flex; align-items: center; gap: 10px; transition: all .15s ease;
}
.radio-card.selected { border-color: var(--accent); background: var(--burgundy-soft); }

/* ── Generic page layout ─────────────────────────────────────────────── */
.page-head { padding: 56px 0 32px; text-align: center; border-bottom: 1px solid var(--border); background: var(--cream-soft); }
.page-head h1 { font-size: clamp(2rem, 4vw, 2.8rem); }
.narrow { max-width: 760px; margin: 0 auto; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px; }
.status-pill { display: inline-flex; padding: 5px 14px; border-radius: 999px; font-size: .78rem; font-weight: 700; letter-spacing: .02em; }
.status-new, .status-confirmed { background: #E4ECF7; color: #2A4C82; }
.status-preparing, .status-out_for_delivery { background: #FBECD1; color: var(--warning); }
.status-ready_for_pickup { background: #E1F0E3; color: var(--success); }
.status-completed { background: #E1F0E3; color: var(--success); }
.status-cancelled, .status-refunded { background: #F5DEDE; color: var(--danger); }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px); z-index: 100;
  background: var(--brown); color: var(--cream); padding: 12px 22px; border-radius: 999px; font-size: .88rem;
  opacity: 0; pointer-events: none; transition: all .25s ease; box-shadow: var(--shadow-lg);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.spinner { width: 20px; height: 20px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton { background: linear-gradient(90deg, var(--cream-soft) 25%, var(--border) 50%, var(--cream-soft) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--radius-sm); }
@keyframes shimmer { to { background-position: -200% 0; } }
