/* Wok On Waves · online ordering (order.html, order-track.html).
   Builds on css/styles.css tokens; kept separate so the main stylesheet is untouched. */

html[data-lang="en"] .lang-pt { display: none; }
html[data-lang="pt"] .lang-en { display: none; }

.order-main { background: var(--ivory); padding: 32px 0 120px; min-height: 60vh; }
.order-main [hidden] { display: none !important; }

/* Availability strip */
.order-strip { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-bottom: 28px; }
.order-pill { display: inline-flex; align-items: center; gap: 10px; padding: 10px 18px; border-radius: var(--r-pill); background: var(--white); box-shadow: var(--sh-sm); font-size: 0.875rem; color: var(--ink-mid); max-width: 100%; }
.order-pill b { color: var(--ink); font-weight: 600; }
.order-pill .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted-light); flex-shrink: 0; }
.order-pill.is-open .dot { background: var(--sea-light); box-shadow: 0 0 0 4px rgba(107,168,152,0.2); }
.order-pill.is-paused .dot { background: var(--brass); }

/* Coming soon / notices */
.order-card { background: var(--white); border-radius: var(--r-md); box-shadow: var(--sh-md); padding: 32px; }
.order-soon { max-width: 640px; margin: 0 auto; text-align: center; padding: 48px 32px; }
.order-soon h2 { font-family: var(--font-display); font-size: 2.2rem; font-weight: 500; margin-bottom: 12px; }
.order-soon p { color: var(--ink-mid); margin-bottom: 22px; }
.order-soon .order-phone { display: inline-block; font-family: var(--font-display); font-size: 1.9rem; color: var(--sea-dark); margin-bottom: 26px; }
.order-soon .order-links { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn-ghost { background: transparent; color: var(--sea-dark); border: 1.5px solid var(--sand-dark); }
.btn-ghost:hover { border-color: var(--sea); }

/* Layout: menu + basket */
.order-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 32px; align-items: start; }
@media (max-width: 980px) { .order-layout { grid-template-columns: minmax(0, 1fr); } }
.order-layout > * { min-width: 0; }
@media (max-width: 400px) { .order-items { grid-template-columns: minmax(0, 1fr); } }

.order-cats { position: sticky; top: calc(var(--nav-h) + 8px); z-index: 20; display: flex; gap: 6px; overflow-x: auto; padding: 10px 4px; margin-bottom: 18px;
  background: rgba(250,248,242,0.96); scrollbar-width: none; }
.order-cats::-webkit-scrollbar { display: none; }
/* With the basket beside the menu (>980px) the menu column is too narrow for
   every category on one line: the row used to be cut off at the basket's edge
   with no visible scrollbar ("the basket overlaps the categories"). Wrap
   instead, so every category is always visible. */
@media (min-width: 981px) {
  .order-cats { flex-wrap: wrap; overflow-x: visible; row-gap: 8px;
                background: #FAF8F2; box-shadow: 0 6px 10px -8px rgba(28,43,56,0.25); }
  .order-section { scroll-margin-top: calc(var(--nav-h) + 120px); }
}
/* Single column (≤980px): keep the swipeable row, with a fade on the right
   edge so it's clear more categories follow. */
@media (max-width: 980px) {
  .order-cats { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent);
                mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); padding-right: 28px; }
}
.order-cat { flex-shrink: 0; padding: 9px 18px; border-radius: var(--r-pill); border: 1.5px solid var(--sand-dark); font-size: 13px; font-weight: 500; color: var(--muted); background: transparent; }
.order-cat:hover { color: var(--sea-dark); }
.order-cat.active { background: var(--sea-dark); border-color: var(--sea-dark); color: var(--white); }

