/* Digital Menu — customer-facing site. Mobile-first, no external framework. */

:root {
  --color-primary: #2563eb;
  --color-primary-dark: #1d4ed8;
  --color-bg: #f6f7fb;
  --color-surface: #ffffff;
  --color-text: #14171f;
  --color-text-muted: #6b7280;
  --color-border: #e8e9ef;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow: 0 4px 14px rgba(16, 24, 40, 0.08), 0 1px 3px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.14), 0 2px 8px rgba(16, 24, 40, 0.06);
  --header-safe-top: env(safe-area-inset-top, 0px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }

/* Elements toggled via the `hidden` JS property/attribute must actually stay
   hidden. Author rules that set `display` on the same element otherwise win
   the cascade over the UA default `[hidden] { display:none }` at equal
   specificity, so this has to be pinned explicitly and win by specificity. */
[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------- Loading / error states ---------- */

.loading-screen, .error-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  text-align: center;
  color: var(--color-text-muted);
}

.spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.error-card {
  max-width: 360px;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 32px 24px;
}

.error-icon { font-size: 40px; margin-bottom: 8px; }
.error-card h1 { font-size: 1.15rem; margin: 0 0 8px; color: var(--color-text); }
.error-card p { margin: 0; font-size: 0.95rem; line-height: 1.5; }

/* ---------- App shell ---------- */

.app { min-height: 100vh; display: flex; flex-direction: column; }

.site-header {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: #fff;
  padding-top: calc(22px + var(--header-safe-top));
  padding-bottom: 22px;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.12);
}

.site-header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-img, .logo-fallback {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  flex: none;
  background: #fff;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.logo-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-primary);
}

.header-text { min-width: 0; }

.restaurant-name {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.restaurant-sub {
  margin: 3px 0 0;
  font-size: 0.85rem;
  opacity: 0.92;
}

/* ---------- Operating Hours status (header) ---------- */

.restaurant-status {
  margin: 8px 0 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.8rem;
}

.restaurant-status-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 3px 10px;
  border-radius: 999px;
  background: #fff;
}

.restaurant-status-badge.is-open { color: #166534; background: #dcfce7; }
.restaurant-status-badge.is-closed { color: #b91c1c; background: #fee2e2; }

.restaurant-status-hours {
  opacity: 0.92;
}

.closed-notice {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: #fee2e2;
  color: #b91c1c;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
}

/* ---------- Cart toggle button (header) ---------- */

.cart-toggle-btn {
  margin-left: auto;
  flex: none;
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s var(--ease), transform 0.15s var(--ease);
}

.cart-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.26);
  transform: translateY(-1px);
}

.cart-toggle-btn:active {
  transform: translateY(0) scale(0.96);
}

.cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 0 0 2px var(--color-primary-dark);
}

/* ---------- Product search ---------- */

.search-bar {
  position: sticky;
  top: 100px; /* sits directly below the sticky header; see category-nav's top below */
  z-index: 9;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.search-bar-icon {
  flex: none;
  font-size: 1rem;
  color: var(--color-text-muted);
}

.product-search-input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 0.95rem;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-bg);
  color: var(--color-text);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease), background 0.15s var(--ease);
}

.product-search-input::placeholder { color: var(--color-text-muted); }

.product-search-input:focus {
  outline: none;
  background: var(--color-surface);
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 18%, transparent);
}

/* Removes the native browser-drawn "clear" icon in WebKit/Blink so it
   doesn't visually collide with our own search icon / styling. */
.product-search-input::-webkit-search-cancel-button { -webkit-appearance: none; }

.search-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 48px 16px;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.95rem;
}

.search-empty-icon { font-size: 1.8rem; opacity: 0.6; }

/* ---------- Category nav ---------- */

.category-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 14px 16px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 171px; /* header (100px) + search-bar (71px) stacked below it */
  z-index: 8;
  scrollbar-width: none;
}
.category-nav::-webkit-scrollbar { display: none; }

.category-pill {
  flex: none;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.15s var(--ease);
}

.category-pill:hover { border-color: var(--color-primary); color: var(--color-primary-dark); }

.category-pill.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

/* ---------- Layout (main content + cart panel) ---------- */

.layout { flex: 1; display: flex; }

