/* ============================================================
   Al Waha — QR Menu Theme 2026
   Oman restaurant · AR/EN · Light/Dark · Mobile-first
   ============================================================ */

:root {
  --font-display: "Bricolage Grotesque", "Noto Sans Arabic", system-ui, sans-serif;
  --font-body: "Manrope", "Noto Sans Arabic", system-ui, sans-serif;

  --teal: #0a6b6c;
  --teal-deep: #064849;
  --copper: #c17a3a;
  --copper-soft: #d4925a;
  --sand: #f3ebe0;
  --sand-deep: #e5d6c4;
  --ink: #1a1714;
  --ink-muted: #5c534a;
  --surface: #fffcf8;
  --surface-elevated: #ffffff;
  --border: rgba(26, 23, 20, 0.1);
  --shadow: 0 12px 40px rgba(26, 23, 20, 0.08);
  --shadow-lg: 0 24px 64px rgba(26, 23, 20, 0.14);
  --success: #2d6a4f;
  --danger: #b33a3a;
  --radius: 1.25rem;
  --radius-sm: 0.75rem;
  --radius-pill: 999px;
  --header-h: 4.25rem;
  --bottom-bar-h: 5.5rem;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --glass: rgba(255, 252, 248, 0.72);
  --glass-border: rgba(255, 255, 255, 0.45);
  --hero-glow: radial-gradient(ellipse 80% 60% at 70% 20%, rgba(193, 122, 58, 0.28), transparent 55%),
    radial-gradient(ellipse 60% 50% at 10% 80%, rgba(10, 107, 108, 0.22), transparent 50%),
    linear-gradient(165deg, #f7f0e6 0%, #ebe0d2 45%, #dfecec 100%);
  --card-overlay: linear-gradient(180deg, transparent 40%, rgba(26, 23, 20, 0.72) 100%);
  color-scheme: light;
}

[data-theme="dark"] {
  --teal: #3db5b6;
  --teal-deep: #1a8a8b;
  --copper: #e09a55;
  --copper-soft: #f0b57a;
  --sand: #1c1a18;
  --sand-deep: #2a2622;
  --ink: #f4efe8;
  --ink-muted: #a89f94;
  --surface: #12100e;
  --surface-elevated: #1e1b18;
  --border: rgba(244, 239, 232, 0.1);
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.5);
  --glass: rgba(18, 16, 14, 0.78);
  --glass-border: rgba(255, 255, 255, 0.06);
  --hero-glow: radial-gradient(ellipse 80% 60% at 70% 15%, rgba(224, 154, 85, 0.18), transparent 55%),
    radial-gradient(ellipse 60% 50% at 5% 85%, rgba(61, 181, 182, 0.14), transparent 50%),
    linear-gradient(165deg, #0e0c0a 0%, #181512 50%, #0f1616 100%);
  --card-overlay: linear-gradient(180deg, transparent 35%, rgba(0, 0, 0, 0.78) 100%);
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--surface);
  min-height: 100dvh;
  overflow-x: hidden;
  transition: background 0.35s var(--ease), color 0.35s var(--ease);
}

body.rtl {
  font-family: "Noto Sans Arabic", var(--font-body);
}

h1, h2, h3, h4, .brand-name, .display-font {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

body.rtl h1,
body.rtl h2,
body.rtl h3,
body.rtl .brand-name,
body.rtl .display-font {
  font-family: "Noto Sans Arabic", var(--font-display);
  letter-spacing: 0;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--teal);
  text-decoration: none;
}

button {
  font-family: inherit;
}

/* ---- Three.js canvas ---- */
#three-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.55;
}

[data-theme="dark"] #three-bg {
  opacity: 0.4;
}

.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  padding-bottom: calc(var(--bottom-bar-h) + env(safe-area-inset-bottom, 0px));
}

/* ---- Views ---- */
.view {
  display: none;
  opacity: 0;
  min-height: calc(100dvh - var(--header-h));
}

.view.active {
  display: block;
}

