/* ==========================================================================
   KING LEE DIMSUM — ORDER PAGE STYLESHEET (Phase 1: UI only)
   Load AFTER assets/css/style.css — reuses the existing :root variables,
   .glass-card, .btn, .chop, .inquiry-overlay/.inquiry-modal patterns.
   Does NOT redefine brand colors, radii, or shadows.

   TABLE OF CONTENTS
   1. Order Page Shell / Header
   2. Category Filter Tabs
   3. Menu Grid (ordering variant of .menu-card)
   4. Floating Cart Button
   5. Cart Modal (reuses .inquiry-overlay / .inquiry-modal)
   6. Checkout Form + Confirmation
   7. Responsive
   ========================================================================== */

/* ==========================================================================
   1. ORDER PAGE SHELL / HEADER
   ========================================================================== */
.order-page-body {
  background: var(--color-offwhite);
}

.order-hero {
  padding: 150px 0 40px;
  text-align: center;
  background: linear-gradient(180deg, var(--color-cream) 0%, var(--color-offwhite) 100%);
}

.order-hero .eyebrow { justify-content: center; }

.order-hero h1 {
  margin-bottom: 12px;
}

.order-hero p {
  max-width: 520px;
  margin: 0 auto;
}

/* ==========================================================================
   2. CATEGORY FILTER TABS
   ========================================================================== */
.order-filters {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 32px 0 8px;
}

.order-filter-btn {
  padding: 10px 22px;
  border-radius: var(--radius-round);
  border: 1.5px solid rgba(139, 30, 30, 0.15);
  background: var(--color-white);
  color: var(--color-text-soft);
  font-weight: 600;
  font-size: 0.86rem;
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition);
}

.order-filter-btn:hover {
  transform: translateY(-2px);
  border-color: var(--color-gold);
}

.order-filter-btn.active {
  background: linear-gradient(135deg, var(--color-red) 0%, var(--color-red-light) 100%);
  border-color: transparent;
  color: var(--color-cream);
  box-shadow: var(--shadow-soft);
}

/* ==========================================================================
   3. MENU GRID (ordering variant)
   ========================================================================== */
.order-menu-section {
  padding: 24px 0 var(--section-pad);
}

.order-menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 28px;
}

.order-item-card {
  padding: 22px 20px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.order-item-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-med);
  border-color: rgba(212, 175, 55, 0.5);
}

.order-item-photo {
  width: 128px;
  height: 128px;
  min-width: 128px;
  min-height: 128px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: 0 0 0 6px var(--color-cream), 0 0 0 8px rgba(212, 175, 55, 0.5);
}
.order-item-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.order-item-card h3 {
  font-size: 1.05rem;
  margin-bottom: 6px;
}

.order-item-desc {
  font-size: 0.84rem;
  margin-bottom: 14px;
  flex-grow: 1;
}

.order-item-price {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--color-red);
  font-size: 1.15rem;
  margin-bottom: 14px;
}

.order-item-add-btn {
  width: 100%;
  padding: 11px 18px;
  font-size: 0.86rem;
}

/* Quantity stepper shown once an item is in the cart */
.order-item-stepper {
  display: none;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: var(--color-cream);
  border-radius: var(--radius-round);
  padding: 6px 8px;
}
.order-item-stepper.active {
  display: flex;
}
.order-item-add-btn.hidden {
  display: none;
}
.order-item-stepper button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-white);
  color: var(--color-red);
  font-weight: 700;
  font-size: 1rem;
  box-shadow: 0 2px 6px rgba(139, 30, 30, 0.12);
  transition: background var(--transition), color var(--transition);
}
.order-item-stepper button:hover {
  background: var(--color-red);
  color: var(--color-cream);
}
.order-item-stepper .stepper-qty {
  font-weight: 700;
  color: var(--color-text);
  min-width: 24px;
  text-align: center;
}

.order-empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--color-text-soft);
  grid-column: 1 / -1;
}
.order-empty-state i {
  font-size: 2rem;
  color: var(--color-gold);
  margin-bottom: 12px;
  display: block;
}

/* ==========================================================================
   4. FLOATING CART BUTTON
   ========================================================================== */
