/* DigiFood — Customer Site Stylesheet
   Palette: #1a1f36 (header/dark), #FF6B35 (accent/CTA), #f7f8fc (bg)
   Font: Inter (Google Fonts)
   Mobile-first responsive
*/

/* ── Reset & base ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --dark:    #1a1f36;
  --accent:  #FF6B35;
  --accent2: #e55b25;
  --bg:      #f7f8fc;
  --card-bg: #ffffff;
  --text:    #1a1f36;
  --muted:   #6b7280;
  --border:  #e5e7eb;
  --radius:  12px;
  --shadow:  0 2px 12px rgba(0,0,0,.08);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ── Header ─────────────────────────────────────────────────────── */
.site-header {
  background: var(--dark);
  color: #fff;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}

.site-logo {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #fff;
}

.site-logo span { color: var(--accent); }

.header-nav a {
  color: rgba(255,255,255,.8);
  font-size: 0.9rem;
  font-weight: 500;
  margin-left: 1.25rem;
  transition: color .2s;
}
.header-nav a:hover { color: #fff; }
.header-nav .btn-signup {
  background: var(--accent);
  color: #fff;
  padding: 0.4rem 1rem;
  border-radius: 8px;
}

/* ── Hero (index.php) ───────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--dark) 0%, #2d3561 100%);
  color: #fff;
  text-align: center;
  padding: 5rem 1.5rem 4rem;
}

.hero h1 {
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 800;
  margin-bottom: 1rem;
}

.hero h1 span { color: var(--accent); }

.hero p {
  color: rgba(255,255,255,.75);
  font-size: 1.1rem;
  margin-bottom: 2.5rem;
}

.postcode-form {
  display: flex;
  max-width: 480px;
  margin: 0 auto;
  gap: 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,.3);
}

.postcode-form input {
  flex: 1;
  padding: 1rem 1.25rem;
  font-size: 1rem;
  border: none;
  outline: none;
  font-family: inherit;
  text-transform: uppercase;
}

.postcode-form button {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 1rem 1.5rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s;
  white-space: nowrap;
}
.postcode-form button:hover { background: var(--accent2); }

/* ── Page wrapper ───────────────────────────────────────────────── */
.page-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.25rem;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.page-subtitle {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

/* ── Restaurant grid ─────────────────────────────────────────────── */
.restaurant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.restaurant-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
  display: block;
}

.restaurant-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 24px rgba(0,0,0,.12);
}

.restaurant-card__banner {
  height: 140px;
  background: var(--dark);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.restaurant-card__banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.restaurant-card__banner .logo-placeholder {
  font-size: 3rem;
  color: rgba(255,255,255,.2);
}

.restaurant-card__body { padding: 1rem; }

.restaurant-card__name {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.cuisine-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.cuisine-tag {
  background: #f3f4f6;
  color: var(--muted);
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}

.restaurant-card__meta {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.restaurant-card__meta span { display: flex; align-items: center; gap: 0.25rem; }

/* ── Menu page layout ────────────────────────────────────────────── */
.menu-layout {
  display: grid;
  grid-template-columns: 200px 1fr 340px;
  gap: 1.5rem;
  align-items: start;
}

/* Category sidebar */
.category-sidebar {
  position: sticky;
  top: 80px;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 0;
}

.category-sidebar a {
  display: block;
  padding: 0.6rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  border-left: 3px solid transparent;
  transition: all .15s;
}

.category-sidebar a:hover,
.category-sidebar a.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: #fff5f1;
}

/* Menu items */
.menu-section { margin-bottom: 2rem; }

.menu-section h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
}

.menu-items { display: flex; flex-direction: column; gap: 0.75rem; }

.menu-item {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 1rem;
  cursor: pointer;
  transition: box-shadow .2s;
}

.menu-item:hover { box-shadow: 0 4px 16px rgba(0,0,0,.12); }

.menu-item__image {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: #f3f4f6;
}

.menu-item__info { flex: 1; min-width: 0; }

.menu-item__name {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.menu-item__desc {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.menu-item__price {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--accent);
}

.menu-item__add {
  background: var(--accent);
  color: #fff;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .2s;
}
.menu-item__add:hover { background: var(--accent2); }

/* ── Cart panel ──────────────────────────────────────────────────── */
.cart-panel {
  position: sticky;
  top: 80px;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
  max-height: calc(100vh - 96px);
  overflow-y: auto;
}

.cart-panel h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.cart-empty {
  text-align: center;
  color: var(--muted);
  font-size: 0.875rem;
  padding: 2rem 0;
}

.cart-items { margin-bottom: 1rem; }

.cart-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}

.cart-item__name { flex: 1; font-size: 0.875rem; font-weight: 500; }
.cart-item__qty  { display: flex; align-items: center; gap: 0.4rem; }

.qty-btn {
  background: #f3f4f6;
  border: none;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qty-num { font-size: 0.875rem; font-weight: 600; min-width: 20px; text-align: center; }
.cart-item__price { font-weight: 600; font-size: 0.875rem; }

.cart-totals {
  padding-top: 0.75rem;
  font-size: 0.875rem;
}

.cart-totals .row {
  display: flex;
  justify-content: space-between;
  padding: 0.25rem 0;
  color: var(--muted);
}

.cart-totals .row.total {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  border-top: 1px solid var(--border);
  margin-top: 0.5rem;
  padding-top: 0.75rem;
}

.btn-checkout {
  display: block;
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.875rem;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 1rem;
  transition: background .2s;
  font-family: inherit;
}
.btn-checkout:hover { background: var(--accent2); }
.btn-checkout:disabled { background: #ccc; cursor: not-allowed; }

/* ── Checkout page ───────────────────────────────────────────────── */
.checkout-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 1.5rem;
  align-items: start;
}

.checkout-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}

.checkout-card h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
}

.form-group { margin-bottom: 1rem; }

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.7rem 0.875rem;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color .2s;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent);
}