/* ---- Top bar ---- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid var(--glass-border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.brand-mark {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.85rem;
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-deep) 55%, var(--copper) 100%);
  display: grid;
  place-items: center;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 6px 20px rgba(10, 107, 108, 0.35);
  overflow: hidden;
}

.brand-mark.has-logo {
  width: auto;
  max-width: min(9.5rem, 42vw);
  height: 2.5rem;
  padding: 0;
  background: transparent;
  box-shadow: none;
  border: none;
  border-radius: 0;
  overflow: visible;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-mark.has-logo img {
  width: auto;
  height: 2.5rem;
  max-width: min(9.5rem, 42vw);
  object-fit: contain;
  object-position: left center;
  display: block;
}

.brand-mark svg {
  width: 1.25rem;
  height: 1.25rem;
}

.brand-text {
  min-width: 0;
}

.brand-name {
  font-size: 1.15rem;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-tag {
  margin: 0;
  font-size: 0.7rem;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.icon-btn {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface-elevated);
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.2s var(--ease), background 0.2s, border-color 0.2s;
}

.icon-btn:hover,
.icon-btn:focus-visible {
  transform: translateY(-1px);
  border-color: var(--teal);
  outline: none;
}

.icon-btn svg {
  width: 1.1rem;
  height: 1.1rem;
}

.lang-btn {
  width: auto;
  padding: 0 0.85rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

/* ---- Hero ---- */
.home-hero {
  position: relative;
  padding: 1.5rem 1rem 1.25rem;
  background: var(--hero-glow);
  overflow: hidden;
}

.home-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 3rem;
  background: linear-gradient(to bottom, transparent, var(--surface));
  pointer-events: none;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--teal);
  margin-bottom: 0.5rem;
}

.hero-eyebrow::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--copper);
  box-shadow: 0 0 0 3px rgba(193, 122, 58, 0.25);
}

.hero-title {
  font-size: clamp(1.75rem, 5.5vw, 2.6rem);
  margin: 0 0 0.4rem;
  max-width: 16ch;
}

.hero-sub {
  margin: 0 0 1.1rem;
  color: var(--ink-muted);
  font-size: 0.95rem;
  max-width: 32ch;
}

.search-wrap {
  position: relative;
  max-width: 28rem;
}

.search-wrap svg {
  position: absolute;
  top: 50%;
  inset-inline-start: 1rem;
  transform: translateY(-50%);
  width: 1.15rem;
  height: 1.15rem;
  color: var(--ink-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 3.15rem;
  padding-inline: 2.85rem 1rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface-elevated);
  color: var(--ink);
  font-size: 0.95rem;
  box-shadow: var(--shadow);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(10, 107, 108, 0.15), var(--shadow);
}

.search-input::placeholder {
  color: var(--ink-muted);
}

/* ---- Categories ---- */
.cat-rail {
  display: flex;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  position: sticky;
  top: var(--header-h);
  z-index: 90;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(12px);
}

.cat-rail::-webkit-scrollbar {
  display: none;
}

.cat-chip {
  flex-shrink: 0;
  height: 2.35rem;
  padding: 0 1rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface-elevated);
  color: var(--ink-muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.25s var(--ease);
}

.cat-chip.active,
.cat-chip:hover {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

/* ---- Product grid ---- */
.menu-section {
  padding: 0.5rem 1rem 1.5rem;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.section-head h2 {
  font-size: 1.15rem;
  margin: 0;
}

.section-head span {
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.product-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 480px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
  }

  .home-hero,
  .menu-section,
  .cat-rail,
  .app-header {
    padding-left: max(1.5rem, calc((100% - 72rem) / 2 + 1.5rem));
    padding-right: max(1.5rem, calc((100% - 72rem) / 2 + 1.5rem));
  }
}

@media (min-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.product-card {
  position: relative;
  border: none;
  padding: 0;
  background: transparent;
  text-align: start;
  cursor: pointer;
  border-radius: var(--radius);
  overflow: hidden;
  color: inherit;
  width: 100%;
}

.product-card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--copper) 35%, transparent), transparent 50%),
    radial-gradient(circle at 70% 70%, color-mix(in srgb, var(--teal) 40%, transparent), transparent 55%),
    var(--sand-deep);
}

.product-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}

.product-card:hover .product-card-media img,
.product-card:focus-visible .product-card-media img {
  transform: scale(1.06);
}

.product-card-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--card-overlay);
  opacity: 0.85;
}

.product-card-body {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 1;
  padding: 1rem;
  color: #fff;
}

.product-badge {
  position: absolute;
  top: 0.75rem;
  inset-inline-start: 0.75rem;
  z-index: 2;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.92);
  color: var(--teal-deep);
}

[data-theme="dark"] .product-badge {
  background: rgba(30, 27, 24, 0.9);
  color: var(--copper);
}

.product-card h3 {
  font-size: 1.05rem;
  margin: 0 0 0.2rem;
  color: #fff;
}

.product-card .price {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--copper-soft);
}

.product-card .price small {
  font-weight: 500;
  opacity: 0.85;
  margin-inline-end: 0.2rem;
}

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--ink-muted);
}

.empty-state svg {
  width: 3rem;
  height: 3rem;
  margin: 0 auto 1rem;
  opacity: 0.5;
}

