/* ═══════════════════════════════════════════════════════════════
   75th Anniversary Souvenir Order - Design System
   聖保羅堂主日學75周年紀念品訂購系統
   ☀️ Warm Sunshine Theme
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@300;400;500;600;700&display=swap');

/* ─── CSS Variables ──────────────────────────────────────────── */
:root {
  /* Warm sunshine palette */
  --primary: #E8912D;
  --primary-light: #F5A623;
  --primary-dark: #D47B1A;
  --primary-glow: rgba(245, 166, 35, 0.2);
  --primary-soft: rgba(245, 166, 35, 0.08);

  --accent-warm: #FF8C42;
  --accent-coral: #FF6B6B;
  --accent-gold: #FFD93D;

  /* Light backgrounds */
  --bg-main: #FFF9F0;
  --bg-card: #FFFFFF;
  --bg-card-hover: #FFF5E6;
  --bg-surface: #FEF7ED;
  --bg-input: #FFF8F0;
  --bg-header: rgba(255, 250, 243, 0.92);

  /* Text colors */
  --text-primary: #2D2016;
  --text-secondary: #6B5B4D;
  --text-muted: #A89888;
  --text-accent: #D47B1A;

  /* Borders */
  --border: rgba(210, 180, 140, 0.25);
  --border-focus: rgba(245, 166, 35, 0.5);
  --border-card: rgba(210, 180, 140, 0.18);

  /* Status colors */
  --success: #2ECC71;
  --success-bg: rgba(46, 204, 113, 0.1);
  --success-border: rgba(46, 204, 113, 0.25);
  --warning: #F39C12;
  --warning-bg: rgba(243, 156, 18, 0.1);
  --warning-border: rgba(243, 156, 18, 0.25);
  --danger: #E74C3C;
  --danger-bg: rgba(231, 76, 60, 0.08);
  --danger-border: rgba(231, 76, 60, 0.2);
  --info: #3498DB;
  --info-bg: rgba(52, 152, 219, 0.08);
  --info-border: rgba(52, 152, 219, 0.2);

  /* Radii */
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Shadows - warm tinted */
  --shadow-sm: 0 2px 8px rgba(180, 140, 80, 0.08);
  --shadow-md: 0 4px 20px rgba(180, 140, 80, 0.1);
  --shadow-lg: 0 8px 40px rgba(180, 140, 80, 0.14);
  --shadow-card: 0 2px 12px rgba(180, 140, 80, 0.07);
  --shadow-glow: 0 4px 20px rgba(245, 166, 35, 0.2);

  --font: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, sans-serif;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after {
  margin: 0; padding: 0; box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font);
  background: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ─── Warm Background Decoration ─────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  top: -120px; right: -120px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(255, 217, 61, 0.12) 0%, rgba(255, 140, 66, 0.06) 40%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  bottom: -100px; left: -100px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(245, 166, 35, 0.08) 0%, transparent 60%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

/* ─── Typography ─────────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }

/* ─── Header ─────────────────────────────────────────────────── */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-header);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
}

