/* Cakes in the Bay — online shop styles (extends /assets/css/style.css tokens) */

.shop { padding-top: calc(var(--nav-h) + 40px); }
.shop__heading { color: var(--berry); margin-bottom: 12px; }
.shop__intro { color: var(--muted); max-width: 640px; margin-bottom: 28px; }
.shop-narrow { max-width: 760px; margin: 0 auto; }

.shop-alert { padding: 12px 18px; border-radius: var(--radius); margin: 14px 0; font-size: 0.95rem; }
.shop-alert--error { background: #FBEAEA; border: 1px solid #E5B5B5; color: #8C2F2F; }
.shop-alert--ok { background: #EAF6EC; border: 1px solid #B8DDBF; color: #2F6B3A; }

.offer-banner { background: var(--berry); color: #fff; border-radius: var(--radius); padding: 12px 20px;
  margin-bottom: 20px; font-weight: 500; letter-spacing: 0.02em; text-align: center; }
.basket-table__offer td { color: #2F6B3A; font-weight: 500; background: #F3FAF4; }

.basket-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--blush); border: 1px solid var(--blush-dark); border-radius: var(--radius);
  padding: 12px 18px; margin-bottom: 26px; }

/* menu grid */
.bake-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 26px; }
.bake-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.bake-card--soldout { opacity: 0.65; }
.bake-card__img { aspect-ratio: 4 / 3; overflow: hidden; }
.bake-card__img img { width: 100%; height: 100%; object-fit: cover; }
.bake-card__body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.bake-card__top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.bake-card__top h3 { font-size: 1.25rem; color: var(--dark); }
.bake-card__price { font-family: var(--font-display); font-size: 1.15rem; color: var(--rose-dark); white-space: nowrap; }
.bake-card__desc { font-size: 0.92rem; color: var(--muted); line-height: 1.6; }
.bake-card__days { font-size: 0.8rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.day-badge { background: var(--rose-light); color: var(--rose-dark); border: 1px solid var(--blush-dark);
  border-radius: 20px; padding: 1px 10px; font-size: 0.75rem; font-weight: 500; }
.bake-card__info summary { cursor: pointer; font-size: 0.85rem; color: var(--rose-dark); font-weight: 500; }
.bake-card__ingredients { font-size: 0.8rem; color: var(--muted); margin-top: 8px; line-height: 1.6; }
.bake-card__allergens { font-size: 0.8rem; margin-top: 6px; color: var(--dark); }
.bake-card__foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 6px; }
.soldout-badge { background: var(--dark); color: #fff; border-radius: 20px; padding: 4px 14px; font-size: 0.8rem; letter-spacing: 0.05em; text-transform: uppercase; }
.low-stock { color: var(--gold); font-size: 0.82rem; font-weight: 500; }
.add-form { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.add-form select { padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius);
  font-family: inherit; font-size: 16px; min-height: 44px; background: var(--surface); }
.btn--small { padding: 9px 16px; font-size: 0.85rem; }
.btn--big { width: 100%; padding: 16px; font-size: 1.05rem; }

/* --- shop button fixes ---------------------------------------------------
   .btn--ghost in the main stylesheet is white-on-transparent, built for the
   hero photo. On the shop's light backgrounds it renders as invisible/grey
   text, which reads as a permanently disabled button. Inside .shop, give it
   the same treatment as .btn--outline so it is always legible.            */
.shop .btn--ghost { border-color: var(--rose); color: var(--rose); background: transparent; }
.shop .btn--ghost:hover { background: var(--rose); color: #fff; }

/* Comfortable touch targets — 44px is the accessible minimum. */
.shop .btn { min-height: 44px; }
.shop .btn--small { padding: 10px 18px; font-size: 0.85rem; min-height: 44px; }

/* 16px stops iOS Safari zooming the page in when a field is focused. */
.shop input, .shop select, .shop textarea { font-size: 16px; }

/* basket (checkout still uses .basket-table for its read-only summary) */
.basket-table { width: 100%; border-collapse: collapse; margin: 20px 0; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.basket-table td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.basket-table tr:last-child td { border-bottom: none; }
.basket-table__name { font-weight: 500; }
.basket-table__days { display: block; font-size: 0.78rem; color: var(--muted); font-weight: 300; margin-top: 3px; }
.basket-table__price { text-align: right; white-space: nowrap; font-family: var(--font-display); }
.basket-table__total td { font-weight: 600; background: var(--blush); font-size: 1.05rem; }

/* basket line items — one bordered panel with divided rows, like a table,
   but on a grid so it reflows on small screens instead of overflowing */
.basket-list { list-style: none; margin: 20px 0 0; padding: 0; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.basket-row { display: grid; gap: 10px 14px; align-items: center;
  grid-template-columns: auto 1fr auto auto auto;
  grid-template-areas: "thumb main qty price remove";
  padding: 14px 16px; border-bottom: 1px solid var(--border); }
.basket-row:last-child { border-bottom: none; }
.basket-row__thumb { grid-area: thumb; width: 64px; height: 64px; border-radius: var(--radius);
  object-fit: cover; display: block; background: var(--blush); border: 1px solid var(--border); }
.basket-row__thumb--empty { background: var(--blush); }
.basket-row__main { grid-area: main; min-width: 0; }
.basket-row__name { font-weight: 500; display: block; }
.basket-row__days { display: block; font-size: 0.78rem; color: var(--muted); font-weight: 300; margin-top: 3px; }
.basket-row__price { grid-area: price; text-align: right; white-space: nowrap;
  font-family: var(--font-display); font-size: 1.05rem; align-self: center; }
.basket-row__remove { grid-area: remove; justify-self: end; align-self: center; }
.basket-qty { grid-area: qty; display: flex; gap: 8px; align-items: center; }
.basket-qty__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.basket-qty input[type=number] { width: 72px; min-height: 44px; padding: 8px 10px; text-align: center;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
/* Quiet until the quantity actually changes, then clearly the thing to press. */
.basket-qty__update { opacity: 0.55; transition: opacity var(--trans), background var(--trans), color var(--trans); }
.basket-qty.is-changed .basket-qty__update { opacity: 1; background: var(--rose); color: #fff; border-color: var(--rose); }
.basket-remove { background: none; border: none; color: var(--muted); font-size: 1.6rem; cursor: pointer;
  line-height: 1; min-width: 44px; min-height: 44px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius); }
.basket-remove:hover { color: var(--rose-dark); background: var(--blush); }

.basket-totals { background: var(--blush); border: 1px solid var(--border); border-top: none;
  border-radius: 0 0 var(--radius) var(--radius); padding: 4px 16px 14px; margin: -1px 0 18px; }
.basket-totals__row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 12px 0; border-bottom: 1px solid var(--border); }
.basket-totals__row:last-of-type { border-bottom: none; }
.basket-totals__row--offer { color: #2F6B3A; font-weight: 500; }
.basket-totals__row--total { font-weight: 600; font-size: 1.15rem; }
.basket-totals__note { font-size: 0.8rem; color: var(--muted); line-height: 1.55; margin-top: 2px; }

.basket-actions { display: flex; justify-content: space-between; gap: 14px; margin-top: 10px; }

/* checkout */
.checkout-form { margin-top: 26px; display: flex; flex-direction: column; gap: 20px; }
.checkout-form label { display: flex; flex-direction: column; gap: 6px; font-size: 0.9rem; font-weight: 500; color: var(--dark); }
.checkout-form input, .checkout-form textarea { padding: 12px 14px; border: 1px solid var(--border);
  border-radius: var(--radius); font-family: inherit; font-size: 16px; background: var(--surface); }
/* Radios/checkboxes ship at ~13px, which is a poor touch target — size them up. */
.day-radio input[type=radio], .remind-form__check input[type=checkbox],
.checkout-form__pay input[type=radio] { width: 20px; height: 20px; flex: none; accent-color: var(--rose); }
.checkout-form__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.checkout-form__days { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; background: var(--surface); }
.checkout-form__days legend { font-weight: 500; padding: 0 6px; }
.day-radio { display: inline-flex !important; flex-direction: row !important; align-items: center; gap: 8px !important;
  margin: 8px 18px 4px 0; font-weight: 400 !important; }
.day-radio em { color: var(--muted); font-style: normal; font-size: 0.85em; }

/* multi-day collection */
.day-note { font-size: 0.88rem; color: #8C2F2F; background: #FBEAEA; border: 1px solid #E5B5B5;
  border-radius: var(--radius); padding: 10px 12px; margin: 4px 0 12px; line-height: 1.55; }
.day-radio--split { display: flex !important; align-items: flex-start; width: 100%; margin-right: 0; }
.day-radio--split input { margin-top: 3px; }
.day-split { display: block; margin-top: 6px; padding-left: 12px; border-left: 2px solid var(--blush-dark); }
.day-split__row { display: block; font-size: 0.84rem; color: var(--muted); line-height: 1.6; }
.day-split__row strong { color: var(--dark); font-weight: 500; }
.pickup-summary li { margin-bottom: 6px; }

/* added-to-basket confirmation */
.cart-modal { position: fixed; inset: 0; z-index: 1300; display: flex; align-items: center; justify-content: center; padding: 20px; }
.cart-modal[hidden] { display: none; }
.cart-modal__backdrop { position: absolute; inset: 0; background: rgba(45,27,30,0.55); backdrop-filter: blur(3px); }
.cart-modal__panel { position: relative; z-index: 1; width: 100%; max-width: 420px; background: var(--surface);
  border-radius: var(--radius); box-shadow: 0 18px 60px rgba(45,27,30,0.28); padding: 30px 28px 26px;
  text-align: center; animation: cartPop 0.22s var(--ease); }
@keyframes cartPop { from { opacity: 0; transform: translateY(12px) scale(0.97); } to { opacity: 1; transform: none; } }
.cart-modal__close { position: absolute; top: 6px; right: 8px; background: none; border: none; color: var(--muted);
  font-size: 1.7rem; line-height: 1; cursor: pointer; min-width: 44px; min-height: 44px; border-radius: var(--radius); }
.cart-modal__close:hover { color: var(--rose-dark); background: var(--blush); }
.cart-modal__tick { width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 50%; background: #EAF6EC;
  color: #2F6B3A; font-size: 1.6rem; line-height: 52px; font-weight: 600; }
.cart-modal__title { color: var(--berry); font-size: 1.35rem; margin-bottom: 8px; }
.cart-modal__item { font-weight: 500; color: var(--dark); margin-bottom: 4px; }
.cart-modal__meta { font-size: 0.86rem; color: var(--muted); margin-bottom: 22px; }
/* Two side-by-side buttons must fit the panel: .btn ships with 32px side
   padding and flex items refuse to shrink below their content (min-width:auto),
   which pushed them past the edge. Trim the padding and allow shrinking. */
.cart-modal__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cart-modal__actions .btn { min-width: 0; width: 100%; justify-content: center; text-align: center;
  padding-left: 12px; padding-right: 12px; font-size: 0.75rem; letter-spacing: 0.06em; }
.cart-modal__panel:focus { outline: none; }
/* Keyboard focus should read as brand, not the browser's default blue. */
.shop .btn:focus-visible, .shop button:focus-visible, .shop input:focus-visible,
.shop select:focus-visible, .shop textarea:focus-visible {
  outline: 2px solid var(--rose); outline-offset: 2px; }
.cart-modal--error .cart-modal__tick { background: #FBEAEA; color: #8C2F2F; }
.cart-modal--error .cart-modal__tick::before { content: '!'; }
.cart-modal--error .cart-modal__tick { font-size: 0; }
.cart-modal--error .cart-modal__tick::before { font-size: 1.6rem; }

/* how collection works */
.pickup-how { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 28px 30px; margin-top: 40px; }
.pickup-how h3 { color: var(--berry); margin-bottom: 18px; }
.pickup-how__steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px;
  counter-reset: step; list-style: none; }
.pickup-how__steps li { counter-increment: step; position: relative; padding-left: 44px;
  font-size: 0.92rem; color: var(--muted); line-height: 1.65; }
.pickup-how__steps li strong { color: var(--dark); }
.pickup-how__steps li::before { content: counter(step); position: absolute; left: 0; top: 2px;
  width: 30px; height: 30px; border-radius: 50%; background: var(--rose); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 0.9rem; }
.pickup-how__addr { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border);
  font-size: 0.88rem; color: var(--rose-dark); font-weight: 500; }

/* closed page */
.shop-closed { max-width: 640px; margin: 0 auto; text-align: center; }
.shop-closed__msg { font-size: 1.1rem; margin: 16px 0; }
.shop-closed__next { color: var(--rose-dark); }
.remind-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 28px; margin-top: 30px; text-align: left; }
.remind-box h3 { color: var(--berry); margin-bottom: 14px; }
.remind-form { display: flex; flex-direction: column; gap: 14px; }
.remind-form__row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.remind-form label { display: flex; flex-direction: column; gap: 5px; font-size: 0.88rem; font-weight: 500; }
.remind-form input[type=text], .remind-form input[type=email], .remind-form input[type=tel] {
  padding: 11px 13px; border: 1px solid var(--border); border-radius: var(--radius);
  font-family: inherit; font-size: 16px; min-height: 44px; }
.remind-form__check { flex-direction: row !important; align-items: center; gap: 9px !important; font-weight: 400 !important; }
.remind-form__small { font-size: 0.78rem; color: var(--muted); line-height: 1.6; }

@media (max-width: 560px) {
  .shop { padding-top: calc(var(--nav-h) + 24px); }
  .basket-bar { flex-direction: column; align-items: flex-start; }

  /* Buttons go full width and stack so nothing is cramped or half off-screen. */
  .basket-actions { flex-direction: column-reverse; }
  .basket-actions .btn { width: 100%; justify-content: center; }

  /* Thumb + name + remove on the top line; quantity and price beneath. */
  .basket-row { grid-template-columns: auto 1fr auto;
    grid-template-areas: "thumb main remove" "qty qty price"; gap: 10px 12px; }
  .basket-row__thumb { width: 52px; height: 52px; }
  .basket-row__price { font-size: 1.1rem; }
  .basket-remove { font-size: 1.8rem; }

  /* One bake per row reads better than two cramped columns. */
  .bake-grid { grid-template-columns: 1fr; gap: 20px; }
  .bake-card__top { flex-wrap: wrap; gap: 4px 12px; }

  .checkout-form__grid { grid-template-columns: 1fr; }
  .remind-form__row { grid-template-columns: 1fr; }
  .pickup-how { padding: 22px 18px; }
  .pickup-how__steps { grid-template-columns: 1fr; }
  .day-radio { display: flex !important; margin: 0 0 4px; padding: 10px 4px; }
  .add-form { width: 100%; }
  .add-form .btn { flex: 1; justify-content: center; }
  .cart-modal__panel { padding: 26px 20px 22px; }
  /* Stacked on phones: primary action nearest the thumb. */
  .cart-modal__actions { grid-template-columns: 1fr; }
  .cart-modal__actions .btn--primary { order: -1; }
}

/* Never let anything force the page sideways on a narrow screen. */
.shop img, .shop table { max-width: 100%; }
.shop .container { overflow-x: hidden; }

/* honeypot — off-screen for people, still present for bots */
.hp-field { position:absolute !important; left:-9999px !important; width:1px; height:1px; overflow:hidden; }

/* multibuy */
.offer-banner__sub { display:block; font-weight:300; font-size:0.82rem; opacity:0.9; margin-top:3px; letter-spacing:0; }
.offer-badge { background:var(--berry); color:#fff; border-radius:20px; padding:1px 10px;
  font-size:0.72rem; font-weight:500; letter-spacing:0.02em; white-space:nowrap; }

/* ── Closing countdown ────────────────────────────────────────────────────
   Split-flap ticker shown only in the final 24 hours before ordering shuts. */
.closing {
  margin: 0 0 30px;
  padding: 26px 24px 22px;
  border-radius: 14px;
  background: linear-gradient(160deg, #2a171b 0%, #170e10 100%);
  box-shadow: 0 10px 34px rgba(45, 27, 30, 0.28);
  text-align: center;
}
.closing__lede {
  margin: 0 0 18px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #fff;
}
.closing__clock { display: flex; justify-content: center; gap: 12px; }
.flip { width: 78px; }
.flip__face {
  position: relative;
  display: block;
  padding: 12px 0 13px;
  border-radius: 10px;
  /* Two tones meeting at the midpoint give the split-flap card its hinge. */
  background: linear-gradient(#3d3d40 0%, #2c2c2f 49.5%, #202023 50.5%, #323235 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.10), 0 3px 10px rgba(0, 0, 0, 0.45);
  font-size: 2.4rem;
  font-weight: 600;
  line-height: 1;
  /* Fixed-width digits, or the panels twitch as the numbers change. */
  font-variant-numeric: tabular-nums;
  color: #f2f2f4;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}
.flip__face::after {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 1px;
  background: rgba(0, 0, 0, 0.55);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
}
.flip__lbl {
  display: block;
  margin-top: 9px;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}
.closing__note { margin: 18px 0 0; font-size: 0.85rem; color: rgba(255, 255, 255, 0.72); }
.closing--over .flip__face { color: #8d8d90; }

@media (max-width: 430px) {
  .closing { padding: 22px 14px 18px; }
  .closing__clock { gap: 8px; }
  .flip { width: 62px; }
  .flip__face { font-size: 1.9rem; padding: 10px 0 11px; }
  .flip__lbl { font-size: 0.56rem; letter-spacing: 0.12em; }
}

/* Title on the left, closing ticker on the right. The ticker only exists in
   the last 24 hours, so this row has to look right with and without it. */
.shop__titlebar {
  display: flex;
  align-items: center;
  gap: 20px 32px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.shop__titlebar-text { flex: 1 1 300px; min-width: 0; }
.shop__titlebar-text .eyebrow { margin-bottom: 0.5rem; }
.shop__titlebar-text .shop__heading { margin-bottom: 0; }
.shop__titlebar .closing {
  flex: 0 0 auto;
  margin: 0 0 0 auto;
  padding: 18px 22px 15px;
}
.shop__titlebar .closing__lede { margin-bottom: 13px; font-size: 0.72rem; }
.shop__titlebar .closing__note { margin-top: 12px; font-size: 0.78rem; }

@media (max-width: 720px) {
  /* Stacked, the ticker gets the full width rather than hugging one edge. */
  .shop__titlebar .closing { flex: 1 1 100%; margin-left: 0; }
}