/* ---- Product detail ---- */
.product-hero {
  position: relative;
  height: min(52vw, 22rem);
  min-height: 14rem;
  background: var(--sand-deep);
  overflow: hidden;
}

.product-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-hero-actions {
  position: absolute;
  top: 1rem;
  inset-inline-start: 1rem;
  inset-inline-end: 1rem;
  display: flex;
  justify-content: space-between;
  z-index: 2;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  height: 2.5rem;
  padding: 0 1rem;
  border-radius: var(--radius-pill);
  border: none;
  background: var(--glass);
  backdrop-filter: blur(12px);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}

[dir="rtl"] .back-btn svg {
  transform: scaleX(-1);
}

.product-detail {
  margin-top: -1.75rem;
  position: relative;
  z-index: 2;
  background: var(--surface);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 1.5rem 1rem 2rem;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.06);
}

@media (min-width: 768px) {
  .product-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    max-width: 72rem;
    margin: 0 auto;
    min-height: calc(100dvh - var(--header-h));
  }

  .product-hero {
    height: auto;
    min-height: calc(100dvh - var(--header-h));
    border-radius: 0;
  }

  .product-detail {
    margin-top: 0;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 2.5rem;
    box-shadow: none;
  }
}

.product-detail h1 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  margin: 0 0 0.35rem;
}

.product-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.product-price {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--teal);
}

.product-price small {
  font-size: 0.75rem;
  font-weight: 600;
  margin-inline-end: 0.25rem;
}

.pill-tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--copper) 18%, transparent);
  color: var(--copper);
}

.product-desc {
  color: var(--ink-muted);
  margin: 0 0 1.5rem;
  font-size: 0.95rem;
}

.block-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  margin: 0 0 0.75rem;
}

.addons-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 1.5rem;
}

.addon-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-elevated);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  user-select: none;
}

.addon-item:has(input:checked) {
  border-color: var(--teal);
  background: color-mix(in srgb, var(--teal) 10%, var(--surface-elevated));
}

.addon-item input {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--teal);
  flex-shrink: 0;
}

.addon-item .addon-name {
  flex: 1;
  font-weight: 600;
  font-size: 0.9rem;
}

.addon-item .addon-price {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--copper);
}

.qty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.qty-control {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.25rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface-elevated);
}

.qty-control button {
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  font-size: 1.15rem;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.qty-control button:hover {
  background: color-mix(in srgb, var(--teal) 12%, transparent);
}

.qty-control span {
  min-width: 2rem;
  text-align: center;
  font-weight: 700;
}

.btn-primary-theme {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  height: 3.25rem;
  padding: 0 1.5rem;
  border: none;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-deep) 100%);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(10, 107, 108, 0.35);
  transition: transform 0.2s var(--ease), box-shadow 0.2s;
}

.btn-primary-theme:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(10, 107, 108, 0.4);
}

.btn-primary-theme:active {
  transform: translateY(0);
}

.btn-secondary-theme {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  height: 3.25rem;
  padding: 0 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface-elevated);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.btn-secondary-theme:hover {
  border-color: var(--teal);
}

.btn-ghost {
  background: transparent;
  border: none;
  color: var(--teal);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0.5rem;
}

/* ---- Bottom order bar ---- */
.powered-by {
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted, #6b7280);
  padding: 1rem 1rem 0.35rem;
  margin: 0;
}

.powered-by a {
  color: var(--teal, #0a6b6c);
  font-weight: 700;
  text-decoration: none;
}

.powered-by a:hover {
  text-decoration: underline;
}

.order-bar {
  position: fixed;
  bottom: 0;
  inset-inline: 0;
  z-index: 200;
  padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
  background: var(--glass);
  backdrop-filter: blur(18px);
  border-top: 1px solid var(--glass-border);
  transform: translateY(110%);
  transition: transform 0.4s var(--ease);
}

.order-bar.visible {
  transform: translateY(0);
}

.order-bar-inner {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  max-width: 40rem;
  margin: 0 auto;
}

.order-bar-info {
  flex: 1;
  min-width: 0;
}

.order-bar-info .label {
  font-size: 0.7rem;
  color: var(--ink-muted);
  margin: 0;
}

.order-bar-info .total {
  font-size: 1.1rem;
  font-weight: 800;
  margin: 0;
}

.order-bar-btn {
  flex-shrink: 0;
  height: 3rem;
  padding: 0 1.35rem;
  border: none;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--copper) 0%, #a85f28 100%);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  box-shadow: 0 8px 24px rgba(193, 122, 58, 0.35);
}

.cart-badge {
  display: inline-grid;
  place-items: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.35rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.25);
  font-size: 0.75rem;
  font-weight: 800;
}