#stripe-card-element {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 0.875rem;
  background: #fff;
  transition: border-color .2s;
}

#stripe-card-element.StripeElement--focus { border-color: var(--accent); }

#card-errors {
  color: #dc2626;
  font-size: 0.8rem;
  margin-top: 0.5rem;
}

/* ── Order status page ───────────────────────────────────────────── */
.status-card {
  max-width: 540px;
  margin: 3rem auto;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
  text-align: center;
}

.status-ref {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.status-badge {
  display: inline-block;
  padding: 0.4rem 1.25rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.status-badge.pending      { background: #fef3c7; color: #92400e; }
.status-badge.accepted     { background: #dbeafe; color: #1e40af; }
.status-badge.preparing    { background: #ede9fe; color: #5b21b6; }
.status-badge.ready        { background: #d1fae5; color: #065f46; }
.status-badge.out_for_delivery { background: #ffedd5; color: #9a3412; }
.status-badge.delivered    { background: #d1fae5; color: #065f46; }
.status-badge.cancelled    { background: #fee2e2; color: #991b1b; }

.status-steps {
  display: flex;
  justify-content: center;
  gap: 0;
  margin: 2rem 0;
  position: relative;
}

.status-steps::before {
  content: '';
  position: absolute;
  top: 18px;
  left: 10%;
  right: 10%;
  height: 2px;
  background: var(--border);
  z-index: 0;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  position: relative;
  z-index: 1;
}

.step__dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: background .3s;
}

.step.done .step__dot  { background: var(--accent); color: #fff; }
.step.active .step__dot { background: var(--dark); color: #fff; }

.step__label {
  font-size: 0.7rem;
  color: var(--muted);
  text-align: center;
}

.step.done .step__label,
.step.active .step__label { color: var(--text); font-weight: 600; }

/* ── Notifications / alerts ─────────────────────────────────────── */
.alert {
  padding: 0.875rem 1.25rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.alert-error   { background: #fee2e2; color: #991b1b; }
.alert-success { background: #d1fae5; color: #065f46; }
.alert-info    { background: #dbeafe; color: #1e40af; }

/* ── Spinner ─────────────────────────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Footer ──────────────────────────────────────────────────────── */
.site-footer {
  background: var(--dark);
  color: rgba(255,255,255,.5);
  text-align: center;
  padding: 2rem 1.5rem;
  font-size: 0.8rem;
  margin-top: 4rem;
}

.site-footer a { color: rgba(255,255,255,.7); }

/* ── Auth forms (login / register) ──────────────────────────────── */
.auth-card {
  max-width: 440px;
  margin: 3rem auto;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.5rem;
}

.auth-card h1 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: var(--dark);
}

.auth-card .auth-sub {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.auth-card .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
  color: var(--muted);
  font-size: 0.8rem;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-switch {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--muted);
}
.auth-switch a { color: var(--accent); font-weight: 600; }

.btn-primary {
  display: block;
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.875rem;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 1.25rem;
  transition: background .2s;
  font-family: inherit;
}
.btn-primary:hover    { background: var(--accent2); }
.btn-primary:disabled { background: #ccc; cursor: not-allowed; }

/* ── Account page ────────────────────────────────────────────────── */
.account-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.account-sidebar {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.account-sidebar__header {
  background: var(--dark);
  color: #fff;
  padding: 1.25rem;
}

.account-sidebar__name {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.account-sidebar__email {
  font-size: 0.8rem;
  color: rgba(255,255,255,.6);
}

.account-sidebar nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  font-size: 0.9rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}
.account-sidebar nav a:hover  { background: #f9fafb; }
.account-sidebar nav a.active { color: var(--accent); font-weight: 600; }

.account-section {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.account-section h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

/* Order history list */
.order-history-item {
  display: block;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  transition: box-shadow .15s;
  text-decoration: none;
  color: inherit;
}
.order-history-item:hover { box-shadow: var(--shadow); }

.order-history-item__ref {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.order-history-item__shop {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.order-history-item__meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--muted);
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .menu-layout {
    grid-template-columns: 1fr 300px;
  }
  .category-sidebar { display: none; }
}

@media (max-width: 768px) {
  .menu-layout,
  .checkout-layout {
    grid-template-columns: 1fr;
  }

  .cart-panel {
    position: static;
    max-height: none;
  }

  .cart-panel { order: -1; }
}

/* ── Customization Modal ─────────────────────────────────────────────────── */
.customize-modal {
  background: #fff;
  border-radius: 16px 16px 0 0;
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1.25rem 1.25rem .75rem;
  border-bottom: 1px solid var(--border);
}
.modal-title  { font-size: 1.1rem; font-weight: 700; color: var(--dark); }
.modal-desc   { font-size: .85rem; color: var(--muted); margin-top: .25rem; }
.modal-close  { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--muted); padding: .25rem; }
.modal-body   { overflow-y: auto; padding: .75rem 1.25rem; flex: 1; }
.modal-section { margin-bottom: 1.25rem; }
.modal-section-title { font-weight: 600; font-size: .9rem; color: var(--dark); margin-bottom: .5rem; }
.modal-option {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .625rem .75rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: .4rem;
  transition: border-color .15s;
}
.modal-option:hover          { border-color: var(--accent); }
.modal-option.selected       { border-color: var(--accent); background: #fff5f1; }
.modal-option input          { flex-shrink: 0; accent-color: var(--accent); }
.modal-option span:nth-child(2) { flex: 1; font-size: .9rem; }
.modal-option-price          { font-size: .85rem; color: var(--muted); }
.modal-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1rem;
}
.modal-qty   { display: flex; align-items: center; gap: .625rem; }
.modal-qty .qty-btn { width: 2rem; height: 2rem; border-radius: 50%; }
.modal-add   { flex: 1; }
.cart-item__notes { font-size: .75rem; color: var(--muted); margin-top: .15rem; }
.menu-item__image--placeholder {
  display: flex; align-items: center; justify-content: center; font-size: 2rem;
}