.order-section { scroll-margin-top: calc(var(--nav-h) + 70px); margin-bottom: 34px; }
.order-section h2 { font-family: var(--font-display); font-size: 1.7rem; font-weight: 500; margin-bottom: 14px; color: var(--ink); }
.order-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.order-item { background: var(--white); border-radius: var(--r-sm); padding: 16px 18px; box-shadow: var(--sh-sm); display: flex; flex-direction: column; gap: 8px; }
.order-item__head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.order-item__name { font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; line-height: 1.2; }
.order-item__price { font-weight: 600; white-space: nowrap; color: var(--price); }
.cart-line__total, .cart-sum span:last-child { color: var(--price); }
.order-item__desc { font-size: 0.82rem; color: var(--muted); line-height: 1.5; }
.order-tags { display: flex; gap: 5px; }
.order-tag { font-size: 10px; font-weight: 700; letter-spacing: 0.06em; padding: 2px 7px; border-radius: 4px; background: var(--sea-pale); color: var(--sea-dark); }
.order-tag--spicy { background: #FDECEA; color: var(--red); }
.order-item__row { display: flex; gap: 8px; align-items: center; margin-top: auto; }
.order-item__row select { flex: 1; min-width: 0; padding: 9px 10px; border: 1.5px solid var(--sand-dark); border-radius: var(--r-sm); background: var(--ivory); font-size: 16px; }
.order-add { padding: 10px 18px; border-radius: var(--r-pill); background: var(--sea); color: var(--white); font-weight: 600; font-size: 0.85rem; white-space: nowrap; }
.order-add:hover { background: var(--sea-dark); }
.order-add:disabled { background: var(--muted-light); cursor: not-allowed; }
.order-added { font-size: 0.75rem; color: var(--sea); min-height: 1em; }

/* Basket */
.order-cart { position: sticky; top: calc(var(--nav-h) + 16px); }
@media (max-width: 980px) { .order-cart { position: static; } }
.order-cart h2 { font-family: var(--font-display); font-size: 1.6rem; font-weight: 500; margin-bottom: 12px; }
.order-cart .order-card { padding: 22px; }
.cart-empty { color: var(--muted); font-size: 0.9rem; }
.cart-lines { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; max-height: 46vh; overflow-y: auto; }
.cart-line { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; font-size: 0.88rem; border-bottom: 1px solid var(--sand); padding-bottom: 10px; }
.cart-line__name { font-weight: 500; }
.cart-line__variant { color: var(--muted); font-size: 0.78rem; }
.cart-line__total { font-weight: 600; text-align: right; }
.cart-line .qty { justify-self: start; }
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--sand-dark); border-radius: var(--r-pill); overflow: hidden; }
.qty button { width: 34px; height: 32px; font-size: 1.1rem; color: var(--sea-dark); }
.qty button:hover { background: var(--sand); }
.qty span { min-width: 26px; text-align: center; font-weight: 600; font-size: 0.88rem; }
.cart-sum { display: flex; justify-content: space-between; font-size: 0.9rem; color: var(--ink-mid); padding: 3px 0; }
.cart-sum.total { font-weight: 700; color: var(--ink); font-size: 1.05rem; border-top: 1px solid var(--sand-dark); margin-top: 6px; padding-top: 10px; }
.cart-note { font-size: 0.78rem; color: var(--muted); margin-top: 10px; line-height: 1.5; }
.order-btn-block { width: 100%; justify-content: center; margin-top: 14px; }
.order-btn-block:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* Mobile basket bar */
.order-bar { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 60; display: none; }
.order-bar button { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 15px 22px; border-radius: var(--r-pill); background: var(--sea-dark); color: var(--white); font-weight: 600; box-shadow: var(--sh-lg); font-size: 0.95rem; }
@media (max-width: 980px) { .order-bar.has-items { display: block; } }

