/* Online ordering: basket, item options and checkout. Uses the site's palette from tailwind.config.cjs. */
:root {
  --o-primary: #3E5A3C;
  --o-primary-dark: #2D4229;
  --o-accent: #C6A75E;
  --o-accent-dark: #A07D28;
  --o-cream: #F7F5EF;
  --o-sage: #EBF0E9;
  --o-text: #1A1A1A;
  --o-muted: #5b6159;
  --o-line: #e5e7eb;
  --o-danger: #b42318;
}

/* Status pill in the menu banner */
.order-status {
  display: inline-block;
  margin: 0 auto 1rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.25);
}
.order-status--open { background: rgba(34, 197, 94, 0.2); color: #dcfce7; border-color: rgba(134, 239, 172, 0.45); }
.order-status--closed { background: rgba(0, 0, 0, 0.22); color: rgba(255, 255, 255, 0.85); }
.order-status--paused { background: rgba(198, 167, 94, 0.25); color: #fff7e0; border-color: rgba(198, 167, 94, 0.6); }

/* Placeholder tile for items without a photo (div, so the site's .menu-card img rule can't stretch it) */
.photo-placeholder {
  height: 240px;
  background: linear-gradient(135deg, #EBF0E9 0%, #dce6d8 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
}
.photo-placeholder__logo {
  height: 76px; width: 76px; border-radius: 50%;
  background: url(/images/cristinas-logo.jpg) center / cover; opacity: 0.6;
}
.photo-placeholder p {
  font-size: 0.68rem; color: var(--o-primary); font-weight: 700; text-align: center;
  letter-spacing: 0.07em; text-transform: uppercase; margin: 0; padding: 0 1.2rem; line-height: 1.6;
}
@media (max-width: 639px) { .photo-placeholder { height: 210px; } }

/* Add buttons on menu cards */
.add-btn {
  width: 100%; min-height: 44px; border-radius: 999px;
  background: var(--o-primary); color: #fff; font-weight: 600; font-size: 0.9rem;
  transition: background 0.2s;
}
.add-btn:hover { background: var(--o-primary-dark); }
.add-btn:disabled { background: #c9cfc7; color: #4b5148; cursor: not-allowed; }
.add-btn:focus-visible, .o-btn:focus-visible, .o-icon-btn:focus-visible, .basket-bar__button:focus-visible,
.o-stepper button:focus-visible, .o-choice input:focus-visible + span {
  outline: 3px solid var(--o-accent); outline-offset: 2px;
}
.sold-out-label { text-align: center; font-size: 0.85rem; font-weight: 600; color: var(--o-muted); padding: 0.7rem 0; }
.menu-card.is-sold-out img, .menu-card.is-sold-out .photo-placeholder { filter: grayscale(1); opacity: 0.55; }

/* Sticky basket bar */
.basket-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 35;
  padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.96); border-top: 1px solid var(--o-line);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.08);
}
.basket-bar[hidden] { display: none; }
.basket-bar__button {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  width: 100%; max-width: 40rem; margin: 0 auto; min-height: 52px; padding: 0 1.25rem;
  border-radius: 999px; background: var(--o-primary); color: #fff; font-weight: 600;
}
.basket-bar__cta { background: var(--o-accent); color: #fff; padding: 0.35rem 0.85rem; border-radius: 999px; font-size: 0.85rem; white-space: nowrap; }
body.has-basket .whatsapp-btn { bottom: 6.5rem; }
body.has-basket main { padding-bottom: 6rem; }

/* Sheets (item options + basket/checkout): bottom sheet on phones, centred panel on larger screens */
.sheet {
  width: 100%; max-width: 32rem; max-height: 92vh; padding: 0; border: 0;
  margin: auto auto 0; border-radius: 1.25rem 1.25rem 0 0;
  background: #fff; color: var(--o-text); box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.2);
}
.sheet::backdrop { background: rgba(26, 26, 26, 0.55); }
@media (min-width: 640px) { .sheet { margin: auto; border-radius: 1.25rem; } }
.sheet__inner { display: flex; flex-direction: column; max-height: 92vh; }
.sheet__head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
  padding: 1.25rem 1.25rem 0.75rem; border-bottom: 1px solid var(--o-line);
}
.sheet__head h2 { font-family: "Playfair Display", Georgia, serif; font-size: 1.4rem; font-weight: 700; line-height: 1.2; }
.sheet__body { padding: 1rem 1.25rem; overflow-y: auto; flex: 1; }
.sheet__foot { padding: 0.9rem 1.25rem calc(0.9rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--o-line); background: #fff; }

.o-icon-btn { width: 44px; height: 44px; flex: none; border-radius: 999px; display: grid; place-items: center; font-size: 1.4rem; color: var(--o-muted); background: var(--o-cream); }
.o-btn {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  width: 100%; min-height: 52px; padding: 0 1.25rem; border-radius: 999px;
  background: var(--o-primary); color: #fff; font-weight: 600; font-size: 1rem; transition: background 0.2s;
}
.o-btn:hover { background: var(--o-primary-dark); }
.o-btn:disabled { background: #c9cfc7; color: #4b5148; cursor: not-allowed; }
.o-btn--ghost { background: transparent; color: var(--o-primary); min-height: 44px; }
.o-btn--ghost:hover { background: var(--o-sage); }
.o-link { color: var(--o-primary); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }

/* Option groups */
.o-group { border: 0; margin: 0 0 1.25rem; padding: 0; }
.o-group legend { font-weight: 700; font-size: 1rem; margin-bottom: 0.15rem; }
.o-group__rule { font-size: 0.78rem; color: var(--o-muted); margin-bottom: 0.5rem; }
.o-group__rule.is-required { color: var(--o-accent-dark); font-weight: 600; }
.o-choice { display: flex; align-items: center; gap: 0.75rem; min-height: 48px; padding: 0.25rem 0; border-bottom: 1px solid #f1f2f0; cursor: pointer; }
.o-choice input { width: 20px; height: 20px; accent-color: var(--o-primary); flex: none; }
.o-choice span { flex: 1; }
.o-choice small { color: var(--o-muted); font-size: 0.85rem; }
.o-choice.is-disabled { opacity: 0.5; cursor: not-allowed; }

/* Quantity stepper */
.o-stepper { display: inline-flex; align-items: center; border: 1px solid var(--o-line); border-radius: 999px; }
.o-stepper button { width: 44px; height: 44px; border-radius: 999px; font-size: 1.25rem; font-weight: 600; color: var(--o-primary); }
.o-stepper button:disabled { color: #b8beb6; }
.o-stepper output { min-width: 2rem; text-align: center; font-weight: 700; }

/* Basket lines */
.o-line { display: grid; grid-template-columns: 1fr auto; gap: 0.25rem 1rem; padding: 0.85rem 0; border-bottom: 1px solid #f1f2f0; }
.o-line__name { font-weight: 600; }
.o-line__opts { font-size: 0.8rem; color: var(--o-muted); }
.o-code { font-size: 1.6rem; letter-spacing: 0.5em; text-align: center; max-width: 11rem; }
.o-line__note { font-size: 0.8rem; font-weight: 600; color: var(--o-text); }
.o-line__price { font-weight: 700; text-align: right; }
.o-line__controls { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; }
.o-remove { min-height: 44px; padding: 0 0.5rem; font-size: 0.85rem; color: var(--o-danger); font-weight: 600; }
.o-total { display: flex; justify-content: space-between; font-weight: 700; font-size: 1.1rem; margin-top: 0.75rem; }
.o-notice { background: #fffbeb; border-left: 4px solid var(--o-accent); padding: 0.75rem 0.9rem; border-radius: 0 0.5rem 0.5rem 0; font-size: 0.875rem; color: #374151; }
.o-paynote { display: flex; gap: 0.5rem; align-items: center; background: var(--o-sage); color: var(--o-primary-dark); font-weight: 700; padding: 0.75rem 0.9rem; border-radius: 0.75rem; }
.o-warn { background: #fef3f2; color: var(--o-danger); border-radius: 0.75rem; padding: 0.75rem 0.9rem; font-size: 0.9rem; font-weight: 500; }

/* Form fields */
.o-field { display: block; margin-bottom: 1rem; }
.o-field > span { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.35rem; }
.o-field input, .o-field select, .o-field textarea {
  width: 100%; min-height: 48px; padding: 0.6rem 0.85rem; font-size: 1rem;
  border: 1px solid #cfd4cd; border-radius: 0.75rem; background: #fff; color: var(--o-text);
}
.o-field textarea { min-height: 72px; resize: vertical; }
.o-field input:focus, .o-field select:focus, .o-field textarea:focus { outline: 3px solid rgba(198, 167, 94, 0.55); border-color: var(--o-primary); }
.o-field small { display: block; color: var(--o-muted); font-size: 0.78rem; margin-top: 0.3rem; }
.o-field [aria-invalid="true"] { border-color: var(--o-danger); }
.o-check { display: flex; gap: 0.75rem; align-items: flex-start; min-height: 44px; font-size: 0.9rem; cursor: pointer; }
.o-check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--o-primary); flex: none; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 6.5rem; transform: translate(-50%, 1rem); z-index: 60;
  background: var(--o-text); color: #fff; padding: 0.7rem 1.1rem; border-radius: 999px; font-size: 0.9rem; font-weight: 500;
  opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; max-width: calc(100% - 2rem); text-align: center;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* Confirmation page */
.confirm-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; margin-bottom: 1.5rem; }
@media (min-width: 480px) { .confirm-grid { grid-template-columns: repeat(3, 1fr); } }
.confirm-grid > div { background: var(--o-cream); border-radius: 0.75rem; padding: 0.85rem 1rem; }
.confirm-grid dt { font-size: 0.75rem; color: var(--o-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.confirm-big { font-family: "Playfair Display", Georgia, serif; font-size: 1.6rem; font-weight: 700; color: var(--o-primary); }
.confirm-lines li { display: flex; justify-content: space-between; gap: 1rem; padding: 0.6rem 0; border-bottom: 1px solid #f1f2f0; font-size: 0.95rem; }

@media (prefers-reduced-motion: reduce) { .toast, .add-btn, .o-btn { transition: none; } }
