/* ========================================================================
   Order flow — extends tokens defined in css/style.css
   ======================================================================== */

[hidden] { display: none !important; }

.order-header-spacer { height: 84px; }

/* ------------------------------------------------------------------------
   Checkout — trust badges + delivery info (fills the space beneath the
   fulfillment options on step 1)
   ------------------------------------------------------------------------ */
.checkout-trust-section {
  margin-top: 36px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}
.checkout-trust-heading {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-400);
  margin-bottom: 16px;
}
.checkout-trust-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.checkout-trust-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  background: var(--white);
}
.checkout-trust-icon {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--navy-900);
  color: var(--teal-300);
  display: flex;
  align-items: center;
  justify-content: center;
}
.checkout-trust-badge span:last-child {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--navy-900);
  line-height: 1.25;
}

.checkout-info-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--line);
  background: var(--cream-200);
}
.checkout-info-icon {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--white);
  color: var(--teal-500);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--line);
}
.checkout-info-card strong { display: block; color: var(--navy-900); font-size: 0.94rem; margin-bottom: 4px; }
.checkout-info-card p { color: var(--ink-600); font-size: 0.86rem; line-height: 1.55; margin: 0; }

@media (max-width: 560px) {
  .checkout-trust-grid { grid-template-columns: repeat(2, 1fr); }
}

.pkg-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-600);
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 28px;
}
.pkg-back:hover { color: var(--teal-500); }

.pkg-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 44px;
  align-items: start;
}
@media (max-width: 860px) {
  .pkg-layout { grid-template-columns: 1fr; }
}

.pkg-gallery-main {
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--cream-200);
}
.pkg-gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 250ms ease-in-out;
}

.pkg-gallery-thumbs {
  display: flex;
  gap: 12px;
  margin-top: 14px;
}
.pkg-thumb {
  width: 76px;
  height: 76px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  flex: none;
  padding: 0;
  background: none;
}
.pkg-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pkg-thumb.active { border-color: var(--teal-500); }

.pkg-panel {
  background: var(--cream-100);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  padding: 32px;
  position: sticky;
  top: 100px;
}
.pkg-panel .package-badge { position: static; display: inline-block; margin-bottom: 14px; }
.pkg-panel h1 { font-size: clamp(1.5rem, 2.4vw, 2rem); }
.pkg-long-desc { color: var(--ink-600); margin-top: 12px; font-size: 1rem; }

.pkg-size-picker { margin-top: 26px; }
.pkg-size-picker h2 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-400); font-family: var(--font-body); font-weight: 700; }
.pkg-size-options { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.pkg-size-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: var(--white);
  transition: border-color 180ms var(--ease);
}
.pkg-size-option:hover { border-color: var(--teal-400); }
.pkg-size-option.selected { border-color: var(--teal-500); box-shadow: 0 0 0 1px var(--teal-500); }
.pkg-size-option-label { font-weight: 600; color: var(--navy-900); }
.pkg-size-option-serves { display: block; font-size: 0.84rem; color: var(--ink-400); font-weight: 400; margin-top: 2px; }
.pkg-size-option-price { font-weight: 700; color: var(--navy-900); }

.pkg-price-row {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.pkg-fulfillment-note {
  margin-top: 14px;
  font-size: 0.85rem;
  color: var(--ink-400);
  text-align: center;
}

.pkg-meals { margin-top: 72px; }
.pkg-meals h2 { margin-bottom: 24px; }
.pkg-meal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 18px;
}
.pkg-meal-card { text-align: center; }
.pkg-meal-photo {
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: var(--cream-200);
}
.pkg-meal-photo img { width: 100%; height: 100%; object-fit: cover; }
.pkg-meal-name { margin-top: 10px; font-size: 0.92rem; font-weight: 600; color: var(--navy-900); }

.order-state {
  text-align: center;
  padding: 80px 0;
  color: var(--ink-400);
}
.order-state.is-error { color: #b3261e; }

/* ------------------------------------------------------------------------
   Checkout stepper
   ------------------------------------------------------------------------ */
.checkout-layout {
  display: grid;
  grid-template-columns: 1.3fr 0.9fr;
  gap: 44px;
  align-items: start;
}
@media (max-width: 860px) {
  .checkout-layout { grid-template-columns: 1fr; }
}

.step-indicator {
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.step-indicator-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-400);
  padding: 8px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
}
.step-indicator-item.active { color: var(--white); background: var(--navy-900); border-color: var(--navy-900); }
.step-indicator-item.done { color: var(--teal-500); border-color: var(--teal-500); }

.step-panel { display: none; }
.step-panel.active { display: block; }

.step-panel h2 { font-size: 1.3rem; margin-bottom: 20px; }

.fulfillment-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 520px) { .fulfillment-options { grid-template-columns: 1fr; } }
.fulfillment-option {
  text-align: left;
  padding: 22px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--cream-100);
  cursor: pointer;
  transition: border-color 220ms var(--ease), box-shadow 220ms var(--ease), transform 220ms var(--ease);
}
.fulfillment-option:hover { border-color: var(--teal-400); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.fulfillment-option.selected { border-color: var(--teal-500); box-shadow: 0 0 0 1px var(--teal-500); background: var(--white); }
.fulfillment-option.selected:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px var(--teal-500), var(--shadow-sm); }
.fulfillment-option-title { font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; color: var(--navy-900); }
.fulfillment-option-sub { display: block; margin-top: 6px; font-size: 0.88rem; color: var(--ink-600); }

