/* =========================================================
   Bedrock Cafe Solutions — Customer-facing e-commerce styles
   ========================================================= */

body { background: var(--background); }

/* ---------- Header ---------- */
.cust-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  box-shadow: 0 1px 0 rgba(0,0,0,0.02);
}
.cust-header-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cust-header .back-btn {
  background: var(--background); border: 1px solid var(--border); border-radius: 50%;
  width: 36px; height: 36px; flex-shrink: 0; font-size: 1rem; color: var(--text);
  display: flex; align-items: center; justify-content: center;
}
.cust-header .brand { display: flex; align-items: center; gap: 9px; font-weight: 800; min-width: 0; letter-spacing: -0.01em; }
.cust-header .brand img,
.cust-header .brand .brand-fallback-icon {
  width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
  background: var(--primary-light);
}
.cust-header .brand .brand-fallback-icon { display: flex; align-items: center; justify-content: center; color: var(--primary); font-size: 1rem; }
.cust-header .brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cust-header-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.nav-icon-link {
  position: relative; flex-shrink: 0;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--background); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; color: var(--text);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.nav-icon-link:hover { border-color: var(--primary); color: var(--primary); }

.nav-cart-link {
  position: relative; flex-shrink: 0;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--background); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem; color: var(--text);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.nav-cart-link:hover { border-color: var(--primary); color: var(--primary); }
.nav-cart-badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 19px; height: 19px; padding: 0 4px; border-radius: 999px;
  background: var(--primary); color: #fff; font-size: 0.66rem; font-weight: 800;
  display: none; align-items: center; justify-content: center;
  border: 2px solid var(--surface);
}
.nav-cart-badge.visible { display: flex; }

/* ---------- Hero / order-type screen ---------- */
.cust-hero {
  padding: 36px 20px 22px;
  text-align: center;
  background: linear-gradient(180deg, var(--primary-light) 0%, var(--background) 100%);
}
.cust-hero .hero-icon { font-size: 2.2rem; margin-bottom: 10px; }
.cust-hero h1 { margin-bottom: 6px; }
.cust-hero p.muted { max-width: 320px; margin: 0 auto; }

.order-type-grid {
  display: grid; grid-template-columns: 1fr; gap: 16px;
  padding: 8px 16px 40px; max-width: 520px; margin: 0 auto;
}
@media (min-width: 560px) { .order-type-grid { grid-template-columns: 1fr 1fr; } }

.order-type-card {
  position: relative;
  background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius-lg);
  padding: 28px 20px; text-align: center; cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.order-type-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.order-type-card.recommended { border-color: var(--primary); background: var(--primary-light); }
.order-type-card .recommended-tag {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  background: var(--primary); color: #fff; font-size: 0.66rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.04em; padding: 4px 12px; border-radius: 999px;
}
.order-type-card .icon-badge {
  width: 60px; height: 60px; border-radius: 50%; margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center; font-size: 1.6rem;
  background: var(--surface); color: var(--primary); box-shadow: var(--shadow-sm);
}
.order-type-card h3 { margin-bottom: 4px; }

.scan-divider { display: flex; align-items: center; gap: 12px; max-width: 480px; margin: 4px auto 18px; padding: 0 16px; color: var(--muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
.scan-divider::before, .scan-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ---------- Category nav ---------- */
.category-nav {
  position: sticky; top: 65px; z-index: 40;
  background: var(--background);
  display: flex; gap: 8px; padding: 12px 16px; overflow-x: auto;
  border-bottom: 1px solid var(--border);
}
.category-chip {
  padding: 9px 18px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); white-space: nowrap; font-weight: 700; font-size: 0.85rem;
  transition: all 0.15s ease;
}
.category-chip.active { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: var(--shadow-sm); }

.search-bar { padding: 14px 16px 4px; max-width: 1100px; margin: 0 auto; width: 100%; }
.search-wrap { position: relative; }
.search-wrap input.input { border-radius: 999px; padding-left: 40px; height: 46px; }
.search-wrap svg, .search-wrap i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }

/* ---------- Product grid (e-commerce style) ---------- */
.menu-section-title {
  max-width: 1100px; margin: 22px auto 12px; padding: 0 16px;
  display: flex; align-items: baseline; justify-content: space-between;
}
.menu-section-title h2 { font-size: 1.2rem; }
.menu-section-title .count { color: var(--muted); font-size: 0.82rem; }