.cart-fab {
  position: fixed;
  right: 26px;
  bottom: 26px;
  z-index: 2500;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 24px;
  border-radius: var(--radius-round);
  background: linear-gradient(135deg, var(--color-red) 0%, var(--color-red-light) 100%);
  color: var(--color-cream);
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: var(--shadow-med);
  transition: transform var(--transition), box-shadow var(--transition);
  transform: translateY(120%);
  opacity: 0;
}
.cart-fab.visible {
  transform: translateY(0);
  opacity: 1;
}
.cart-fab:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 22px 40px rgba(139, 30, 30, 0.28);
}
.cart-fab-badge {
  background: var(--color-gold);
  color: var(--color-red-deep);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 800;
}
.cart-fab-total {
  border-left: 1px solid rgba(255, 247, 232, 0.35);
  padding-left: 10px;
}

/* ==========================================================================
   5. CART / CHECKOUT MODAL SHELL
   Reuses .inquiry-overlay / .inquiry-modal from style.css, but style.css
   only styles the CLOSE BUTTON and MODAL HEADER for #inquiryOverlay
   specifically (by ID) and for .admin-login-box — it does not have a
   generic rule any other overlay can inherit. Without the block below,
   the × has no positioning (floats top-center, no circle background) and
   any .inquiry-modal-header content (like the checkout logo) has no size
   constraint and renders at native size. This block fixes both, scoped
   to #cartOverlay / #checkoutOverlay only — style.css itself is untouched.
   ========================================================================== */
#cartOverlay .inquiry-modal,
#checkoutOverlay .inquiry-modal {
  max-width: 480px;
}

/* --- Close button (mirrors #inquiryOverlay .inquiry-close from style.css) --- */
#cartOverlay .inquiry-close,
#checkoutOverlay .inquiry-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  line-height: 1;
  color: var(--color-red);
  background: var(--color-cream);
  box-shadow: 0 6px 18px rgba(28, 15, 15, 0.3), 0 0 0 3px rgba(212, 175, 55, 0.55);
  transition: background var(--transition), color var(--transition), transform var(--transition), box-shadow var(--transition);
  z-index: 20;
}
#cartOverlay .inquiry-close:hover,
#cartOverlay .inquiry-close:focus-visible,
#checkoutOverlay .inquiry-close:hover,
#checkoutOverlay .inquiry-close:focus-visible {
  background: var(--color-gold);
  color: var(--color-red-deep);
  transform: rotate(90deg) scale(1.08);
  box-shadow: 0 8px 22px rgba(28, 15, 15, 0.35), 0 0 0 3px rgba(212, 175, 55, 0.85);
}
#cartOverlay .inquiry-close i,
#checkoutOverlay .inquiry-close i {
  pointer-events: none;
}

/* --- Checkout header: red gradient band + real logo.png (not the giant
   unconstrained SVG chop that style.css only sizes for #inquiryOverlay) --- */
#checkoutOverlay .inquiry-modal-header {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 26px 76px 26px 28px;
  background: linear-gradient(135deg, var(--color-red) 0%, var(--color-red-deep) 100%);
  flex-shrink: 0;
  overflow: hidden;
}
#checkoutOverlay .inquiry-modal-header::before {
  content: "";
  position: absolute;
  top: -60%;
  right: -20%;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.28), transparent 70%);
  pointer-events: none;
}
#checkoutOverlay .header-logo {
  position: relative;
  width: 46px;
  height: 46px;
  min-width: 46px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.65);
}
#checkoutOverlay .header-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
#checkoutOverlay .header-text {
  position: relative;
  min-width: 0;
}
#checkoutOverlay .header-text .eyebrow {
  color: var(--color-gold-light);
  margin-bottom: 4px;
}
#checkoutOverlay .header-text .eyebrow::before {
  background: var(--color-gold-light);
}
#checkoutOverlay .inquiry-modal-header h3 {
  color: var(--color-cream);
  margin-bottom: 0;
  font-size: 1.3rem;
}
#checkoutOverlay .inquiry-modal-scroll {
  padding: 30px 28px 28px;
}

/* --- Checkout form fields: icon-led inputs (style.css only defines these
   for #inquiryOverlay's .field-group/.field-wrap, not #checkoutOverlay) --- */