.date-chips {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 22px;
}
.date-chip {
  flex: none;
  text-align: center;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  background: var(--white);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-600);
}
.date-chip .date-chip-day { display: block; font-size: 0.72rem; color: var(--ink-400); font-weight: 500; text-transform: uppercase; }
.date-chip.selected { border-color: var(--teal-500); background: var(--navy-900); color: var(--white); }
.date-chip.selected .date-chip-day { color: var(--teal-300); }

.time-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.time-slot {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  background: var(--white);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-600);
  text-align: center;
}
.time-slot.selected { border-color: var(--teal-500); box-shadow: 0 0 0 1px var(--teal-500); color: var(--navy-900); }
.time-slot.sold-out { opacity: 0.4; cursor: not-allowed; text-decoration: line-through; }
.time-slot-remaining { display: block; font-size: 0.72rem; color: var(--ink-400); font-weight: 500; margin-top: 2px; }

.checkout-form { display: grid; gap: 18px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 520px) { .form-row { grid-template-columns: 1fr; } }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field label { font-size: 0.85rem; font-weight: 600; color: var(--navy-900); }
.form-field input,
.form-field textarea {
  font: inherit;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  background: var(--white);
  color: var(--ink-900);
}
.form-field input:focus,
.form-field textarea:focus { outline: none; border-color: var(--teal-500); }
.form-field textarea { resize: vertical; min-height: 80px; }
.form-error { color: #b3261e; font-size: 0.82rem; min-height: 1em; }

.review-block { margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.review-block:last-of-type { border-bottom: none; }
.review-block h3 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-400); font-family: var(--font-body); font-weight: 700; margin-bottom: 8px; }
.review-block p { color: var(--ink-900); font-size: 0.98rem; }

.step-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 32px; }

.order-summary {
  background: var(--cream-100);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  padding: 28px;
  position: sticky;
  top: 100px;
}
.order-summary h2 { font-size: 1.05rem; margin-bottom: 18px; }
.summary-item { display: flex; justify-content: space-between; gap: 10px; font-size: 0.92rem; color: var(--ink-600); margin-bottom: 10px; }
.summary-item strong { color: var(--navy-900); flex: none; }
.summary-item-line { align-items: flex-start; }
.summary-item-desc { display: block; color: var(--ink-400); font-size: 0.78rem; margin-top: 2px; line-height: 1.4; }
.summary-divider { border-top: 1px solid var(--line); margin: 16px 0; }
.summary-total { display: flex; justify-content: space-between; font-family: var(--font-head); font-weight: 800; font-size: 1.2rem; color: var(--navy-900); }

.review-item-line { margin-bottom: 10px; }
.review-item-line:last-child { margin-bottom: 0; }
.review-item-line small { display: block; color: var(--ink-400); font-size: 0.8rem; margin-top: 2px; }

/* ------------------------------------------------------------------------
   Confirmation & tracking
   ------------------------------------------------------------------------ */
.confirm-check {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--teal-500);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}
.confirm-heading { text-align: center; margin-bottom: 8px; }
.confirm-sub { text-align: center; color: var(--ink-600); margin-bottom: 40px; }
.confirm-order-number { text-align: center; font-family: var(--font-head); font-weight: 800; font-size: 1.4rem; color: var(--navy-900); margin-bottom: 40px; }

.order-detail-card {
  background: var(--cream-100);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  padding: 32px;
  max-width: 640px;
  margin: 0 auto 32px;
}

.status-timeline {
  display: flex;
  gap: 8px;
  margin: 32px auto;
  max-width: 640px;
  flex-wrap: wrap;
}
.status-step {
  flex: 1;
  min-width: 110px;
  text-align: center;
  padding: 14px 10px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  background: var(--white);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-400);
}
.status-step.done { border-color: var(--teal-500); color: var(--teal-500); background: rgba(31,169,138,0.08); }
.status-step.current { border-color: var(--navy-900); background: var(--navy-900); color: var(--white); }
.status-step.cancelled { border-color: #b3261e; background: rgba(179,38,30,0.08); color: #b3261e; }

.track-form {
  max-width: 420px;
  margin: 0 auto 48px;
  display: grid;
  gap: 14px;
}

/* ------------------------------------------------------------------------
   Admin
   ------------------------------------------------------------------------ */
.admin-login-card {
  max-width: 360px;
  margin: 80px auto;
  background: var(--cream-100);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  padding: 32px;
  display: grid;
  gap: 16px;
}
.admin-login-card h1 { font-size: 1.3rem; text-align: center; }

.admin-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}
.admin-filters { display: flex; gap: 10px; flex-wrap: wrap; }
.admin-filters select,
.admin-filters input {
  font: inherit;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  background: var(--white);
}

.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.admin-table th,
.admin-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.admin-table th { color: var(--ink-400); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; }
.admin-table td.wrap { white-space: normal; }
.admin-status-select {
  font: inherit;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line);
  background: var(--white);
}
.admin-empty { text-align: center; padding: 40px; color: var(--ink-400); }
