/* Storefront layout. Components (buttons, inputs, modals...) come from ui.css. */
:root { --max: 720px; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--ui-font); background: var(--ui-bg); color: var(--ui-text); line-height: 1.4; }
body.has-cart { padding-bottom: 96px; }
img { display: block; max-width: 100%; }
a { color: var(--ui-brand-hover); }
h1, h2, h3 { letter-spacing: -.01em; }

/* ---------- Store header ---------- */
.store-header { background: var(--ui-surface); box-shadow: var(--ui-shadow); }
.store-cover {
  height: 120px;
  background:
    radial-gradient(circle at 30% 120%, rgba(232, 83, 31, .55), transparent 55%),
    radial-gradient(circle at 90% -20%, rgba(255, 180, 60, .35), transparent 50%),
    var(--ui-ink);
}
.store-cover { position: relative; overflow: hidden; }
/* Banner: always 3:1 and centered (up to 1080px); on wide screens a blurred copy fills the sides. */
.store-cover.has-image { height: auto; display: flex; justify-content: center; background: var(--ui-ink); }
.store-cover__bg { position: absolute; inset: -40px; width: calc(100% + 80px); height: calc(100% + 80px); object-fit: cover; filter: blur(28px) brightness(.8) saturate(1.25); transform: scale(1.1); }
.store-cover__img { position: relative; display: block; width: min(100%, 1080px); aspect-ratio: 3 / 1; object-fit: cover; box-shadow: 0 0 48px rgba(0, 0, 0, .35); }
/* Soft fade so the logo and the white card blend with any photo. */
.store-cover.has-image::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, .3)); }
.store-info { max-width: var(--max); margin: 0 auto; padding: 0 16px 16px; text-align: center; }
.store-logo {
  position: relative; z-index: 1; width: 88px; height: 88px; margin: -44px auto 8px; border-radius: 50%; color: #fff;
  background: var(--ui-ink); border: 4px solid var(--ui-surface); overflow: hidden;
  display: grid; place-items: center; box-shadow: var(--ui-shadow);
}
.store-logo img { width: 100%; height: 100%; object-fit: cover; }
.store-logo .icon { width: 44px; height: 44px; }
.store-info h1 { margin: 0; font-size: 1.5rem; }
.store-meta { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 6px; flex-wrap: wrap; }
.store-address { margin: 4px 0 0; color: var(--ui-muted); font-size: .9rem; }
.store-conditions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 10px 0 14px; }
.store-fulfillment { max-width: 360px; margin: 0 auto; }
.fulfillment-only { margin: 0; }
.hours-list { list-style: none; margin: 0; padding: 0; }
.hours-list li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--ui-line); }
.hours-list li:last-child { border-bottom: 0; }
.menu-notice { max-width: var(--max); margin: 12px auto 0; padding: 0 16px; }

/* ---------- Search + category nav ---------- */
.menu-tools { position: sticky; top: 0; z-index: 5; background: var(--ui-bg); padding-top: 12px; }
.menu-search { max-width: calc(var(--max) - 32px); margin: 0 16px; }
@media (min-width: 752px) { .menu-search { margin: 0 auto; } }
.menu-tools .ui-field { margin-bottom: 0; }
.category-nav { display: flex; gap: 8px; overflow-x: auto; padding: 10px 16px; max-width: var(--max); margin: 0 auto; scrollbar-width: none; }
.category-nav::-webkit-scrollbar { display: none; }

/* ---------- Menu ---------- */
.menu { max-width: var(--max); margin: 0 auto; padding: 0 16px 24px; }
.menu-section { scroll-margin-top: 124px; }
.menu-section h2 { font-size: 1.2rem; margin: 20px 0 10px; }
.product-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.product-card { gap: 12px; align-items: stretch; }
.product-text { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.product-name { font-weight: 700; font-size: 1rem; }
.product-desc { color: var(--ui-muted); font-size: .88rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-price { margin-top: auto; padding-top: 4px; font-weight: 750; }
.product-thumb { flex: none; width: 104px; height: 104px; border-radius: 12px; overflow: hidden; background: var(--ui-ink); color: #8b7f76; display: grid; place-items: center; }
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-placeholder { width: 44px; height: 44px; }
.empty { text-align: center; color: var(--ui-muted); padding: 40px 0; }

/* ---------- Cart bar ---------- */
.cart-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--ui-bg) 35%); }
.cart-bar__btn { max-width: calc(var(--max) - 32px); margin: 0 auto; justify-content: space-between; box-shadow: 0 6px 20px rgba(232, 83, 31, .35); }
.cart-bar__count { order: -1; background: rgba(255, 255, 255, .25); border-radius: 8px; min-width: 28px; padding: 3px 8px; }
.cart-bar__btn .ui-btn__label { flex: 1; text-align: left; }