/* ---- Order / Cart sheet ---- */
.sheet-page {
  max-width: 36rem;
  margin: 0 auto;
  padding: 1.25rem 1rem 2rem;
}

.page-title {
  font-size: 1.5rem;
  margin: 0 0 0.25rem;
}

.page-sub {
  color: var(--ink-muted);
  margin: 0 0 1.5rem;
  font-size: 0.9rem;
}

.cart-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.cart-item {
  display: grid;
  grid-template-columns: 4.5rem 1fr auto;
  gap: 0.85rem;
  padding: 0.85rem;
  border-radius: var(--radius);
  background: var(--surface-elevated);
  border: 1px solid var(--border);
  align-items: start;
}

.cart-item img {
  width: 4.5rem;
  height: 4.5rem;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.cart-item h4 {
  font-size: 0.95rem;
  margin: 0 0 0.2rem;
}

.cart-item .addons-text {
  font-size: 0.75rem;
  color: var(--ink-muted);
  margin: 0 0 0.4rem;
}

.cart-item-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cart-item .line-price {
  font-weight: 800;
  color: var(--teal);
  font-size: 0.9rem;
  white-space: nowrap;
}

.cart-item .remove-btn {
  border: none;
  background: transparent;
  color: var(--danger);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.summary-box {
  padding: 1.15rem;
  border-radius: var(--radius);
  background: var(--hero-glow);
  border: 1px solid var(--border);
  margin-bottom: 1.25rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  color: var(--ink-muted);
}

.summary-row.total {
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px dashed var(--border);
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 0;
}

/* ---- Forms ---- */
.form-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.form-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--ink-muted);
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  height: 3rem;
  padding: 0 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-elevated);
  color: var(--ink);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-field textarea {
  height: auto;
  min-height: 5rem;
  padding: 0.85rem 1rem;
  resize: vertical;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(10, 107, 108, 0.12);
}

.form-field.invalid input,
.form-field.invalid select,
.form-field.invalid textarea {
  border-color: var(--danger);
}

.form-hint {
  font-size: 0.75rem;
  color: var(--danger);
  margin: 0.3rem 0 0;
  display: none;
}

.form-field.invalid .form-hint {
  display: block;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 480px) {
  .form-grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

.pickup-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.pickup-option {
  position: relative;
  cursor: pointer;
}

.pickup-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pickup-option span {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 1rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-elevated);
  text-align: center;
  font-weight: 700;
  font-size: 0.85rem;
  transition: border-color 0.2s, background 0.2s;
}

.pickup-option svg {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--teal);
}

.pickup-option input:checked + span {
  border-color: var(--teal);
  background: color-mix(in srgb, var(--teal) 10%, var(--surface-elevated));
}

.car-fields {
  display: none;
}

.car-fields.show {
  display: grid;
}

/* ---- Checkout success ---- */
.success-panel {
  text-align: center;
  padding: 2.5rem 1rem;
}

.success-icon {
  width: 5rem;
  height: 5rem;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), var(--teal-deep));
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 16px 40px rgba(10, 107, 108, 0.35);
}

.success-icon svg {
  width: 2.25rem;
  height: 2.25rem;
}

.order-number {
  display: inline-block;
  margin: 0.75rem 0 1.5rem;
  padding: 0.5rem 1.15rem;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--copper) 15%, transparent);
  color: var(--copper);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.06em;
}

.receipt-card {
  text-align: start;
  padding: 1.15rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-elevated);
  margin-bottom: 1.5rem;
}

.receipt-card h3 {
  font-size: 0.85rem;
  margin: 0 0 0.75rem;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.receipt-line {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

/* ---- Toast ---- */
.toast-stack {
  position: fixed;
  top: calc(var(--header-h) + 0.75rem);
  inset-inline: 1rem;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
  max-width: 22rem;
  margin-inline: auto;
}

.toast {
  pointer-events: auto;
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--surface);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(-8px);
}

[data-theme="dark"] .toast {
  background: var(--surface-elevated);
  color: var(--ink);
  border: 1px solid var(--border);
}

/* ---- Utilities ---- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.step-indicator {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.step-dot {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink-muted);
}

.step-dot.active {
  color: var(--teal);
}

.step-dot .num {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--border);
  font-size: 0.65rem;
}

.step-dot.active .num {
  background: var(--teal);
  color: #fff;
}

.step-line {
  flex: 1;
  height: 2px;
  min-width: 1rem;
  background: var(--border);
  max-width: 2.5rem;
}

.actions-row {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

@media (min-width: 480px) {
  .actions-row {
    flex-direction: row;
  }

  .actions-row .btn-primary-theme,
  .actions-row .btn-secondary-theme {
    flex: 1;
  }
}

.hidden {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