.menu-list {
  max-width: 1100px; margin: 0 auto; padding: 8px 16px 60px;
  display: grid; gap: 16px;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 560px) { .menu-list { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 860px) { .menu-list { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1100px) { .menu-list { grid-template-columns: repeat(5, 1fr); } }

.menu-item-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  overflow: hidden; display: flex; flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  cursor: pointer; position: relative;
}
.menu-item-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--border); }

.menu-item-card .thumb-wrap { position: relative; width: 100%; aspect-ratio: 1 / 1; background: var(--border); overflow: hidden; }
.menu-item-card .thumb-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.25s ease; }
.menu-item-card:hover .thumb-wrap img { transform: scale(1.04); }
.menu-item-card .unavailable-overlay {
  position: absolute; inset: 0; background: rgba(255,255,255,0.72);
  display: flex; align-items: center; justify-content: center;
}
.menu-item-card .unavailable-overlay span {
  background: var(--text); color: #fff; font-size: 0.66rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.04em; padding: 5px 12px; border-radius: 999px;
}

.menu-item-card .info { padding: 10px 12px 12px; flex: 1; display: flex; flex-direction: column; }
.menu-item-card .info h3 {
  font-size: 0.88rem; font-weight: 700; line-height: 1.25; margin-bottom: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.2em;
}
.rating-row { display: flex; align-items: center; gap: 4px; font-size: 0.74rem; color: var(--muted); margin-bottom: 6px; }
.rating-row i { color: #f5a623; font-size: 0.7rem; }
.menu-item-card .info .cat-tag { font-size: 0.68rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; margin-bottom: 6px; }
.featured-tag {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  background: var(--primary); color: #fff; font-size: 0.62rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.03em; padding: 4px 9px; border-radius: 999px;
  box-shadow: var(--shadow-sm);
}
.menu-item-card .price-row { display: flex; align-items: center; justify-content: space-between; margin-top: auto; gap: 6px; }
.menu-item-card .price { font-weight: 800; color: var(--primary); font-size: 0.86rem; white-space: nowrap; }

.add-btn {
  background: var(--primary); color: #fff; border: none; border-radius: 999px;
  min-width: 60px; height: 32px; padding: 0 16px; font-weight: 700; font-size: 0.78rem; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s ease, transform 0.1s ease;
}
.add-btn:hover { background: var(--primary-dark); }
.add-btn:active { transform: scale(0.95); }

.qty-stepper { display: flex; align-items: center; gap: 8px; background: var(--primary-light); border-radius: 999px; padding: 3px; }
.qty-stepper button {
  width: 24px; height: 24px; border-radius: 50%; border: none; background: var(--surface); font-weight: 800; color: var(--primary);
  display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-sm);
}
.qty-stepper span { min-width: 14px; text-align: center; font-weight: 700; font-size: 0.8rem; }