/* Checkout */
.order-checkout { max-width: 760px; margin: 36px auto 0; scroll-margin-top: calc(var(--nav-h) + 16px); }
.order-checkout h2 { font-family: var(--font-display); font-size: 2rem; font-weight: 500; margin-bottom: 18px; }
.co-step { border: none; padding: 0; margin: 0 0 26px; }
.co-step legend { font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--brass); margin-bottom: 10px; }
.co-choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.co-option { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1.5px solid var(--sand-dark); border-radius: var(--r-sm); background: var(--ivory); cursor: pointer; }
.co-option input { margin-top: 4px; accent-color: var(--sea); }
.co-option b { display: block; font-size: 0.95rem; }
.co-option small { color: var(--muted); font-size: 0.78rem; }
.co-option.is-disabled { opacity: 0.55; cursor: not-allowed; }
.co-option:has(input:checked) { border-color: var(--sea); background: var(--sea-pale); }
.co-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.co-grid .full { grid-column: 1 / -1; }
@media (max-width: 600px) { .co-grid { grid-template-columns: 1fr; } }
.co-when { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.co-when .co-field { margin-bottom: 0; }
@media (max-width: 420px) { .co-when { grid-template-columns: 1fr; } }
.co-field label { display: block; font-size: 0.78rem; font-weight: 600; color: var(--ink-mid); margin-bottom: 5px; }
.co-field input, .co-field select, .co-field textarea { width: 100%; padding: 12px 14px; border: 1.5px solid var(--sand-dark); border-radius: var(--r-sm); background: var(--white); font-size: 16px; color: var(--ink); }
.co-field input:focus, .co-field select:focus, .co-field textarea:focus { outline: none; border-color: var(--sea); box-shadow: 0 0 0 3px rgba(59,109,100,0.12); }
.co-field textarea { min-height: 76px; resize: vertical; }
.co-hint { font-size: 0.76rem; color: var(--muted); margin-top: 4px; }
.co-check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.86rem; color: var(--ink-mid); margin: 8px 0; }
.co-check input { margin-top: 4px; accent-color: var(--sea); width: 17px; height: 17px; flex-shrink: 0; }
.co-area { background: var(--sea-pale); border-radius: var(--r-sm); padding: 12px 14px; font-size: 0.85rem; color: var(--sea-dark); margin-bottom: 12px; }
.co-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.order-alert { border-radius: var(--r-sm); padding: 12px 16px; font-size: 0.9rem; margin: 12px 0; background: #FDECEA; color: #8E2A1F; }
.order-alert.info { background: var(--brass-pale); color: #7A5A12; }
.co-summary { background: var(--sand); border-radius: var(--r-sm); padding: 16px 18px; margin: 18px 0; }

/* Confirmation + tracking */
.order-done { max-width: 640px; margin: 0 auto; text-align: center; }
.order-done .check { width: 64px; height: 64px; border-radius: 50%; background: var(--sea-pale); color: var(--sea); display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; font-size: 30px; }
.order-done h2, .track h2 { font-family: var(--font-display); font-size: 2.1rem; font-weight: 500; margin-bottom: 8px; }
.order-ref { font-family: var(--font-display); font-size: 1.5rem; color: var(--brass); margin: 10px 0 18px; letter-spacing: 0.04em; }
.track { max-width: 720px; margin: 0 auto; }
.track-status { font-size: 1.05rem; color: var(--ink-mid); margin-bottom: 22px; }
.timeline { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 0 0 28px; padding: 0; }
.timeline li { text-align: center; font-size: 0.74rem; color: var(--muted); position: relative; }
.timeline li::before { content: ''; position: absolute; top: 15px; left: -50%; width: 100%; height: 2px; background: var(--sand-dark); z-index: 0; }
.timeline li:first-child::before { display: none; }
.timeline .bubble { width: 32px; height: 32px; border-radius: 50%; background: var(--sand); color: var(--muted); display: flex; align-items: center; justify-content: center; margin: 0 auto 6px; font-weight: 600; position: relative; z-index: 1; }
.timeline li.done { color: var(--ink); }
.timeline li.done .bubble { background: var(--sea); color: var(--white); }
.timeline li.done::before { background: var(--sea); }
.timeline li.current .bubble { box-shadow: 0 0 0 5px rgba(59,109,100,0.18); }
.timeline li.skipped .bubble { background: var(--sand); color: var(--muted-light); }
.timeline time { display: block; font-size: 0.7rem; color: var(--muted); }
@media (max-width: 520px) { .timeline li { font-size: 0.66rem; } .timeline .bubble { width: 28px; height: 28px; } }
.track-rows { text-align: left; background: var(--white); border-radius: var(--r-sm); box-shadow: var(--sh-sm); padding: 18px 20px; margin-bottom: 20px; }
.track-row { display: flex; justify-content: space-between; gap: 16px; font-size: 0.9rem; padding: 5px 0; }
.track-row span:first-child { color: var(--muted); }
.track-row span:last-child { text-align: right; font-weight: 500; }
.track-stopped { background: #FDECEA; color: #8E2A1F; border-radius: var(--r-sm); padding: 14px 18px; margin-bottom: 20px; }
.btn-danger-outline { background: transparent; color: var(--red); border: 1.5px solid var(--red); }
.btn-danger-outline:hover { background: var(--red); color: var(--white); }
.track-refresh { font-size: 0.75rem; color: var(--muted); margin-top: 16px; }

/* Coupon code */
.co-coupon { margin: 18px 0 0; }
.co-coupon__row { display: flex; gap: 8px; }
.co-coupon__row input { flex: 1; min-width: 0; text-transform: uppercase; letter-spacing: 0.04em; }
.co-coupon__row input[readonly] { background: var(--sand); }
.co-coupon__row .btn { flex: none; padding-left: 18px; padding-right: 18px; }
.co-coupon__msg { margin: 6px 0 0; font-size: 0.85rem; color: #8E2A1F; min-height: 0; }
.co-coupon__msg:empty { display: none; }
.co-coupon__msg.ok { color: var(--sea-dark); }
.cart-sum.discount span { color: var(--sea-dark); }