.primary { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ---------- Menu content ---------- */

.menu-main {
  flex: 1;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 16px;
}

.category-section { margin-bottom: 36px; scroll-margin-top: 231px; }

.category-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0 0 4px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.category-title-ar {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text-muted);
  direction: rtl;
}

.category-empty {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  padding: 12px 0;
}

.product-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 14px;
}

@media (min-width: 640px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
}

.product-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease);
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.product-card.unavailable { opacity: 0.55; }
.product-card.unavailable:hover { transform: none; box-shadow: var(--shadow); }

.product-image-wrap {
  aspect-ratio: 4 / 3;
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.product-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s var(--ease);
}

.product-card:hover .product-image-wrap img { transform: scale(1.06); }

.product-image-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, color-mix(in srgb, var(--color-primary) 12%, var(--color-bg)), var(--color-bg));
  color: var(--color-text-muted);
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.product-image-placeholder .icon {
  font-size: 2rem;
  opacity: 0.55;
}

.product-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.product-name {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.005em;
  margin: 0;
}

.product-name-ar {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  direction: rtl;
  margin: 0;
}

.product-desc {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin: 2px 0 0;
  line-height: 1.45;
}

.product-footer {
  margin-top: auto;
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.product-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.product-price {
  font-weight: 800;
  color: var(--color-primary-dark);
  background: color-mix(in srgb, var(--color-primary) 10%, transparent);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.92rem;
  white-space: nowrap;
}

.add-to-cart-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: #fff;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease), filter 0.15s var(--ease);
}

.add-to-cart-btn:hover { filter: brightness(1.06); box-shadow: var(--shadow); }
.add-to-cart-btn:active { transform: scale(0.97); }

.add-to-cart-btn:disabled {
  background: var(--color-border);
  color: var(--color-text-muted);
  cursor: not-allowed;
  box-shadow: none;
}

.add-to-cart-btn .in-cart-count {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  padding: 0 8px;
  font-size: 0.78rem;
}

.unavailable-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #b91c1c;
  background: #fee2e2;
  padding: 2px 8px;
  border-radius: 999px;
}

.featured-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #92400e;
  background: #fef3c7;
  padding: 2px 8px;
  border-radius: 999px;
  align-self: flex-start;
}

.site-footer {
  text-align: center;
  padding: 20px 16px 32px;
  color: var(--color-text-muted);
  font-size: 0.8rem;
}

/* ---------- Cart panel (mobile-first: bottom drawer) ---------- */

.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 18, 26, 0.45);
  backdrop-filter: blur(1px);
  z-index: 40;
}

.cart-panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 86vh;
  background: var(--color-surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.2);
  z-index: 50;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s var(--ease);
}

.cart-panel.open { transform: translateY(0); }

.cart-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--color-border);
  flex: none;
}

.cart-panel-header h2 { margin: 0; font-size: 1.08rem; font-weight: 800; flex: 1; }

.cart-close-btn, .panel-back-btn {
  border: none;
  background: var(--color-bg);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--color-text-muted);
  flex: none;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.cart-close-btn:hover, .panel-back-btn:hover {
  background: var(--color-border);
  color: var(--color-text);
}

.panel-back-btn { margin-right: 10px; }

.cart-body {
  overflow-y: auto;
  padding: 14px 20px 20px;
  flex: 1;
}

.cart-empty {
  text-align: center;
  color: var(--color-text-muted);
  padding: 48px 12px;
  font-size: 0.95rem;
}

.cart-item {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--color-border);
}

.cart-item-image {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  flex: none;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-size: 1.1rem;
}

.cart-item-image img { width: 100%; height: 100%; object-fit: cover; }

.cart-item-info { flex: 1; min-width: 0; }

.cart-item-name {
  font-weight: 700;
  font-size: 0.94rem;
  margin: 0;
  overflow-wrap: anywhere;
}

.cart-item-unit-price {
  color: var(--color-text-muted);
  font-size: 0.8rem;
  margin: 2px 0 8px;
}

.cart-item-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.qty-stepper {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  overflow: hidden;
  background: var(--color-bg);
}

.qty-btn {
  border: none;
  background: transparent;
  width: 30px;
  height: 30px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
  cursor: pointer;
  line-height: 1;
  transition: background 0.15s var(--ease);
}