/* ---------- Product sheet ---------- */
.sheet-image { background: var(--ui-ink); color: #8b7f76; aspect-ratio: 4 / 3; display: grid; place-items: center; flex: none; }
.sheet-image img { width: 100%; height: 100%; object-fit: cover; }
.sheet-image .icon { width: 96px; height: 96px; }
.sheet-body h2 { margin: 6px 0; font-size: 1.3rem; }
.sheet-desc { margin: 0 0 8px; }
.sheet-price { margin: 0 0 8px; font-weight: 750; font-size: 1.1rem; color: var(--ui-text) !important; }
.sheet-footer { justify-content: space-between; }
.sheet-add { flex: 1; justify-content: space-between; }
.option-group { border: 0; padding: 0; margin: 16px 0 0; min-width: 0; }
.option-group__head { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; padding: 10px 12px; margin-bottom: 2px; background: var(--ui-surface-2); border-radius: 10px; font-weight: 700; }
.option-group.is-error .option-group__head { background: var(--ui-danger-soft); }

/* ---------- Cart lines ---------- */
.cart-lines { list-style: none; margin: 0; padding: 0; }
.cart-line { display: flex; gap: 12px; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--ui-line); }
.cart-line:last-child { border-bottom: 0; }
.cart-line__main { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; }
.cart-line__options small { display: block; color: var(--ui-muted); }
.cart-line.has-problem strong { text-decoration: line-through; color: var(--ui-muted); }
.cart-line__actions { display: flex; gap: 14px; margin-top: 4px; }
.cart-line__actions .is-muted { --btn-fg: var(--ui-muted); }
.cart-line__side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.cart-line__price { font-weight: 750; }
.cart-summary { padding-top: 8px; }
.row { display: flex; justify-content: space-between; margin: 6px 0; }
.row.total { font-weight: 800; font-size: 1.1rem; }
.cart-summary .ui-alert, .totals .ui-alert { margin: 10px 0 0; }

/* ---------- Checkout ---------- */
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--ui-surface); box-shadow: var(--ui-shadow); }
.topbar h1 { margin: 0; font-size: 1.15rem; }
.checkout, .confirmation { max-width: var(--max); margin: 0 auto; padding: 12px 16px 40px; }
.checkout > .ui-alert { margin-top: 4px; }
.checkout-form { display: grid; gap: 12px; }
.card { background: var(--ui-surface); border-radius: 16px; padding: 16px; box-shadow: var(--ui-shadow); }
.card h2 { margin: 0 0 12px; font-size: 1.05rem; }
.choices { display: grid; gap: 8px; }
.hint { color: var(--ui-muted); font-size: .85rem; margin: 8px 0 0; }
.center { text-align: center; }
.checkout-submit { position: sticky; bottom: 0; padding: 12px 0 calc(8px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--ui-bg) 30%); }

/* ---------- Confirmation ---------- */
.confirmation { text-align: center; padding-top: 40px; display: grid; gap: 14px; justify-items: center; }
.confirmation > * { width: 100%; }
.confirmation > .ui-btn--link { width: auto; }
.confirmation h1 { margin: 0; font-size: 1.4rem; }
.confirmation > p { margin: 0; color: var(--ui-muted); }
.confirm-icon { width: 72px !important; height: 72px; border-radius: 50%; background: var(--ui-success-soft); color: var(--ui-success); display: grid; place-items: center; }
.confirm-icon .icon { width: 36px; height: 36px; }
.receipt { text-align: left; }
.receipt-meta { margin: 0 0 4px; color: var(--ui-muted); }
.receipt-items { list-style: none; margin: 12px 0; padding: 12px 0; border-top: 1px solid var(--ui-line); border-bottom: 1px solid var(--ui-line); display: grid; gap: 10px; }
.receipt-items li { display: flex; justify-content: space-between; gap: 12px; }
.receipt-items small { display: block; color: var(--ui-muted); }