.header-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-logo {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: linear-gradient(135deg, #FFD93D, #F5A623);
  box-shadow: 0 3px 12px rgba(245, 166, 35, 0.3);
}

.header-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.header-subtitle {
  font-size: 0.7rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.share-qr-btn {
  min-width: 72px;
  height: 44px;
  border: 1.5px solid rgba(245, 166, 35, 0.35);
  border-radius: 999px;
  background: linear-gradient(135deg, #fff, #FFF0D6);
  color: var(--primary-dark);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 14px;
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 700;
  transition: var(--transition);
}

.share-qr-btn:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

.share-qr-btn-emoji {
  font-size: 1.05rem;
  line-height: 1;
}

/* ─── Page Container ─────────────────────────────────────────── */
.page-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 16px;
  position: relative;
  z-index: 1;
  padding-bottom: 100px;
}

/* ─── Hero Section ───────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 18px 16px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, rgba(255, 217, 61, 0.15), rgba(245, 166, 35, 0.08));
  border-radius: var(--radius-lg);
  border: 1px solid rgba(245, 166, 35, 0.2);
}

.hero-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-emoji {
  font-size: 2rem;
  line-height: 1;
  margin: 0;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.hero h1 {
  color: var(--primary-dark);
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.2;
}

.hero p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: 0;
  white-space: nowrap;
}

/* ─── Category Tabs ──────────────────────────────────────────── */
.category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 14px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar { display: none; }

.category-tab {
  flex-shrink: 0;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  font-family: var(--font);
  box-shadow: var(--shadow-sm);
}

.category-tab:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
  background: var(--bg-card-hover);
}

.category-tab.active {
  background: linear-gradient(135deg, #FFD93D, var(--primary-light));
  color: #5A3800;
  border-color: var(--primary-light);
  font-weight: 600;
  box-shadow: 0 3px 12px rgba(245, 166, 35, 0.25);
}

/* ─── Product Grid ───────────────────────────────────────────── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.product-notice {
  margin: 20px 0 8px;
  padding: 16px 18px;
  background: linear-gradient(135deg, rgba(255, 217, 61, 0.14), rgba(255, 255, 255, 0.92));
  border: 1px solid rgba(245, 166, 35, 0.22);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.product-notice p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.75;
}

.product-notice p + p {
  margin-top: 8px;
}

@media (min-width: 600px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
}

@media (min-width: 900px) {
  .product-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ─── Product Card ───────────────────────────────────────────── */
.product-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border-card);
  overflow: hidden;
  transition: var(--transition);
  position: relative;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  border-color: rgba(245, 166, 35, 0.3);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.product-card.has-items {
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(245, 166, 35, 0.18);
}

.product-image {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  background: linear-gradient(135deg, #FFF8EE, #FFF3E0);
  position: relative;
  overflow: hidden;
}

.product-image-preview-btn {
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: zoom-in;
  position: relative;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-image-count {
  position: absolute;
  left: 8px;
  bottom: 8px;
  background: rgba(45, 32, 22, 0.72);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--radius-full);
}

.product-discount-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: linear-gradient(135deg, #E74C3C, #C0392B);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  box-shadow: 0 2px 6px rgba(231, 76, 60, 0.3);
}

.product-info {
  padding: 10px 12px;
  flex: 1;
}

.product-category {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.product-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.product-price {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.product-price-bulk {
  font-size: 0.65rem;
  color: var(--text-secondary);
  margin-top: 1px;
}

.product-code {
  font-size: 0.6rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Quantity Controls */
.qty-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
}

.qty-btn {
  width: 34px;
  height: 34px;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
}

.qty-btn:hover {
  background: var(--primary-light);
  color: #fff;
  border-color: var(--primary);
}

.qty-btn:active {
  transform: scale(0.9);
}

.qty-btn.minus { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.qty-btn.plus { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

.qty-display {
  width: 42px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 600;
  background: #fff;
  border-top: 1.5px solid var(--border);
  border-bottom: 1.5px solid var(--border);
  color: var(--text-primary);
}

.qty-display.has-qty {
  color: var(--primary-dark);
  font-weight: 700;
}

/* ─── Floating Cart Bar ──────────────────────────────────────── */
.cart-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: rgba(255, 252, 245, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  padding: 12px 16px;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 -4px 20px rgba(180, 140, 80, 0.1);
}

.cart-bar.visible {
  transform: translateY(0);
}

.cart-bar-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cart-info {
  display: flex;
  flex-direction: column;
}

.cart-count {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.cart-total {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.cart-discount {
  font-size: 0.7rem;
  color: var(--success);
  font-weight: 500;
}

/* ─── Buttons ────────────────────────────────────────────────── */
.btn {
  padding: 10px 22px;
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  color: #fff;
  box-shadow: 0 4px 14px rgba(245, 166, 35, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 6px 22px rgba(245, 166, 35, 0.4);
  transform: translateY(-1px);
}

.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  border-color: var(--primary);
  background: var(--bg-card-hover);
}

.btn-success {
  background: linear-gradient(135deg, #27AE60, #2ECC71);
  color: #fff;
  box-shadow: 0 4px 12px rgba(46, 204, 113, 0.3);
}

.btn-danger {
  background: linear-gradient(135deg, #C0392B, #E74C3C);
  color: #fff;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
  border-radius: var(--radius-lg);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ─── Modal / Slide Up ───────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(45, 32, 22, 0.35);
  backdrop-filter: blur(4px);
  z-index: 300;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 301;
  background: var(--bg-card);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  max-height: 90dvh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 20px 16px 32px;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.1);
}

.modal-sheet.active {
  transform: translateY(0);
}

.modal-handle {
  width: 40px;
  height: 4px;
  background: var(--text-muted);
  border-radius: var(--radius-full);
  margin: 0 auto 16px;
  opacity: 0.3;
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.sheet-sync-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(245, 166, 35, 0.28);
  background: linear-gradient(135deg, rgba(255, 217, 61, 0.18), rgba(245, 166, 35, 0.1));
  box-shadow: 0 10px 24px rgba(245, 166, 35, 0.08);
}

.sheet-sync-spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.5px solid rgba(245, 166, 35, 0.22);
  border-top-color: var(--primary);
  animation: spin 0.75s linear infinite;
  flex: 0 0 auto;
}

.sheet-sync-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.sheet-sync-text {
  margin-top: 2px;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.image-preview-modal {
  position: fixed;
  inset: 24px;
  z-index: 302;
  display: none;
  align-items: center;
  justify-content: center;
}

.image-preview-modal.active {
  display: flex;
}

.image-preview-content {
  position: relative;
  width: min(92vw, 760px);
  max-height: 86vh;
  background: rgba(255, 255, 255, 0.98);
  border-radius: var(--radius-xl);
  padding: 18px;
  box-shadow: var(--shadow-lg);
}

.image-preview-content img {
  width: 100%;
  max-height: 68vh;
  object-fit: contain;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #FFF8EE, #FFF3E0);
}

.image-preview-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.image-preview-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.image-preview-counter {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.image-preview-close,
.image-preview-nav {
  border: 0;
  color: #fff;
  background: rgba(45, 32, 22, 0.76);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.image-preview-close {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  z-index: 2;
  font-size: 1.5rem;
}

.image-preview-nav {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  font-size: 2rem;
  flex-shrink: 0;
}

.image-preview-nav.prev {
  margin-right: 12px;
}

.image-preview-nav.next {
  margin-left: 12px;
}

/* Center modal for desktop */
.modal-center {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  z-index: 301;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  max-width: 480px;
  width: calc(100% - 32px);
  max-height: 90dvh;
  overflow-y: auto;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

.modal-center.active {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

.share-qr-modal {
  text-align: center;
  padding: 26px 20px 22px;
  overflow: visible;
}

.share-qr-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.share-qr-close:hover {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.share-qr-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, rgba(255, 217, 61, 0.24), rgba(245, 166, 35, 0.12));
  border: 1px solid rgba(245, 166, 35, 0.22);
  color: var(--primary-dark);
  font-size: 0.78rem;
  font-weight: 700;
}

.share-qr-title {
  margin-bottom: 6px;
}

.share-qr-text {
  color: var(--text-secondary);
  font-size: 0.88rem;
  margin-bottom: 16px;
}

.share-qr-frame {
  position: relative;
  width: min(78vw, 320px);
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  padding: 14px;
  border-radius: 28px;
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(135deg, #FFD93D, #F5A623, #FF8C42) border-box;
  border: 2px solid transparent;
  box-shadow: 0 10px 30px rgba(180, 140, 80, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.share-qr-frame canvas {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 18px;
  flex: 0 0 auto;
  vertical-align: top;
  transform: translateZ(0);
}

.share-qr-url {
  margin-top: 14px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.76rem;
  word-break: break-all;
  border: 1px solid var(--border);
}

/* ─── Forms ──────────────────────────────────────────────────── */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-label .required {
  color: var(--danger);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-input);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.9rem;
  transition: var(--transition);
  outline: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.1);
  background: #fff;
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-textarea {
  min-height: 80px;
  resize: vertical;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23A89888' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* ─── Order Summary ──────────────────────────────────────────── */
.order-items {
  margin-bottom: 16px;
}

.order-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

.order-item:last-child { border-bottom: none; }

.order-item-name {
  color: var(--text-primary);
  flex: 1;
}

.order-item-qty {
  color: var(--text-secondary);
  margin: 0 12px;
  white-space: nowrap;
}

.order-item-price {
  color: var(--text-primary);
  font-weight: 600;
  white-space: nowrap;
}

.order-totals {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}

.order-total-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.order-total-row.discount { color: var(--success); font-weight: 500; }

.order-total-row.final {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--primary-dark);
  padding-top: 8px;
  margin-top: 4px;
  border-top: 1px solid var(--border);
}

/* ─── Confirmation Page ──────────────────────────────────────── */
.confirmation-page {
  text-align: center;
  padding: 32px 16px;
  max-width: 480px;
  margin: 0 auto;
}

.confirmation-icon {
  font-size: 4rem;
  margin-bottom: 16px;
  animation: pop 0.5s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

@keyframes pop {
  0% { transform: scale(0); }
  100% { transform: scale(1); }
}

.confirmation-order-id {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin: 12px 0;
  padding: 12px 24px;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  display: inline-block;
  border: 2px solid rgba(245, 166, 35, 0.25);
}

.qr-container {
  margin: 20px auto;
  padding: 16px;
  background: #fff;
  border-radius: var(--radius-lg);
  display: inline-block;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}

.qr-container img,
.qr-container canvas {
  display: block;
}

.confirmation-instructions {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 20px;
  text-align: left;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.confirmation-instructions h4 {
  color: var(--primary-dark);
  margin-bottom: 8px;
}

.payment-method-grid {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.payment-method-card {
  border-radius: var(--radius-md);
  padding: 14px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.payment-method-card-cash {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 248, 240, 0.95));
}

.payment-method-card-fps {
  background: linear-gradient(135deg, rgba(255, 249, 240, 1), rgba(255, 243, 224, 0.96));
  border-color: rgba(245, 166, 35, 0.28);
}

.payment-method-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: 4px 10px;
  margin-bottom: 10px;
  border-radius: var(--radius-full);
  background: rgba(245, 166, 35, 0.14);
  color: var(--primary-dark);
  font-size: 0.72rem;
  font-weight: 700;
}

.payment-method-title {
  margin-bottom: 8px;
  color: var(--text-primary);
  font-size: 0.98rem;
}

.payment-method-text {
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.payment-method-note {
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--warning-bg);
  border: 1px solid var(--warning-border);
  color: #8a5a00;
  line-height: 1.5;
}

.confirmation-instructions ol {
  padding-left: 20px;
}

.confirmation-instructions li {
  margin-bottom: 6px;
}

.payment-steps {
  margin: 0 0 8px;
}

.payment-whatsapp-note {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

@media (min-width: 760px) {
  .payment-method-grid {
    grid-template-columns: 1fr 1.15fr;
    align-items: start;
  }
}

/* ─── Thank You Page ──────────────────────────────────────────── */
.thankyou-page {
  text-align: center;
  padding: 48px 20px 60px;
  max-width: 480px;
  margin: 0 auto;
  animation: fadeSlideUp 0.55s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

.thankyou-anim {
  margin-bottom: 24px;
}

.thankyou-emoji-row {
  display: flex;
  justify-content: center;
  gap: 14px;
  font-size: 3rem;
}

.ty-emoji {
  display: inline-block;
  animation: tyBounce 1.2s ease-in-out infinite alternate;
}

@keyframes tyBounce {
  0%   { transform: translateY(0) scale(1); }
  100% { transform: translateY(-14px) scale(1.12); }
}

.thankyou-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--primary-dark), var(--accent-warm));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.thankyou-message {
  background: linear-gradient(135deg, rgba(255, 217, 61, 0.18), rgba(245, 166, 35, 0.1));
  border: 1.5px solid rgba(245, 166, 35, 0.3);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin: 0 0 24px;
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text-primary);
}

.thankyou-message p + p {
  margin-top: 10px;
  color: var(--primary-dark);
  font-weight: 600;
}

.thankyou-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border-card);
  box-shadow: var(--shadow-md);
  padding: 24px;
  margin-bottom: 28px;
}

.thankyou-card-icon {
  font-size: 2.4rem;
  margin-bottom: 12px;
}

.thankyou-card p {
  font-size: 1rem;
  color: var(--text-primary);
  font-weight: 500;
  margin-bottom: 6px;
  line-height: 1.6;
}

.ty-sub {
  font-size: 0.82rem !important;
  color: var(--text-muted) !important;
  font-weight: 400 !important;
  margin-top: 4px;
}

.bookmark-link-box {
  margin-top: 16px;
}

.bookmark-link-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: var(--font);
}

.thankyou-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.thankyou-actions .btn {
  flex: 1 1 180px;
}

.thankyou-deco {
  font-size: 1.6rem;
  display: flex;
  justify-content: center;
  gap: 12px;
  opacity: 0.75;
}

.thankyou-deco span {
  display: inline-block;
  animation: tyBounce 1.4s ease-in-out infinite alternate;
}

.thankyou-deco span:nth-child(2) { animation-delay: 0.2s; }
.thankyou-deco span:nth-child(3) { animation-delay: 0.4s; }
.thankyou-deco span:nth-child(4) { animation-delay: 0.6s; }
.thankyou-deco span:nth-child(5) { animation-delay: 0.8s; }

.review-page {
  min-height: 100vh;
  padding: 28px 16px 48px;
}

.review-shell {
  max-width: 560px;
  margin: 0 auto;
}

.review-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border-card);
  box-shadow: var(--shadow-md);
  padding: 24px;
  margin-bottom: 24px;
  text-align: center;
}

.review-status {
  margin-top: 14px;
}

.review-meta {
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ─── Staff / Admin Styles ───────────────────────────────────── */
.staff-nav {
  display: flex;
  gap: 4px;
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}

.staff-nav-btn {
  flex: 1;
  padding: 10px 12px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.staff-nav-btn.active {
  background: linear-gradient(135deg, #FFD93D, var(--primary-light));
  color: #5A3800;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.staff-nav-btn:hover:not(.active) {
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

/* Staff Login */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80dvh;
  padding: 16px;
}

.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.login-card h2 {
  margin-bottom: 8px;
  color: var(--primary-dark);
}

.login-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* ─── Dashboard Stats ────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

@media (min-width: 600px) {
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 16px;
  border: 1px solid var(--border-card);
  text-align: center;
  box-shadow: var(--shadow-card);
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.stat-card.success .stat-value { color: var(--success); }
.stat-card.warning .stat-value { color: var(--warning); }
.stat-card.danger .stat-value { color: var(--danger); }
.stat-card.info .stat-value { color: var(--info); }
.stat-card.revenue-total .stat-value { color: var(--primary-dark); }
.stat-card.revenue-cash .stat-value { color: var(--success); }
.stat-card.revenue-fps .stat-value { color: var(--info); }

/* ─── Order List ─────────────────────────────────────────────── */
.order-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.order-list-item {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  border: 1px solid var(--border-card);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-card);
}

.order-list-item:hover {
  border-color: rgba(245, 166, 35, 0.3);
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-md);
}

.order-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.order-list-id {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--primary-dark);
}

.order-list-id-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.order-marker-row {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.order-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  line-height: 1;
}

.order-list-detail {
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
}

/* ─── Status Badge ───────────────────────────────────────────── */
.status-badge {
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge.pending {
  background: var(--warning-bg);
  color: #B7791F;
  border: 1px solid var(--warning-border);
}

.status-badge.paid {
  background: var(--success-bg);
  color: #1E8449;
  border: 1px solid var(--success-border);
}

.status-badge.partial_delivered {
  background: var(--warning-bg);
  color: #B7791F;
  border: 1px solid var(--warning-border);
}

.status-badge.delivered {
  background: rgba(46, 204, 113, 0.15);
  color: #1E8449;
  border: 1px solid rgba(46, 204, 113, 0.3);
}

.status-badge.cancelled {
  background: var(--danger-bg);
  color: #C0392B;
  border: 1px solid var(--danger-border);
}

/* ─── Search / Filter Bar ────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-bar .form-input {
  flex: 1;
  min-width: 150px;
}

.filter-pills {
  display: flex;
  gap: 4px;
}

.filter-pill {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.75rem;
  cursor: pointer;
  transition: var(--transition);
}

.filter-pill.active {
  background: linear-gradient(135deg, #FFD93D, var(--primary-light));
  color: #5A3800;
  border-color: var(--primary-light);
  font-weight: 600;
}

/* ─── QR Scanner ─────────────────────────────────────────────── */
.scanner-container {
  text-align: center;
  padding: 16px;
}

.scanner-area {
  max-width: 400px;
  margin: 0 auto 16px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 3px solid var(--primary-light);
  box-shadow: var(--shadow-glow);
}

.scanner-area video {
  width: 100%;
  display: block;
}

.manual-input {
  margin-top: 16px;
  display: flex;
  gap: 8px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

/* ─── Admin Product List ─────────────────────────────────────── */
.admin-product-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-card);
  margin-bottom: 8px;
  transition: var(--transition);
  box-shadow: var(--shadow-card);
}

.admin-product-item:hover {
  border-color: rgba(245, 166, 35, 0.3);
  box-shadow: var(--shadow-md);
}

.admin-product-emoji {
  font-size: 2rem;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  position: relative;
}

.admin-product-emoji img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.admin-product-info {
  flex: 1;
  min-width: 0;
}

.admin-product-info h4 {
  font-size: 0.85rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-product-info p {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.admin-image-count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: var(--radius-full);
  background: var(--primary-dark);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.admin-image-preview-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 8px;
}

.admin-image-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
}

.admin-image-preview-item {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  position: relative;
}

.admin-image-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-primary-image-btn {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 24px;
  border: 0;
  border-radius: var(--radius-full);
  background: rgba(45, 32, 22, 0.76);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 6px 8px;
  cursor: pointer;
}

.admin-remove-image-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: rgba(192, 57, 43, 0.9);
  color: #fff;
  font-size: 1.1rem;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.admin-primary-image-btn.active {
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
}

.admin-image-source-label {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 6px;
  color: #fff;
  font-size: 0.65rem;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.admin-image-preview-note,
.form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 8px;
}

.admin-product-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* ─── Inactive Product ───────────────────────────────────────── */
.admin-product-item.inactive {
  opacity: 0.4;
}

/* ─── Empty State ────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 16px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.empty-state p {
  font-size: 0.9rem;
}

/* ─── Toast Notifications ────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.3s ease;
  min-width: 250px;
  max-width: 400px;
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast.success { background: #D5F5E3; color: #1E8449; border: 1px solid #A9DFBF; }
.toast.error { background: #FADBD8; color: #922B21; border: 1px solid #F5B7B1; }
.toast.info { background: #D6EAF8; color: #1F618D; border: 1px solid #AED6F1; }

/* ─── Loading ────────────────────────────────────────────────── */
.loading-spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255, 249, 240, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 400;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.loading-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ─── Responsive Utilities ───────────────────────────────────── */
@media (max-width: 400px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .hero h1 { font-size: 1.2rem; }
  .hero-emoji { font-size: 1.5rem; }
  .hero-inline { gap: 6px; }
  .hero p { font-size: 0.8rem; white-space: normal; }
}

/* iPad */
@media (min-width: 768px) {
  .page-container { padding: 24px; padding-bottom: 120px; }
  .cart-bar-inner { padding: 0 24px; }
}

@media (max-width: 640px) {
  .share-qr-modal {
    width: calc(100% - 24px);
    padding: 22px 14px 18px;
  }

  .share-qr-frame {
    width: min(84vw, 320px);
    padding: 12px;
    border-radius: 24px;
  }

  .share-qr-url {
    font-size: 0.72rem;
  }

  .image-preview-modal {
    inset: 12px;
  }

  .image-preview-content {
    width: 100%;
    padding: 14px;
  }

  .image-preview-content img {
    max-height: 60vh;
  }

  .image-preview-nav {
    position: absolute;
    top: calc(50% - 23px);
    z-index: 2;
  }

  .image-preview-nav.prev {
    left: 8px;
    margin-right: 0;
  }

  .image-preview-nav.next {
    right: 8px;
    margin-left: 0;
  }
}

/* ─── Utility Classes ────────────────────────────────────────── */
.hidden { display: none !important; }
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.gap-8 { gap: 8px; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }
