/* =============================================
   ORDERING SYSTEM SPECIFIC STYLES
   ============================================= */

/* Page Setup */
.order-page-body {
  background-color: var(--color-bg);
}

/* ── HERO & TOGGLE ──────────────────────────── */
.order-hero {
  padding: 8rem 0 3rem;
  background: linear-gradient(135deg, #2C1810 0%, #3d2419 100%);
  border-bottom: 1px solid var(--color-border);
  text-align: center;
}
.order-type-switch-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}
.order-type-switch {
  position: relative;
  display: flex;
  width: 100%;
  max-width: 480px;
  background: rgba(255,255,255,.6);
  border-radius: var(--radius-full);
  padding: 0.4rem;
  box-shadow: inset 0 2px 6px rgba(0,0,0,.04);
  border: 1px solid var(--color-border);
}
.order-type-switch input[type="radio"] { display: none; }
.switch-label {
  position: relative;
  z-index: 2;
  flex: 1;
  text-align: center;
  padding: 0.8rem 1rem;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  color: var(--color-text-muted);
  transition: color var(--transition-med);
}
.order-type-switch input:checked + .switch-label { color: var(--color-white); }
.switch-slider {
  position: absolute;
  top: 0.4rem; bottom: 0.4rem;
  left: 0.4rem;
  width: calc(50% - 0.4rem);
  background: var(--grad-orange);
  border-radius: var(--radius-full);
  z-index: 1;
  transition: transform var(--transition-med);
  box-shadow: 0 4px 12px rgba(212,98,26,.3);
}
/* Ensure slider accommodates layout securely */

/* ── CATEGORIES BAR ─────────────────────────── */
.order-categories-bar {
  background: var(--color-white);
  padding: 1rem 0;
  position: sticky;
  top: 72px; /* below navbar */
  z-index: 90;
  box-shadow: 0 4px 20px rgba(0,0,0,.03);
}
.category-list {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 0.25rem;
}
.category-list::-webkit-scrollbar { display: none; }
.cat-btn {
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-muted);
  background: var(--color-bg);
  border: 1px solid transparent;
  white-space: nowrap;
  transition: all var(--transition-fast);
}
.cat-btn:hover { background: var(--color-bg-alt); }
.cat-btn.active {
  background: rgba(212,98,26,.1);
  color: var(--color-primary);
  border-color: rgba(212,98,26,.2);
}

/* ── MAIN CONTENT & PRODUCT GRID ────────────── */
.order-main { padding: 3rem 0 6rem; min-height: 50vh; }
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
}

.order-item-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform var(--transition-med), box-shadow var(--transition-med);
  position: relative;
  display: flex;
  flex-direction: column;
}
.order-item-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.order-item-img {
  width: 100%; height: 200px;
  object-fit: cover;
  border-bottom: 1px solid var(--color-border);
}
.order-item-body { padding: 1.5rem; flex-grow: 1; display: flex; flex-direction: column; }
.order-item-title { font-family: var(--font-serif); font-size: 1.25rem; font-weight: 700; margin-bottom: 0.5rem; }
.order-item-desc { font-size: 0.875rem; color: var(--color-text-muted); line-height: 1.5; margin-bottom: 1.5rem; flex-grow: 1; }
.order-item-footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.order-item-price { font-weight: 700; font-size: 1.1rem; color: var(--color-text); }
.add-to-cart-btn {
  background: var(--color-primary);
  color: var(--color-white);
  border-radius: var(--radius-full);
  padding: 0.5rem 1rem;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all var(--transition-fast);
}
.add-to-cart-btn:hover { background: var(--color-primary-dk); transform: translateY(-2px); box-shadow: 0 4px 12px rgba(212,98,26,.3); }

/* Item availability badge */
.not-available-overlay {
  position: absolute; inset: 0;
  background: rgba(255,255,255,.8);
  display: flex; align-items: center; justify-content: center;
  z-index: 10; backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none; transition: opacity var(--transition-med);
}
.not-available-overlay span {
  background: var(--color-dark); color: var(--color-white);
  padding: 0.5rem 1rem; border-radius: var(--radius-full);
  font-weight: 600; font-size: 0.85rem;
}
.order-item-card.unavailable .not-available-overlay { opacity: 1; pointer-events: all; }

/* ── CART DRAWER ────────────────────────────── */
.cart-drawer-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.4);
  z-index: 9999; opacity: 0; pointer-events: none; transition: opacity var(--transition-slow);
}
.cart-drawer-overlay.active { opacity: 1; pointer-events: all; }

