/* ============================================================
   Lolita's Mexican Food Truck — order.css
   Styles specific to the Order Ahead page (order.html)
   Depends on style.css being loaded first (shares variables,
   nav, footer, papel picado, tile divider, btn, form-group)
   ============================================================ */

/* ── Missing variables (not defined in style.css) ───────── */
:root {
  --bg:      #120600;   /* dark page background for order page */
  --surface: #2A1200;   /* card surface */
  --text-muted: rgba(253, 246, 236, 0.5);
}

/* Override body background on this page */
body {
  background: var(--bg);
}

/* ── Order Hero ─────────────────────────────────────────── */

.order-hero {
  position: relative;
  background: var(--espresso);
  padding: 4rem 0 3rem;
  text-align: center;
  overflow: hidden;
}

.order-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(192, 57, 43, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 50%, rgba(243, 156, 18, 0.12) 0%, transparent 60%);
  pointer-events: none;
}

.order-hero .papel-picado {
  top: 0;
}

.order-hero-inner {
  position: relative;
  z-index: 1;
  padding-top: 2rem;
}

.order-hero-inner .script-accent {
  font-size: 1.3rem;
}

.order-hero-inner h1 {
  font-family: var(--font-head);
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  color: var(--cream);
  margin: 0.25rem 0 1rem;
  line-height: 1.1;
}

.order-hero-inner h1 em {
  color: var(--red);
  font-style: normal;
}

.order-hero-inner > p {
  color: rgba(253, 246, 236, 0.75);
  max-width: 560px;
  margin: 0 auto 1.75rem;
  font-size: 1rem;
  line-height: 1.6;
}

/* Info pills row */
.order-info-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
}

.order-info-pills span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--cream);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-family: var(--font-body);
}

.order-info-pills span i {
  color: var(--gold);
}

/* ── Main Order Area ─────────────────────────────────────── */

.order-main {
  background: var(--bg);
  padding: 3rem 0 4rem;
}

/* ── Category Cards ─────────────────────────────────────── */

.order-category {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  margin-bottom: 1.5rem;
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.order-category:hover {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.category-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.cat-emoji {
  font-size: 2.2rem;
  line-height: 1;
  flex-shrink: 0;
}

.category-header h2 {
  font-family: var(--font-head);
  font-size: 1.4rem;
  color: var(--cream);
  margin: 0 0 0.15rem;
}

.category-header p {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin: 0;
}

/* ── Order Items ─────────────────────────────────────────── */

.order-items {
  padding: 0.5rem 0;
}

.order-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.15s;
}

.order-item:last-child {
  border-bottom: none;
}

.order-item:hover {
  background: rgba(255, 255, 255, 0.03);
}

.item-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.item-name {
  font-family: var(--font-body);
  font-weight: 700;
  color: var(--cream);
  font-size: 0.95rem;
}

.item-price {
  font-size: 0.8rem;
  color: var(--gold);
  font-family: var(--font-body);
}

/* ── Quantity Stepper ────────────────────────────────────── */

.qty-control {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.25);
}

.qty-btn {
  background: transparent;
  border: none;
  color: var(--cream);
  font-size: 1.2rem;
  line-height: 1;
  width: 36px;
  height: 36px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.qty-btn:hover {
  background: var(--red);
  color: #fff;
}

.qty-btn.plus:hover {
  background: var(--green);
}

.qty-control input[type="number"] {
  width: 42px;
  height: 36px;
  background: transparent;
  border: none;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
  -moz-appearance: textfield;
  appearance: textfield;
  padding: 0;
}

.qty-control input[type="number"]::-webkit-outer-spin-button,
.qty-control input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Highlight row when qty > 0 */
.order-item.has-qty {
  background: rgba(243, 156, 18, 0.06);
}

.order-item.has-qty .item-name {
  color: var(--gold);
}

/* ── Tile divider with spacing (between categories and summary) */

.tile-divider--spaced {
  margin: 2rem 0;
}

/* ── Order Summary + Contact Grid ───────────────────────── */

.order-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 760px) {
  .order-summary-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Order Totals Panel ──────────────────────────────────── */

.order-totals {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  padding: 1.5rem;
  position: sticky;
  top: 90px;
}

.order-totals h3 {
  font-family: var(--font-head);
  color: var(--cream);
  font-size: 1.2rem;
  margin: 0 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.order-totals h3 i {
  color: var(--gold);
}

.totals-list {
  min-height: 80px;
  margin-bottom: 1rem;
}

.empty-order {
  color: var(--text-muted);
  font-size: 0.88rem;
  font-style: italic;
  margin: 0;
}

.totals-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.9rem;
  color: var(--cream);
}

.totals-line:last-child {
  border-bottom: none;
}

.totals-line .line-name {
  color: rgba(253, 246, 236, 0.8);
}

.totals-line .line-subtotal {
  color: var(--gold);
  font-weight: 700;
}

/* Grand total row — hidden by default, shown via JS class */
.order-grand-total {
  display: none;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: rgba(243, 156, 18, 0.12);
  border: 1px solid rgba(243, 156, 18, 0.3);
  border-radius: 8px;
  margin-top: 0.75rem;
  margin-bottom: 0.75rem;
  font-family: var(--font-body);
}

.order-grand-total.visible {
  display: flex;
}

.order-grand-total span {
  font-size: 0.9rem;
  color: var(--cream);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.order-grand-total strong {
  font-size: 1.4rem;
  color: var(--gold);
}

.tax-note {
  font-size: 0.75rem;
  color: var(--gold);
  text-align: right;
  margin: -0.25rem 0 0.5rem;
  opacity: 0.75;
}

.order-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0;
  display: flex;
  gap: 0.4rem;
  align-items: flex-start;
  line-height: 1.5;
}

.order-note i {
  color: var(--gold);
  flex-shrink: 0;
  margin-top: 0.15rem;
}

/* ── Contact / Info Form ─────────────────────────────────── */

.order-contact {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  padding: 1.5rem;
}

.order-contact h3 {
  font-family: var(--font-head);
  color: var(--cream);
  font-size: 1.2rem;
  margin: 0 0 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.order-contact h3 i {
  color: var(--gold);
}

.order-contact select {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: var(--cream);
  padding: 0.65rem 0.85rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23F39C12' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  cursor: pointer;
  transition: border-color 0.2s;
}

.order-contact select:focus {
  outline: none;
  border-color: var(--gold);
}

.order-contact select option {
  background: var(--espresso);
  color: var(--cream);
}

.order-submit {
  width: 100%;
  justify-content: center;
  margin-top: 0.5rem;
  font-size: 1rem;
  padding: 0.9rem;
}

.submit-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  margin: 0.6rem 0 0;
}

/* ── Responsive ─────────────────────────────────────────── */

@media (max-width: 600px) {
  .order-item {
    padding: 0.65rem 1rem;
  }

  .category-header {
    padding: 1rem;
  }

  .order-totals,
  .order-contact {
    padding: 1.25rem;
  }
}