.qty-btn:hover { background: var(--color-border); }

.qty-value {
  min-width: 26px;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 700;
}

.cart-item-line-total {
  font-weight: 800;
  color: var(--color-primary-dark);
  font-size: 0.92rem;
  white-space: nowrap;
}

.cart-item-remove-btn {
  border: none;
  background: none;
  color: #b91c1c;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 0;
}

.cart-item-remove-btn:hover { text-decoration: underline; }

.cart-summary {
  border-top: 1px solid var(--color-border);
  padding: 16px 20px;
  flex: none;
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.88rem;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}

.cart-summary-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--color-border);
  color: var(--color-text);
}

.cart-summary-total span:last-child {
  font-size: 1.12rem;
  text-align: right;
  text-transform: none;
  letter-spacing: normal;
  color: var(--color-primary-dark);
}

.checkout-btn {
  width: 100%;
  margin-top: 16px;
  padding: 13px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease), filter 0.15s var(--ease);
}

.checkout-btn:hover:not(:disabled) { filter: brightness(1.06); box-shadow: var(--shadow); }
.checkout-btn:active:not(:disabled) { transform: scale(0.98); }

.checkout-btn:disabled {
  background: var(--color-border);
  color: var(--color-text-muted);
  cursor: not-allowed;
}

/* ---------- Checkout form ---------- */

.checkout-form { display: flex; flex-direction: column; gap: 16px; }

.form-field { display: flex; flex-direction: column; gap: 5px; }

.form-field label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-text);
}

.form-field .optional-tag {
  font-weight: 400;
  color: var(--color-text-muted);
}

.form-field input,
.form-field textarea {
  font: inherit;
  padding: 11px 13px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-primary) 18%, transparent);
}

.form-field textarea { resize: vertical; min-height: 64px; }

.form-field input:focus-visible,
.form-field textarea:focus-visible,
.checkout-btn:focus-visible,
.add-to-cart-btn:focus-visible,
.qty-btn:focus-visible,
.cart-close-btn:focus-visible,
.panel-back-btn:focus-visible,
.cart-toggle-btn:focus-visible,
.category-pill:focus-visible,
.cart-item-remove-btn:focus-visible {
  outline: 2px solid var(--color-primary-dark);
  outline-offset: 2px;
}

.form-field.has-error input,
.form-field.has-error textarea {
  border-color: #b91c1c;
}

.field-error {
  color: #b91c1c;
  font-size: 0.78rem;
}

.checkout-actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

.checkout-actions button {
  flex: 1;
  padding: 13px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s var(--ease), filter 0.15s var(--ease), background 0.15s var(--ease);
}

.checkout-actions .btn-primary {
  border: none;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: #fff;
}

.checkout-actions .btn-primary:hover { filter: brightness(1.06); }

.checkout-actions .btn-secondary {
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
}

.checkout-actions .btn-secondary:hover { background: var(--color-bg); }
.checkout-actions button:active { transform: scale(0.98); }

/* ---------- Order summary block (checkout + review views) ---------- */

.order-summary-block {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  background: var(--color-bg);
}

.order-summary-title {
  font-size: 0.9rem;
  font-weight: 700;
  margin: 0 0 8px;
}

.order-summary-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.85rem;
  padding: 4px 0;
}

.order-summary-line .qty-name { color: var(--color-text); overflow-wrap: anywhere; }

.order-summary-divider {
  border: none;
  border-top: 1px dashed var(--color-border);
  margin: 10px 0;
}

.order-summary-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.order-summary-total span:last-child {
  font-size: 1.05rem;
  text-transform: none;
  letter-spacing: normal;
  color: var(--color-primary-dark);
}

/* ---------- Review screen ---------- */

.review-section { margin-bottom: 18px; }

.review-section h3 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-text-muted);
  margin: 0 0 8px;
}

.review-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.9rem;
  padding: 4px 0;
}

.review-row .review-label { color: var(--color-text-muted); }
.review-row .review-value { text-align: right; overflow-wrap: anywhere; }

.review-notes {
  font-size: 0.88rem;
  color: var(--color-text);
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ---------- WhatsApp order button (review screen) ---------- */

.whatsapp-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 14px;
  padding: 14px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #25d366, #1fb356);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(37, 211, 102, 0.32);
  transition: transform 0.15s var(--ease), filter 0.15s var(--ease);
}

.whatsapp-btn:hover:not(:disabled) { filter: brightness(1.05); }
.whatsapp-btn:active:not(:disabled) { transform: scale(0.98); }

.whatsapp-btn:focus-visible {
  outline: 2px solid #128c7e;
  outline-offset: 2px;
}

.whatsapp-btn:disabled {
  background: var(--color-border);
  color: var(--color-text-muted);
  cursor: not-allowed;
  box-shadow: none;
}

.whatsapp-error {
  color: #b91c1c;
  font-size: 0.82rem;
  text-align: center;
  margin: 10px 0 0;
}

/* ---------- Order confirmation screen ---------- */

.confirmation-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 8px 0 4px;
}

.confirmation-icon {
  font-size: 2.8rem;
  line-height: 1;
  margin-bottom: 4px;
}

.confirmation-heading {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 0 0 4px;
  color: var(--color-text);
}

.confirmation-heading:focus-visible {
  outline: 2px solid var(--color-primary-dark);
  outline-offset: 4px;
  border-radius: 4px;
}

.confirmation-lead {
  font-size: 0.92rem;
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.5;
  max-width: 32ch;
}

.confirmation-notice {
  width: 100%;
  margin: 14px 0 4px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: #fff7ed;
  border: 1px solid #fdba74;
  color: #9a3412;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.4;
}

.confirmation-screen .review-section {
  width: 100%;
  text-align: left;
  margin-top: 10px;
}

.confirmation-thanks {
  font-weight: 700;
  margin: 12px 0 4px;
  color: var(--color-text);
}

.confirmation-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.confirmation-continue-btn {
  width: 100%;
  padding: 13px;
  border-radius: 999px;
  border: none;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.15s var(--ease), transform 0.15s var(--ease);
}

.confirmation-continue-btn:hover { filter: brightness(1.06); }
.confirmation-continue-btn:active { transform: scale(0.98); }

.confirmation-secondary-row {
  display: flex;
  gap: 10px;
}

.confirmation-secondary-row button {
  flex: 1;
  padding: 11px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.15s var(--ease), background 0.15s var(--ease);
}

.btn-danger {
  border: 1px solid #fecaca;
  background: #fee2e2;
  color: #b91c1c;
}

.btn-danger:hover { background: #fecaca; }

.btn-danger:focus-visible,
.confirmation-continue-btn:focus-visible {
  outline: 2px solid var(--color-primary-dark);
  outline-offset: 2px;
}

/* ---------- PWA: offline / update banners ---------- */

.status-banner {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 10px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.offline-banner {
  background: #fef3c7;
  color: #92400e;
}

.update-banner {
  background: #dbeafe;
  color: #1e3a8a;
}

.update-refresh-btn {
  border: none;
  background: #1e3a8a;
  color: #fff;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.update-refresh-btn:focus-visible {
  outline: 2px solid var(--color-primary-dark);
  outline-offset: 2px;
}

/* Mobile: checkout/review take over the full screen (more room for the form
   than the shorter cart bottom-sheet), the cart view keeps the bottom-sheet. */
@media (max-width: 639px) {
  .cart-panel.view-checkout,
  .cart-panel.view-review,
  .cart-panel.view-confirmation {
    max-height: 100vh;
    height: 100vh;
    border-radius: 0;
    top: 0;
  }
}

/* ---------- Tablet: slide-in panel from the right (collapsible) ---------- */

@media (min-width: 640px) and (max-width: 1023px) {
  .cart-panel {
    left: auto;
    top: 0;
    bottom: 0;
    width: 380px;
    max-height: none;
    border-radius: 0;
    transform: translateX(100%);
  }
  .cart-panel.open { transform: translateX(0); }
}

/* ---------- Desktop: permanent side panel ---------- */

@media (min-width: 1024px) {
  .cart-toggle-btn { display: none; }
  .cart-overlay { display: none !important; }

  .cart-panel {
    position: sticky;
    top: 0;
    left: auto;
    right: auto;
    bottom: auto;
    width: 380px;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    border-left: 1px solid var(--color-border);
    box-shadow: none;
    transform: none;
    flex: none;
  }
}