/* ---------- Cart drawer / page ---------- */
.cart-drawer { padding: 20px 16px 40px; max-width: 680px; margin: 0 auto; }
.cart-line { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.cart-line img { width: 68px; height: 68px; border-radius: var(--radius-sm); object-fit: cover; background: var(--border); flex-shrink: 0; aspect-ratio: 1/1; }
.cart-line .info { flex: 1; min-width: 0; }
.cart-line .modifiers { font-size: 0.78rem; color: var(--muted); }
.cart-line .remove-btn { color: var(--danger); font-size: 0.78rem; background: none; border: none; margin-top: 4px; font-weight: 600; }

.summary-row { display: flex; justify-content: space-between; font-size: 0.9rem; margin-bottom: 6px; }
.summary-row.total { font-size: 1.1rem; font-weight: 800; margin-top: 8px; }

.empty-cart { text-align: center; padding: 70px 20px; }

/* ---------- Status tracker ---------- */
.status-tracker { padding: 28px 16px 40px; max-width: 560px; margin: 0 auto; }
.status-steps { display: flex; justify-content: space-between; margin: 26px 0 8px; position: relative; }
.status-steps::before { content: ''; position: absolute; top: 15px; left: 5%; right: 5%; height: 3px; background: var(--border); z-index: 0; }
.status-step { display: flex; flex-direction: column; align-items: center; gap: 6px; z-index: 1; flex: 1; }
.status-step .dot {
  width: 32px; height: 32px; border-radius: 50%; background: var(--surface); border: 3px solid var(--border);
  display: flex; align-items: center; justify-content: center; font-size: 0.9rem; color: var(--muted);
}
.status-step.done .dot { background: var(--success); border-color: var(--success); color: #fff; }
.status-step.current .dot { background: var(--primary); border-color: var(--primary); color: #fff; }
.status-step span.label { font-size: 0.7rem; color: var(--muted); text-align: center; }
.status-step.done span.label, .status-step.current span.label { color: var(--text); font-weight: 700; }

.order-summary-card { padding: 16px; }

/* ---------- Breadcrumb ---------- */
.breadcrumb-nav {
  max-width: 680px; margin: 0 auto; padding: 12px 16px 0;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 0.78rem; color: var(--muted);
}
.breadcrumb-nav a { color: var(--muted); font-weight: 600; }
.breadcrumb-nav a:hover { color: var(--primary); }
.breadcrumb-nav i { font-size: 0.6rem; opacity: 0.6; }
.breadcrumb-nav span { color: var(--text); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }

/* ---------- Dish detail page ---------- */
.product-image-frame { max-width: 680px; margin: 16px auto 0; padding: 0 16px; }
.product-image-frame .image-card {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-sm);
  display: flex; align-items: center; justify-content: center;
}
.product-image-frame img {
  width: 100%; max-width: 380px; aspect-ratio: 1 / 1; object-fit: cover;
  border-radius: var(--radius-md); display: block;
}

.dish-detail-body { max-width: 680px; margin: 0 auto; padding: 20px 16px 40px; }
.dish-detail-body .cat-tag { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; }
.dish-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.dish-title-row h1 { flex: 1; min-width: 0; }
.rating-pill {
  flex-shrink: 0; display: flex; align-items: center; gap: 5px;
  background: var(--warning-bg); color: #8a6112; font-weight: 700; font-size: 0.82rem;
  padding: 6px 11px; border-radius: 999px; white-space: nowrap;
}
.rating-pill i { color: #f5a623; }
.rating-pill .muted { color: #8a6112; opacity: 0.75; font-weight: 600; }

.dish-detail-body .price-lg { font-size: 1.5rem; font-weight: 800; color: var(--primary); margin-bottom: 14px; }
.dish-detail-body .description { color: var(--text); line-height: 1.65; margin-bottom: 16px; }

.highlight-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.highlight-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--background); border: 1px solid var(--border);
  padding: 6px 12px; border-radius: 999px; font-size: 0.76rem; font-weight: 600; color: var(--text);
}
.highlight-chip i { color: var(--primary); font-size: 0.72rem; }

.detail-section { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--border); }
.detail-section h3 { font-size: 1rem; margin-bottom: 4px; }
.detail-section .section-hint { font-size: 0.78rem; margin-bottom: 12px; }

.modifier-option {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  margin-bottom: 8px; cursor: pointer; transition: border-color 0.15s ease, background 0.15s ease;
}
.modifier-option:hover { border-color: var(--primary); }
.modifier-option.checked { border-color: var(--primary); background: var(--primary-light); }
.modifier-option .mod-name { font-weight: 600; font-size: 0.9rem; }
.modifier-option .mod-price { font-size: 0.82rem; color: var(--muted); }

/* Inline "Add to Cart" action row — deliberately placed after customization inputs, not floated */
.add-to-cart-section { border-top: none; margin-top: 24px; padding-top: 0; }
.add-to-cart-row {
  display: flex; align-items: stretch; gap: 12px;
  background: var(--background); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 12px;
}
.add-to-cart-row .qty-stepper { background: var(--surface); flex-shrink: 0; }
.add-to-cart-row .qty-stepper button { width: 34px; height: 34px; }
.add-to-cart-row .btn { flex: 1; min-height: 50px; font-size: 0.95rem; }
@media (max-width: 380px) {
  .add-to-cart-row { flex-direction: column; }
  .add-to-cart-row .qty-stepper { align-self: center; }
}

/* ---------- Recommended dishes ---------- */
.recommended-section { max-width: 1100px; margin: 8px auto 0; padding: 0 16px 24px; }
.recommended-section h2 { font-size: 1.1rem; margin-bottom: 12px; padding: 0 0; }
.recommended-scroll {
  display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; -webkit-overflow-scrolling: touch;
}
.recommended-card {
  flex: 0 0 150px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  overflow: hidden; cursor: pointer; transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.recommended-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.recommended-card .thumb { width: 100%; aspect-ratio: 1/1; background: var(--border); overflow: hidden; }
.recommended-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.recommended-card .info { padding: 8px 10px 10px; }
.recommended-card .info h4 { font-size: 0.8rem; font-weight: 700; margin-bottom: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.1em; }
.recommended-card .info .price { font-size: 0.78rem; font-weight: 800; color: var(--primary); }

/* ---------- Pickup scheduling ---------- */
.pickup-options { display: flex; gap: 10px; margin-bottom: 14px; }
.pickup-option-btn {
  flex: 1; padding: 14px 10px; border: 2px solid var(--border); border-radius: var(--radius-md);
  text-align: center; cursor: pointer; background: var(--surface); transition: all 0.15s ease;
}
.pickup-option-btn:hover { border-color: var(--primary); }
.pickup-option-btn.active { border-color: var(--primary); background: var(--primary-light); }
.pickup-option-btn i { font-size: 1.2rem; color: var(--primary); margin-bottom: 6px; display: block; }
.pickup-option-btn .pickup-option-label { font-weight: 700; font-size: 0.88rem; }
.pickup-option-btn .pickup-option-sub { font-size: 0.74rem; color: var(--muted); margin-top: 2px; }

.pickup-time-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.pickup-time-chip {
  padding: 9px 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  font-weight: 700; font-size: 0.82rem; cursor: pointer; transition: all 0.15s ease;
}
.pickup-time-chip:hover { border-color: var(--primary); }
.pickup-time-chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.pickup-chip {
  display: flex; align-items: center; gap: 8px; width: fit-content; margin: 14px auto 0;
  background: var(--primary-light); color: var(--primary-dark); padding: 8px 16px;
  border-radius: 999px; font-weight: 700; font-size: 0.85rem;
}
.pickup-chip i { color: var(--primary); }

/* ---------- Order history page ---------- */
.history-page { max-width: 680px; margin: 0 auto; padding: 20px 16px 40px; }
.history-card {
  display: block; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 14px 16px; margin-bottom: 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.history-card:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.history-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.history-order-num { font-weight: 800; font-size: 0.92rem; }
.history-card-meta { font-size: 0.78rem; color: var(--muted); margin-bottom: 6px; }
.history-card-items {
  font-size: 0.85rem; color: var(--text); margin-bottom: 10px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.history-card-bottom { display: flex; align-items: center; justify-content: space-between; }
.history-total { font-weight: 800; color: var(--primary); font-size: 0.9rem; }
.history-view-link { font-size: 0.8rem; font-weight: 700; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.history-card:hover .history-view-link { color: var(--primary); }

/* ---------- Payment method selector ---------- */
.payment-method-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
.payment-method-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 14px 8px; border: 2px solid var(--border); border-radius: var(--radius-md);
  background: var(--surface); cursor: pointer; transition: all 0.15s ease; text-align: center;
}
.payment-method-tile:hover { border-color: var(--primary); }
.payment-method-tile.active { border-color: var(--primary); background: var(--primary-light); }
.payment-method-tile i { font-size: 1.3rem; color: var(--primary); }
.payment-method-tile span { font-weight: 700; font-size: 0.8rem; }

/* ---------- QR camera scanner ---------- */
#qr-reader { width: 100%; border-radius: var(--radius-md); overflow: hidden; background: #000; }
#qr-reader video { width: 100% !important; border-radius: var(--radius-md); }
.scanner-hint { font-size: 0.82rem; color: var(--muted); margin-top: 10px; }
.scanner-divider { display: flex; align-items: center; gap: 10px; margin: 14px 0; color: var(--muted); font-size: 0.76rem; text-transform: uppercase; }
.scanner-divider::before, .scanner-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ---------- Empty states already covered by components.css ---------- */