#checkoutOverlay .field-group {
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#checkoutOverlay .field-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-red);
  letter-spacing: 0.02em;
}
#checkoutOverlay .field-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
#checkoutOverlay .field-wrap.field-wrap--top {
  align-items: flex-start;
}
#checkoutOverlay .field-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-red);
  opacity: 0.55;
  pointer-events: none;
  font-size: 0.95rem;
}
#checkoutOverlay .field-wrap.field-wrap--top .field-icon {
  top: 15px;
  transform: none;
}
#checkoutOverlay .field-wrap input,
#checkoutOverlay .field-wrap textarea,
#checkoutOverlay .field-wrap select {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.94rem;
  padding: 13px 16px 13px 44px;
  border: 1.5px solid rgba(139, 30, 30, 0.15);
  border-radius: var(--radius-sm);
  background: var(--color-white);
  color: var(--color-text);
  transition: border-color var(--transition), box-shadow var(--transition);
  resize: vertical;
  appearance: none;
}
#checkoutOverlay .field-wrap select {
  cursor: pointer;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238B1E1E' stroke-width='2'%3e%3cpath d='M6 9l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  padding-right: 40px;
}
#checkoutOverlay .field-wrap input:focus,
#checkoutOverlay .field-wrap textarea:focus,
#checkoutOverlay .field-wrap select:focus {
  outline: none;
  border-color: var(--color-gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.18);
}

.cart-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}

.cart-line {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(139, 30, 30, 0.08);
}
.cart-line:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.cart-line-photo {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px var(--color-cream), 0 0 0 4px rgba(212, 175, 55, 0.4);
}
.cart-line-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-line-info {
  flex-grow: 1;
  min-width: 0;
}
.cart-line-info strong {
  display: block;
  font-size: 0.92rem;
  color: var(--color-text);
}
.cart-line-info span {
  font-size: 0.8rem;
  color: var(--color-text-soft);
}

.cart-line-stepper {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.cart-line-stepper button {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--color-cream);
  color: var(--color-red);
  font-weight: 700;
  transition: background var(--transition), color var(--transition);
}
.cart-line-stepper button:hover {
  background: var(--color-red);
  color: var(--color-cream);
}
.cart-line-remove {
  color: var(--color-text-soft);
  opacity: 0.6;
  flex-shrink: 0;
  font-size: 0.9rem;
  transition: opacity var(--transition), color var(--transition);
}
.cart-line-remove:hover {
  opacity: 1;
  color: #c0392b;
}

.cart-empty {
  text-align: center;
  padding: 30px 10px;
  color: var(--color-text-soft);
}
.cart-empty i {
  font-size: 1.8rem;
  color: var(--color-gold);
  display: block;
  margin-bottom: 10px;
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 1.5px dashed rgba(139, 30, 30, 0.15);
  margin-bottom: 18px;
}
.cart-summary-row strong {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--color-red);
}

/* ==========================================================================
   6. CHECKOUT FORM + CONFIRMATION
   ========================================================================== */
.checkout-order-summary {
  background: var(--color-cream);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 20px;
  font-size: 0.86rem;
  color: var(--color-text-soft);
}
.checkout-order-summary strong {
  color: var(--color-red);
}

.checkout-error {
  background: #fdecec;
  color: #8B1E1E;
  border-left: 4px solid #c0392b;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.85rem;
  margin-bottom: 18px;
}

.order-confirm {
  text-align: center;
  padding: 10px 0 6px;
}
.order-confirm-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: linear-gradient(155deg, var(--color-gold-light), var(--color-gold));
  color: var(--color-red-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.9rem;
  box-shadow: var(--shadow-gold);
  animation: success-pop 0.5s var(--ease) both;
}
.order-confirm-number {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--color-red);
  letter-spacing: 0.04em;
  margin: 6px 0 14px;
}
.order-confirm-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: var(--radius-round);
  background: #fdf1e0;
  color: #8a6100;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 18px;
}
.order-confirm p.confirm-note {
  font-size: 0.9rem;
  max-width: 340px;
  margin: 0 auto;
}

/* ==========================================================================
   7. RESPONSIVE
   ========================================================================== */
@media (max-width: 620px) {
  .order-menu-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
  .order-item-photo { width: 96px; height: 96px; min-width: 96px; min-height: 96px; }
  .cart-fab { right: 16px; bottom: 16px; padding: 14px 18px; }
  .cart-fab-total { display: none; }
}