.cart-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 100%; max-width: 420px;
  background: var(--color-white);
  z-index: 10000;
  box-shadow: -10px 0 30px rgba(0,0,0,.1);
  transform: translateX(100%);
  transition: transform 0.4s var(--ease);
  display: flex; flex-direction: column;
}
.cart-drawer.open { transform: translateX(0); }

.cart-header { padding: 1.5rem; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--color-border); }
.cart-title { font-size: 1.25rem; font-weight: 700; font-family: var(--font-serif); }
.close-cart-btn { font-size: 2rem; color: var(--color-text-muted); line-height: 1; }
.close-cart-btn:hover { color: var(--color-primary); }

.cart-method-info { padding: 1rem 1.5rem; background: var(--color-bg-alt); border-bottom: 1px solid var(--color-border); }
.method-badge { background: var(--grad-orange); color: white; padding: 0.2rem 0.6rem; border-radius: var(--radius-sm); font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; display: inline-block; margin-bottom: 0.4rem; }
.cart-method-info p { font-size: 0.85rem; color: var(--color-text-muted); }

.cart-items { flex-grow: 1; overflow-y: auto; padding: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
.empty-cart-msg { text-align: center; color: var(--color-text-muted); margin: auto; }
.empty-cart-msg .btn-primary { margin-top: 1rem; }

.cart-item { display: flex; gap: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--color-border); }
.cart-item-img { width: 60px; height: 60px; border-radius: var(--radius-sm); object-fit: cover; }
.cart-item-details { flex-grow: 1; }
.cart-item-name { font-weight: 600; font-size: 0.95rem; margin-bottom: 0.25rem; }
.cart-item-variant { font-size: 0.78rem; color: var(--color-text-muted); margin-bottom: 0.2rem; }
.cart-item-price { font-weight: 700; color: var(--color-primary); font-size: 0.9rem; margin-bottom: 0.5rem; }
.cart-item-controls { display: flex; align-items: center; gap: 0.5rem; }
.qty-btn { width: 24px; height: 24px; border-radius: 50%; background: var(--color-bg-alt); display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--color-text); }
.qty-btn:hover { background: var(--color-border); }
.qty-display { font-size: 0.85rem; font-weight: 600; width: 20px; text-align: center; }

.cart-footer { padding: 1.5rem; border-top: 1px solid var(--color-border); background: var(--color-white); }
.cart-summary-line { display: flex; justify-content: space-between; font-size: 0.9rem; color: var(--color-text-muted); margin-bottom: 0.5rem; }
.total-line { font-size: 1.2rem; font-weight: 700; color: var(--color-text); margin-top: 1rem; padding-top: 1rem; border-top: 1px dashed var(--color-border); margin-bottom: 1.5rem; }
.checkout-btn { width: 100%; justify-content: center; padding: 1rem; font-size: 1.05rem; }
.checkout-btn:disabled { opacity: 0.5; pointer-events: none; }

/* ── MODAL ──────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(4px);
  z-index: 10001; display: flex; align-items: center; justify-content: center; padding: 1rem;
  opacity: 0; pointer-events: none; transition: opacity var(--transition-med);
}
.modal-overlay.active { opacity: 1; pointer-events: all; }

.checkout-modal {
  background: var(--color-white);
  border-radius: var(--radius-xl);
  width: 100%; max-width: 600px; max-height: 90vh;
  overflow-y: auto; position: relative;
  transform: translateY(20px) scale(0.95); transition: all 0.4s var(--ease);
}
.modal-overlay.active .checkout-modal { transform: translateY(0) scale(1); }

.close-modal-btn { position: absolute; top: 1.5rem; right: 1.5rem; font-size: 2rem; color: var(--color-text-muted); line-height: 1; }
.close-modal-btn:hover { color: var(--color-text); }

.modal-content { padding: 3rem 2.5rem; }
.modal-content h2 { font-family: var(--font-serif); font-size: 2rem; margin-bottom: 0.5rem; }
.modal-subtitle { color: var(--color-text-muted); margin-bottom: 2rem; }

.form-section { margin-bottom: 2rem; }
.form-section h3 { font-size: 1rem; font-weight: 700; border-bottom: 2px solid var(--color-bg-alt); padding-bottom: 0.5rem; margin-bottom: 1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.checkout-form input {
  width: 100%; padding: 0.8rem 1rem; border-radius: var(--radius-sm); border: 1px solid var(--color-border);
  font-family: inherit; font-size: 0.9rem; background: var(--color-bg); margin-bottom: 1rem;
}
.checkout-form input:last-child { margin-bottom: 0; }
.form-row input, .form-row select { margin-bottom: 0; width: 100%; height: 46px; box-sizing: border-box; }
.checkout-form input:focus { outline: none; border-color: var(--color-primary); background: var(--color-white); }
.checkout-form select {
  width: 100%; padding: 0.8rem 1rem; border-radius: var(--radius-sm); border: 1px solid var(--color-border);
  font-family: inherit; font-size: 0.9rem; background: var(--color-bg); margin-bottom: 1rem;
  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 d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 1rem center; cursor: pointer;
}
.checkout-form select:focus { outline: none; border-color: var(--color-primary); background-color: var(--color-white); }
.hidden { display: none !important; }

.payment-step-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.payment-step-header h2 { margin: 0; font-family: var(--font-serif); font-size: 1.75rem; }
.back-link { background: none; border: none; color: var(--color-primary); font-weight: 600; font-size: 0.9rem; cursor: pointer; padding: 0; white-space: nowrap; }
.back-link:hover { text-decoration: underline; }
.order-mini-summary { background: var(--color-bg-alt); border-radius: var(--radius-md); padding: 1rem 1.25rem; margin-bottom: 1.5rem; font-size: 0.9rem; }
.mini-item { color: var(--color-text-muted); padding: 0.2rem 0; }
.mini-total { font-weight: 700; color: var(--color-text); margin-top: 0.5rem; padding-top: 0.5rem; border-top: 1px solid var(--color-border); }
.payment-error { color: #dc2626; font-size: 0.875rem; margin-bottom: 1rem; background: #fef2f2; padding: 0.75rem 1rem; border-radius: var(--radius-sm); }
.payment-divider { display: flex; align-items: center; gap: 0.75rem; margin: 0.75rem 0; color: var(--color-text-muted); font-size: 0.8rem; }
.payment-divider::before, .payment-divider::after { content: ''; flex: 1; height: 1px; background: var(--color-border); }

.checkout-success { text-align: center; padding: 2rem 0; }
.success-icon { width: 80px; height: 80px; border-radius: 50%; background: var(--color-accent); color: white; font-size: 3rem; display: flex; align-items: center; justify-content: center; margin: 0 auto 1.5rem; }

/* ── DRAG HANDLES ───────────────────────────── */
.cart-drag-handle, .modal-drag-handle {
  width: 40px; height: 4px;
  background: var(--color-border);
  border-radius: 2px;
  margin: 0.75rem auto 0;
  flex-shrink: 0;
}

/* ── CHECKOUT STEP PROGRESS ─────────────────── */
.checkout-progress {
  display: flex; align-items: center; justify-content: center;
  gap: 0.5rem; padding: 1rem 2rem 0;
}
.checkout-step {
  display: flex; align-items: center; gap: 0.4rem;
  opacity: 0.35; transition: opacity 0.3s;
}
.checkout-step.active { opacity: 1; }
.checkout-step span {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--color-bg-alt); border: 2px solid var(--color-border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700; color: var(--color-text-muted);
  transition: all 0.3s;
}
.checkout-step.active span {
  background: var(--color-primary); border-color: var(--color-primary);
  color: white;
}
.checkout-step label {
  font-size: 0.75rem; font-weight: 600;
  color: var(--color-text-muted); cursor: default;
}
.checkout-step.active label { color: var(--color-primary); }
.checkout-step-line {
  flex: 1; max-width: 60px; height: 2px;
  background: var(--color-border); border-radius: 1px;
}

/* Responsive Nav Override for Order Page */
.nav-cart-btn { background: var(--color-bg-alt); padding: 0.4rem 1rem; border-radius: var(--radius-full); font-weight: 600; font-size: 0.9rem; display: flex; align-items: center; gap: 0.5rem; transition: all var(--transition-fast); }
.nav-cart-btn:hover { background: var(--color-primary); color: white; }
.nav-cart-btn span { background: var(--color-primary); color: white; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; border-radius: 50%; font-size: 0.7rem; }
.nav-cart-btn:hover span { background: white; color: var(--color-primary); }

.mobile-cart-btn { display: none; }
@media (max-width: 768px) {
  #navLinks .nav-cart-btn { display: none; }
  .mobile-cart-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: var(--color-primary);
    color: white;
    border-radius: var(--radius-full);
    padding: 0.45rem 0.9rem;
    font-size: 1rem;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(212,98,26,.4);
    transition: background var(--transition-fast), transform var(--transition-fast);
  }
  .mobile-cart-btn:active { transform: scale(0.95); }
  .mobile-cart-btn span {
    background: white;
    color: var(--color-primary);
    min-width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 800;
    line-height: 1;
  }

  /* ═══ BOTTOM SHEET: CART DRAWER ═══ */
  .cart-drawer {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    max-width: 100%;
    width: 100%;
    max-height: 88dvh;
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
    box-shadow: 0 -8px 40px rgba(0,0,0,.15);
  }
  .cart-drawer.open { transform: translateY(0); }
  .cart-drag-handle {
    width: 48px; height: 5px;
    background: #D1C4B0;
    border-radius: 3px;
    margin: 10px auto 0;
  }
  .cart-header { padding: 1rem 1.25rem; }
  .cart-title { font-size: 1.1rem; }
  .close-cart-btn { font-size: 1.75rem; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; }
  .cart-items { padding: 0.75rem 1.25rem; }
  .cart-item-img { width: 68px; height: 68px; border-radius: 10px; }
  .cart-item-name { font-size: 1rem; }
  .qty-btn { width: 34px; height: 34px; font-size: 1.1rem; border-radius: 10px; }
  .qty-display { font-size: 1rem; width: 28px; }
  .cart-footer { padding: 1rem 1.25rem 1.25rem; }
  .total-line { font-size: 1.1rem; margin-top: 0.75rem; padding-top: 0.75rem; margin-bottom: 1rem; }
  .checkout-btn { padding: 1rem; font-size: 1rem; border-radius: 14px; min-height: 52px; }

  /* ═══ FULL-SCREEN SHEET: CHECKOUT MODAL ═══ */
  .modal-overlay {
    padding: 0;
    align-items: flex-end;
  }
  .checkout-modal {
    max-width: 100%;
    width: 100%;
    max-height: 96dvh;
    border-radius: 20px 20px 0 0;
    transform: translateY(60px) scale(1);
  }
  .modal-overlay.active .checkout-modal { transform: translateY(0) scale(1); }
  .modal-drag-handle {
    width: 48px; height: 5px;
    background: #D1C4B0;
    border-radius: 3px;
    margin: 10px auto 0;
  }
  .checkout-progress { padding: 0.75rem 1.5rem 0; }
  .modal-content { padding: 1.5rem 1.25rem 2rem; }
  .modal-content h2 { font-size: 1.6rem; margin-bottom: 0.25rem; }
  .modal-subtitle { font-size: 0.9rem; margin-bottom: 1.5rem; }
  .close-modal-btn {
    top: 0.85rem; right: 1rem;
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem;
    background: var(--color-bg-alt);
    border-radius: 50%;
  }

  /* ═══ FORM: PREVENT iOS ZOOM + BIG TARGETS ═══ */
  .checkout-form input,
  .checkout-form select {
    font-size: 16px !important;
    min-height: 52px;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    margin-bottom: 0.75rem;
  }
  .form-row { gap: 0.75rem; }
  .form-row input, .form-row select { min-height: 52px; }
  .form-section { margin-bottom: 1.5rem; }
  .form-section h3 { font-size: 0.85rem; }

  /* ═══ PAYMENT STEP MOBILE ═══ */
  .payment-step-header { margin-bottom: 1rem; }
  .payment-step-header h2 { font-size: 1.4rem; }
  .back-link { font-size: 0.95rem; padding: 0.5rem 0; min-height: 44px; display: flex; align-items: center; }
  .order-mini-summary { padding: 0.85rem 1rem; margin-bottom: 1rem; }

  /* ═══ PRODUCT GRID ═══ */
  .product-grid { grid-template-columns: 1fr 1fr; gap: 1rem; }
  .order-item-img { height: 140px; }
  .order-item-body { padding: 0.85rem; }
  .order-item-title { font-size: 1rem; }
  .order-item-desc { font-size: 0.78rem; margin-bottom: 1rem; }
  .add-to-cart-btn { padding: 0.55rem 0.85rem; font-size: 0.8rem; }

  /* ═══ CATEGORIES BAR ═══ */
  .cat-btn { padding: 0.55rem 1rem; font-size: 0.82rem; }
  .order-categories-bar { top: 60px; }
}
