/* =========================================
   Edelbox UI — VisionOS Glass Style (2026)
   ========================================= */

/* --- TOKENS & VARIABLES --- */
:root {
  /* Brand Colors */
  --accent: #FFC25C;
  --accent-glow: rgba(255, 194, 92, 0.5);
  --accent-ink: #2a1c00;
  
  /* Glass Material (Light) */
  --bg: #f2f2f7; /* iOS System Gray 6 */
  --glass-material: rgba(255, 255, 255, 0.65);
  --glass-border: rgba(255, 255, 255, 0.4);
  --glass-highlight: rgba(255, 255, 255, 0.8);
  
  /* Typography & Ink */
  --ink: #000000;
  --muted: #86868b; /* Apple System Gray */
  
  /* UI Elements */
  --line: rgba(60, 60, 67, 0.12); /* Apple Separator */
  --chip-bg: rgba(0, 0, 0, 0.05);
  --chip-ink: #1d1d1f;
  
  /* Measurements & Effects */
  --radius-l: 24px;
  --radius-m: 16px;
  --radius-s: 12px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.08);
  --shadow-lg: 0 20px 40px rgba(0,0,0,0.12);
  --blur-val: 25px;
  
  /* Safe Area */
  --safe-bottom: env(safe-area-inset-bottom, 20px);
}

:root.dark {
  /* Glass Material (Dark) */
  --bg: #000000;
  --glass-material: rgba(30, 30, 30, 0.60);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-highlight: rgba(255, 255, 255, 0.15);
  
  --ink: #f5f5f7;
  --muted: #86868b;
  --line: rgba(84, 84, 88, 0.35);
  --chip-bg: rgba(255, 255, 255, 0.1);
  --chip-ink: #f5f5f7;
  
  --accent-ink: #000;
  --shadow-md: 0 8px 32px rgba(0,0,0,0.4);
}

/* --- RESET & BASE --- */
html, body { height: 100%; margin: 0; padding: 0; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  background-color: var(--bg);
  /* Subtle Gradient Mesh for Glass Effect */
  background-image: 
    radial-gradient(at 100% 0%, hsla(38,90%,80%,0.4) 0px, transparent 50%),
    radial-gradient(at 0% 0%, hsla(210,30%,80%,0.2) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

:root.dark body {
  background-image: 
    radial-gradient(at 100% 0%, hsla(38,60%,20%,0.3) 0px, transparent 50%),
    radial-gradient(at 0% 0%, hsla(210,30%,20%,0.3) 0px, transparent 50%);
}

/* --- GLASS UTILITIES --- */
.glass-panel {
  background: var(--glass-material);
  backdrop-filter: blur(var(--blur-val));
  -webkit-backdrop-filter: blur(var(--blur-val));
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-md);
}

/* --- LAYOUT --- */
main {
  max-width: 1024px; /* Tighter layout for focus */
  margin: 0 auto;
  padding: 120px 20px 140px; /* Top padding for floating header */
}

.page {
  padding: 100px 20px 140px;
  max-width: 700px; /* Narrower for forms */
  margin: 0 auto;
}

/* --- TOPBAR (FLOATING ISLAND) --- */
.topbar {
  position: fixed;
  top: 16px; left: 16px; right: 16px;
  max-width: 1024px;
  margin: 0 auto;
  z-index: 100;
  border-radius: 999px; /* Pill shape */
  
  /* Glass Effect */
  background: var(--glass-material);
  backdrop-filter: blur(var(--blur-val));
  -webkit-backdrop-filter: blur(var(--blur-val));
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-md);
  
  transition: transform 0.3s ease, background 0.3s ease;
}
/* Condensed state handled by JS via class, we just make it tighter */
.topbar.condensed {
  background: color-mix(in srgb, var(--bg), transparent 10%);
  transform: translateY(-4px) scale(0.98);
}

.topbar .row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px; height: 56px;
}

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand-logo {
  width: 36px; height: 36px;
  border-radius: 10px; /* Squircle */
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.brand-name { font-weight: 700; font-size: 17px; letter-spacing: -0.5px; }

.viewtog { display: none; } /* Hide toggle on mobile by default */

/* --- BUTTONS (VISION OS STYLE) --- */
.btn {
  appearance: none; border: none; cursor: pointer;
  font-family: inherit; font-weight: 600; font-size: 15px;
  border-radius: 999px; /* Pill buttons */
  padding: 10px 20px;
  transition: all 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  
  /* Default: Glass Button */
  background: rgba(120, 120, 128, 0.12); /* iOS Secondary Fill */
  color: var(--ink);
  backdrop-filter: blur(10px);
}

.btn:hover { transform: scale(1.03); background: rgba(120, 120, 128, 0.2); }
.btn:active { transform: scale(0.96); }

.btn-accent {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 4px 12px var(--accent-glow);
}
.btn-accent:hover {
  background: color-mix(in srgb, var(--accent) 90%, white);
  box-shadow: 0 6px 16px var(--accent-glow);
}

.btn-ghost {
  background: transparent;
  color: var(--accent); /* iOS Link style */
  padding: 8px 12px;
}
.btn-ghost:hover { background: rgba(120, 120, 128, 0.08); }
.btn-sm { font-size: 13px; padding: 6px 14px; height: 32px; }

.btn:disabled, .btn[disabled] { opacity: 0.5; cursor: not-allowed; filter: grayscale(1); box-shadow: none; }

/* --- INPUTS & FORMS --- */
.search {
  position: relative;
  background: rgba(120, 120, 128, 0.08); /* System Fill */
  border-radius: 18px;
  padding: 0 16px;
  height: 48px;
  display: flex; align-items: center; gap: 10px;
  transition: 0.2s;
  border: 1px solid transparent;
}
.search:focus-within {
  background: var(--bg);
  box-shadow: 0 0 0 2px var(--accent);
}
.search input {
  border: none; background: transparent; outline: none;
  font-size: 17px; color: var(--ink); width: 100%; height: 100%;
}

.form .field { margin-bottom: 20px; }
.form label {
  display: block; font-size: 13px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--muted); margin-bottom: 8px; margin-left: 4px;
}

.input, .textarea, .select {
  width: 100%;
  background: rgba(120, 120, 128, 0.08);
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 17px;
  color: var(--ink);
  font-family: inherit;
  transition: 0.2s;
  outline: none;
}
.textarea { min-height: 100px; resize: vertical; }
.input:focus, .textarea:focus, .select:focus {
  background: var(--bg);
  box-shadow: 0 0 0 2px var(--accent);
}

/* --- SEGMENTED CONTROL (TABS) --- */
.seg {
  background: rgba(118, 118, 128, 0.12);
  padding: 4px; border-radius: 12px;
  display: inline-flex; position: relative;
}
.seg-btn {
  border: none; background: transparent;
  padding: 8px 24px; border-radius: 9px;
  font-weight: 600; font-size: 13px;
  color: var(--ink); cursor: pointer;
  transition: 0.2s;
}
.seg-btn.is-active {
  background: var(--bg); /* Active looks like card */
  box-shadow: 0 3px 8px rgba(0,0,0,0.12);
}

/* --- CHIPS (Pills) --- */
.chips {
  display: flex; gap: 8px; overflow-x: auto;
  padding: 12px 4px; scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }

.chip {
  background: var(--chip-bg);
  border: 1px solid transparent;
  border-radius: 99px;
  padding: 8px 16px;
  font-size: 14px; font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: 0.2s;
}
.chip[aria-pressed="true"] {
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
  transform: scale(1.05);
}

/* --- CARDS (The VisionOS Glass Cards) --- */
.card {
  position: relative;
  background: var(--glass-material);
  backdrop-filter: blur(var(--blur-val));
  -webkit-backdrop-filter: blur(var(--blur-val));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex; flex-direction: column;
}

.card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: var(--shadow-md);
  border-color: var(--glass-highlight);
  z-index: 2;
}

/* Grid System */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px;
}
@media (min-width: 768px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}

/* Card Content */
.thumb {
  position: relative;
  width: 100%; aspect-ratio: 1/1; /* Square for modern look */
  overflow: hidden;
  background: var(--chip-bg);
}
.thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.5s ease;
}
.card:hover .thumb img { transform: scale(1.08); }

/* Gradient overlay for text readability on image if needed */
.thumb-grad {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.4) 0%, transparent 40%);
}

/* Cari bagian Badges on Card di style.css */

.flag, .day-pill, .price-pill {
  position: absolute; z-index: 2;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-radius: 99px; font-weight: 700; font-size: 11px; letter-spacing: 0.3px;
  padding: 6px 10px;
}

/* Kiri Atas: Rekomendasi */
.flag { 
  top: 10px; 
  left: 10px; 
  background: rgba(255, 194, 92, 0.9); 
  color: black; 
  box-shadow: 0 4px 10px rgba(0,0,0,0.1); 
}

/* Kanan Bawah: Harga */
.price-pill { 
  bottom: 10px; 
  right: 10px; 
  background: rgba(255,255,255,0.95); 
  color: black; 
  box-shadow: 0 4px 10px rgba(0,0,0,0.15); 
}

/* UPDATE: Kanan Atas: Tanggal/Hari */
.day-pill { 
  top: 10px;       /* Pindah ke atas */
  right: 10px;     /* Pindah ke kanan */
  bottom: auto;    /* Reset bottom */
  left: auto;      /* Reset left */
  
  background: rgba(0,0,0,0.65); 
  color: white; 
  border: 1px solid rgba(255,255,255,0.2); /* Tambah border tipis biar elegan */
}

/* Kalo hari ini, warnanya beda */
.day-pill.today { 
  background: var(--accent); 
  color: var(--accent-ink);
  border-color: transparent;
  box-shadow: 0 0 10px var(--accent-glow);
}

.meta { padding: 16px; display: flex; flex-direction: column; flex-grow: 1; justify-content: space-between; gap: 8px; }
.title { font-size: 16px; font-weight: 700; margin: 0; line-height: 1.3; }
.desc { font-size: 13px; color: var(--muted); margin: 0; line-height: 1.4; opacity: 0.9; }

/* Add Button in Card */
.add { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 12px; }
.tags { display: flex; gap: 4px; }
.tag { font-size: 10px; padding: 2px 8px; background: var(--chip-bg); border-radius: 6px; color: var(--muted); }

/* --- LIST VIEW (Adapts .card) --- */
.view-list #menu { display: flex; flex-direction: column; gap: 16px; }
.view-list .card {
  flex-direction: row; align-items: stretch;
  min-height: 140px;
}
.view-list .thumb { width: 140px; aspect-ratio: auto; flex-shrink: 0; }
.view-list .meta { padding: 20px; }
@media (max-width: 600px) {
  .view-list .card { flex-direction: column; }
  .view-list .thumb { width: 100%; aspect-ratio: 16/9; }
}

/* --- SELECTION CARDS (Alamat, Pengiriman, Pembayaran) --- */
/* Base style for clickable list items */
.addr-card, .ship-card, .pay-card {
  position: relative;
  background: rgba(255, 255, 255, 0.5); /* Lighter glass */
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-m);
  padding: 16px;
  display: grid; gap: 12px;
  cursor: pointer;
  transition: 0.2s ease;
}
:root.dark .addr-card, :root.dark .ship-card, :root.dark .pay-card {
  background: rgba(40, 40, 40, 0.5);
}

.addr-card:hover, .ship-card:hover, .pay-card:hover {
  background: var(--glass-highlight);
}

/* Selected State - Glowing Border */
.is-selected {
  background: color-mix(in srgb, var(--accent) 5%, var(--glass-material)) !important;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), var(--shadow-md);
}

/* Layout for Shipping/Payment */
.ship-card, .pay-card {
  grid-template-columns: 50px 1fr auto;
  align-items: center;
}
.ship-logo, .pay-logo {
  width: 50px; height: 50px;
  background: white; border-radius: 12px; padding: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  display: flex; align-items: center; justify-content: center;
}
.ship-logo img, .pay-logo img { width: 100%; height: 100%; object-fit: contain; }

.ship-name, .pay-name { font-weight: 700; font-size: 16px; }
.ship-desc, .pay-desc { font-size: 13px; color: var(--muted); }

/* Badge for availability */
.ship-badge, .pay-badge {
  font-size: 11px; font-weight: 700; padding: 4px 10px;
  border-radius: 99px; background: var(--bg); border: 1px solid var(--line);
}
.is-disabled { opacity: 0.5; pointer-events: none; filter: grayscale(1); }

/* --- CART SUMMARY IN CONFIRMATION --- */
.sum-list { display: flex; flex-direction: column; gap: 12px; }
.sum-item {
  display: flex; gap: 16px; align-items: center;
  padding: 12px; background: rgba(0,0,0,0.02);
  border-radius: 12px;
}
.sum-thumb { width: 48px; height: 48px; border-radius: 8px; overflow: hidden; background: #eee; flex-shrink: 0; }
.sum-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sum-meta { flex-grow: 1; }
.sum-name { font-weight: 600; font-size: 15px; }
.sum-sub { font-size: 13px; color: var(--muted); }

/* --- SHEET / FOOTER (FLOATING DOCK) --- */
.sheet {
  position: fixed;
  bottom: 24px; left: 20px; right: 20px;
  max-width: 800px;
  margin: 0 auto;
  z-index: 900;
  
  /* Glass Dock Style */
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 24px;
  
  padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 20px 50px rgba(0,0,0,0.2);
  
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

:root.dark .sheet {
  background: rgba(40, 40, 40, 0.75);
  border-color: rgba(255,255,255,0.1);
}

.sheet-right { display: flex; align-items: center; gap: 16px; margin-left: auto; }
#subtotal, #ftGrand { font-size: 18px; font-weight: 800; letter-spacing: -0.5px; }

/* Mobile Adjustments for Sheet */
@media (max-width: 520px) {
  .sheet {
    bottom: 16px; left: 12px; right: 12px;
    padding: 12px 16px;
    flex-direction: row; /* Keep row even on mobile */
  }
  #itemsCount { display: none; }
  .sheet .btn-accent { padding: 0 24px; }
}

/* --- DIALOGS / MODALS --- */
dialog {
  border: none;
  background: var(--bg); /* Fallback */
  background: color-mix(in srgb, var(--bg), transparent 5%);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border-radius: 32px;
  padding: 32px;
  box-shadow: 0 40px 80px rgba(0,0,0,0.3);
  max-width: 90vw; width: 400px;
  color: var(--ink);
}
dialog::backdrop {
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(5px);
}

.dlg-title { font-size: 24px; font-weight: 800; margin-bottom: 8px; }
.dlg-desc { font-size: 15px; line-height: 1.5; color: var(--muted); margin-bottom: 24px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; }

/* Qty Control inside Dialog */
.qty-row {
  background: rgba(120, 120, 128, 0.1);
  border-radius: 16px;
  padding: 6px;
  display: inline-flex; align-items: center;
  margin-bottom: 20px;
}
.qty-row .btn { background: white; box-shadow: 0 2px 8px rgba(0,0,0,0.05); width: 40px; height: 40px; padding: 0; border-radius: 12px; }
:root.dark .qty-row .btn { background: #333; }
#qty { background: transparent; border: none; text-align: center; width: 50px; font-weight: 700; font-size: 18px; }

/* Cart Dialog Items */
.cart-row {
  display: flex; gap: 12px; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.cart-img { width: 50px; height: 50px; border-radius: 10px; object-fit: cover; }
.cart-col__meta { flex: 1; }
.cart-col__actions { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.cart-qty { font-weight: 600; font-variant-numeric: tabular-nums; }

/* --- WEEKLY PANEL --- */
.weekly-card {
  background: linear-gradient(135deg, var(--glass-material) 0%, rgba(255,255,255,0.3) 100%);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 24px;
  margin-bottom: 20px;
}
.wk-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.wk-badge { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 1px; color: var(--accent); }
.wk-collage { display: flex; gap: 8px; overflow: hidden; margin-top: 16px; mask-image: linear-gradient(to right, black 80%, transparent 100%); }
.wk-thumb { width: 60px; height: 60px; border-radius: 12px; flex-shrink: 0; border: 1px solid var(--glass-border); }

/* --- UTILITIES & EMPTY STATES --- */
.empty-card {
  text-align: center; padding: 40px 20px;
  background: transparent; border: 2px dashed var(--line);
  border-radius: 20px; color: var(--muted);
}
.empty-icon {
  width: 64px; height: 64px; margin: 0 auto 16px;
  background: var(--chip-bg); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; color: var(--muted);
}
.section-title { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; margin: 40px 0 20px; }

.note {
  background: rgba(255, 194, 92, 0.1);
  border: 1px solid rgba(255, 194, 92, 0.3);
  color: var(--accent-ink);
  padding: 16px; border-radius: 16px;
  display: flex; gap: 12px; align-items: flex-start;
  font-size: 14px;
}

/* --- ANIMATIONS --- */
@keyframes fadeScale {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
.card, .page, dialog[open] { animation: fadeScale 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); }

/* Skeleton */
.shimmer {
  background: linear-gradient(90deg, var(--chip-bg) 25%, rgba(120,120,128,0.1) 50%, var(--chip-bg) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* Footer Totals (Konfirmasi Page) */
.totals-grid { display: grid; grid-template-columns: 1fr auto; gap: 8px 32px; text-align: right; }
.totals-grid .label { color: var(--muted); font-size: 14px; text-align: left; }
.totals-grid .value { font-weight: 600; font-variant-numeric: tabular-nums; }
.totals-grid .total { font-size: 18px; font-weight: 800; color: var(--ink); padding-top: 12px; border-top: 1px solid var(--line); margin-top: 4px; }

/* === FIX: ZOOM CLICK INTERACTION === */

/* Tambahkan pointer-events: none di class ini yang sudah ada */
.thumb-grad {
  /* properti lama... */
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.4) 0%, transparent 40%);
  
  /* PROPERTI BARU (PENTING) */
  pointer-events: none; 
}

/* Pastikan cursor berubah jadi kaca pembesar pas hover gambar */
.card .thumb img, 
.wk-thumb img, 
.pack-item img {
  cursor: zoom-in; 
}

/* Style Dialog Zoom-nya biar pas sama tema VisionOS */
#imgZoomDialog {
  background: rgba(30, 30, 30, 0.85); /* Darker backdrop for focus */
  backdrop-filter: blur(50px);
  -webkit-backdrop-filter: blur(50px);
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 50px 100px rgba(0,0,0,0.5);
  padding: 0; 
  overflow: hidden;
  border-radius: 24px;
}
#imgZoomDialog img {
  display: block;
  max-width: 100%; 
  max-height: 80vh;
  object-fit: contain;
}
#imgZoomDialog .zoom-close {
  position: absolute; top: 16px; right: 16px;
  background: rgba(255,255,255,0.2); color: white;
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; line-height: 1;
  border: none; cursor: pointer;
  backdrop-filter: blur(10px);
}
#imgZoomDialog .zoom-caption {
  text-align: center; color: rgba(255,255,255,0.8);
  padding: 16px; margin: 0; font-size: 14px;
}

/* === FIX: ZOOM CLICK INTERACTION === */

/* Tambahkan pointer-events: none di class ini yang sudah ada */
.thumb-grad {
  /* properti lama... */
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.4) 0%, transparent 40%);
  
  /* PROPERTI BARU (PENTING) */
  pointer-events: none; 
}

/* Pastikan cursor berubah jadi kaca pembesar pas hover gambar */
.card .thumb img, 
.wk-thumb img, 
.pack-item img {
  cursor: zoom-in; 
}

/* Style Dialog Zoom-nya biar pas sama tema VisionOS */
#imgZoomDialog {
  background: rgba(30, 30, 30, 0.85); /* Darker backdrop for focus */
  backdrop-filter: blur(50px);
  -webkit-backdrop-filter: blur(50px);
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 50px 100px rgba(0,0,0,0.5);
  padding: 0; 
  overflow: hidden;
  border-radius: 24px;
}
#imgZoomDialog img {
  display: block;
  max-width: 100%; 
  max-height: 80vh;
  object-fit: contain;
}
#imgZoomDialog .zoom-close {
  position: absolute; top: 16px; right: 16px;
  background: rgba(255,255,255,0.2); color: white;
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; line-height: 1;
  border: none; cursor: pointer;
  backdrop-filter: blur(10px);
}
#imgZoomDialog .zoom-caption {
  text-align: center; color: rgba(255,255,255,0.8);
  padding: 16px; margin: 0; font-size: 14px;
}

/* ==================================================
   FIX TOTAL: WEEKLY THUMBS & DIALOG LAYOUT
   ================================================== */

/* 1. Container Gambar di Main Page (Scroll Samping) */
.wk-collage {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important; /* Jangan turun ke bawah */
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-top: 16px;
  mask-image: linear-gradient(to right, black 85%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, black 85%, transparent 100%);
}
.wk-collage::-webkit-scrollbar { display: none; }

/* 2. Container Gambar di Dialog (Wrap / Turun ke bawah) */
.pack-thumbs {
  display: flex !important;
  flex-wrap: wrap !important; /* Kalau banyak, turun baris */
  gap: 8px;
  margin-bottom: 16px;
}

/* 3. Style Thumbnail (Dipakai di Main Page & Dialog) */
/* INI KUNCINYA BIAR GAK GEDE-GEDE */
.wk-thumb {
  position: relative;
  display: block;
  width: 72px !important;   /* Paksa lebar fix */
  height: 72px !important;  /* Paksa tinggi fix */
  flex-shrink: 0;           /* Jangan mau dipenyetin */
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: var(--chip-bg);
  box-shadow: var(--shadow-sm);
  cursor: zoom-in;
}

.wk-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

/* Style tambahan buat label harga di atas gambar */
.wk-thumb .grad {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 50%);
  pointer-events: none;
}
.wk-thumb .lab {
  position: absolute; left: 4px; bottom: 4px;
  font-size: 10px; font-weight: 700;
  color: white;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  pointer-events: none;
}

/* 4. Fix List Menu di dalam Dialog Paket (Biar rapi juga) */
.pack-list {
  display: flex; flex-direction: column; gap: 10px;
  max-height: 40vh; overflow-y: auto;
  margin-top: 10px;
}

.pack-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px;
  background: rgba(255,255,255,0.4);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
}
:root.dark .pack-item { background: rgba(255,255,255,0.05); }

.pack-item img {
  width: 48px !important; 
  height: 48px !important;
  border-radius: 10px;
  object-fit: cover;
  background: var(--chip-bg);
  cursor: zoom-in;
}

.pack-item .meta { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.pack-item .name { font-weight: 600; font-size: 14px; }
.pack-item .price { font-size: 12px; color: var(--muted); }

/* ... (kode sebelumnya) ... */

/* ==================================================
   FIX TOTAL: SECONDARY PAGES (Alamat, Pengiriman, dll)
   ================================================== */

/* 1. HAPUS GAP RAKSASA DI ATAS */
/* Override padding .page biar gak bolong melompong di atas */
.page {
  padding-top: 20px !important; /* Dari 100px jadi 20px */
  padding-bottom: 140px !important;
  max-width: 600px !important; /* Batasi lebar biar lebih fokus di desktop */
}

/* 2. HEADER HALAMAN LEBIH RAPI (iOS Large Title Style) */
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 24px;
  padding: 0 4px;
}

.page-title {
  font-size: 32px !important;
  font-weight: 800 !important;
  letter-spacing: -0.5px;
  line-height: 1.1;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--ink) 0%, var(--muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.page-head p.muted {
  font-size: 15px;
  line-height: 1.4;
  opacity: 0.8;
  max-width: 90%;
}

/* Tombol Kembali biar gak kaku */
.page-head .btn-ghost {
  background: rgba(120, 120, 128, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 99px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  height: auto;
}

/* 3. FIX CARD BIAR GAK DEMPET */
/* Beri jarak antar section card */
.page .card {
  margin-bottom: 24px;
  padding: 24px !important; /* Padding dalem lebih lega */
}

/* Jarak antara Judul Card (Toolbar) dengan isi list */
.addr-toolbar {
  margin-bottom: 16px !important;
}

/* Judul kecil di dalam card (misal: "Daftar Alamat") */
.card h4 {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}

/* 4. ITEM LIST (Alamat, Pengiriman, Pembayaran) */
/* Bikin grid gap lebih lega */
.addr-list, .ship-list, .pay-list {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: 16px !important; /* Jarak antar item diperlebar */
}

/* Styling Item Card Individu (Alamat/Pengiriman/Pembayaran) */
.addr-card, .ship-card, .pay-card {
  background: rgba(255,255,255, 0.5) !important;
  border: 1px solid rgba(0,0,0, 0.05) !important;
  box-shadow: 0 4px 12px rgba(0,0,0, 0.03) !important;
  border-radius: 18px !important;
  padding: 16px !important;
  transition: all 0.2s ease;
}
:root.dark .addr-card,
:root.dark .ship-card,
:root.dark .pay-card {
  background: rgba(255,255,255, 0.05) !important;
  border-color: rgba(255,255,255, 0.1) !important;
}

/* Hover Effect */
.addr-card:hover, .ship-card:hover, .pay-card:hover {
  transform: translateY(-2px);
  background: var(--glass-highlight) !important;
  box-shadow: 0 8px 20px rgba(0,0,0, 0.06) !important;
}

/* SELECTED STATE (PENTING) */
.addr-card.is-selected,
.ship-card.is-selected,
.pay-card.is-selected {
  background: color-mix(in srgb, var(--accent) 10%, white) !important;
  border: 2px solid var(--accent) !important;
  box-shadow: 0 0 0 4px var(--accent-glow) !important;
}
:root.dark .addr-card.is-selected,
:root.dark .ship-card.is-selected,
:root.dark .pay-card.is-selected {
  background: color-mix(in srgb, var(--accent) 15%, black) !important;
}

/* 5. FORM STYLE FIX (Halaman Alamat - Form Tambah) */
.form-row {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 16px;
}
@media (min-width: 600px) {
  .form-row { flex-direction: row; }
  .form-row .field { flex: 1; }
}

/* Inputan biar konsisten glass */
.input, .textarea, .select {
  background: rgba(120, 120, 128, 0.06) !important;
  border: 1px solid transparent !important;
  padding: 12px 16px !important;
  font-size: 15px !important;
  border-radius: 12px !important;
}
.input:focus, .textarea:focus, .select:focus {
  background: var(--bg) !important;
  box-shadow: 0 0 0 2px var(--accent) !important;
}

/* 6. KONFIRMASI PAGE FIX */
/* Ringkasan Pesanan items */
.sum-item {
  background: transparent !important; /* Hapus background abu biar bersih */
  border-bottom: 1px solid var(--line);
  border-radius: 0 !important;
  padding: 12px 0 !important;
}
.sum-item:last-child { border-bottom: none; }

.sum-thumb {
  width: 56px !important; height: 56px !important;
  border-radius: 12px !important;
  background: var(--chip-bg);
}

/* 1. Fix Logo Pengiriman & Pembayaran di Ringkasan */
/* Pastikan container logo punya ukuran fix dan rapi */
.sum-logo {
  width: 56px !important;
  height: 56px !important;
  flex-shrink: 0;
  border-radius: 12px;
  background: white; /* Kasih background putih biar logo PNG transparan jelas */
  border: 1px solid rgba(0,0,0,0.08);
  display: flex; 
  align-items: center; 
  justify-content: center;
  overflow: hidden;
  padding: 8px; /* Padding biar logo gak sesak */
}

/* Pastikan gambar di dalam logo pas dan tidak gepeng */
.sum-logo img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important; /* Logo harus utuh (contain), jangan dicrop */
  display: block;
}

/* 2. Fix Thumbnail Makanan di Ringkasan */
/* Pastikan gambar makanan ngisi kotak dengan cantik */
.sum-thumb img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important; /* Kalau makanan boleh dicrop (cover) biar full */
  border-radius: 12px;
  display: block;
}

/* 3. Fix Gambar QRIS Raksasa */
/* Ini biang kerok di screenshot lo. Kita batesin ukurannya */
.pay-detail-value.is-qris {
  display: flex;
  justify-content: center;
  padding: 16px;
  background: rgba(255,255,255,0.4);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  margin-top: 12px;
}

.zoomable-qris {
  max-width: 220px !important; /* Max lebar 220px, cukup buat scan */
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.1);
  box-shadow: var(--shadow-sm);
  background: white; /* QRIS butuh kontras putih biar kebaca scanner */
  padding: 8px;
  cursor: zoom-in;
}

/* Style tambahan buat text value (No Rek / E-Wallet number) biar rapi juga */
.pay-detail-value.is-text {
  background: rgba(120, 120, 128, 0.08);
  padding: 16px;
  border-radius: 16px;
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

@media (max-width: 520px) {
  /* 1. Atur Ulang Container Footer */
  .sheet {
    bottom: 16px !important;
    left: 12px !important;
    right: 12px !important;
    padding: 10px 16px !important;
    gap: 12px;
  }

  /* 2. Paksa Area Kanan (Isi tombol & teks) Menuhin Baris */
  .sheet-right {
    width: 100%;
    margin-left: 0;
    justify-content: space-between; /* Teks kiri, Tombol kanan */
    gap: 12px;
  }

  /* 3. Tombol Lanjut di Mobile: Lebih Compact tapi Tetap Gagah */
  .sheet .btn.btn-accent {
    flex: 0 0 auto;             /* Jangan mau dipenyet */
    min-width: auto !important; /* Reset lebar desktop */
    width: auto;
    height: 42px !important;    /* Tinggi mobile friendly */
    padding: 0 24px !important;
    font-size: 15px !important;
    box-shadow: 0 4px 12px rgba(255, 194, 92, 0.4) !important; /* Shadow lebih santai */
  }
  
  /* 4. Teks Label (Alamat/Pengiriman) biar gak nabrak */
  #selLabel, 
  .sheet .muted {
    flex: 1;          /* Ambil sisa space */
    min-width: 0;     /* Wajib ada biar truncate jalan */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* ... kalau kepanjangan */
    text-align: left;
    font-size: 13px !important;
  }

  /* 5. KHUSUS HALAMAN KONFIRMASI (CLEAN LOOK) */
  /* Sembunyikan rincian kecil di footer mobile, tampilkan TOTAL saja */
  .totals-grid {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 0;
    text-align: left;
  }
  
  /* Hide subtotal/ongkir/fee kecil di footer mobile (kan udah ada di atas) */
  .totals-grid .label:not(.total),
  .totals-grid .value:not(.total) {
    display: none; 
  }
  
  /* Style Total Besar */
  .totals-grid .label.total {
    font-size: 10px; 
    text-transform: uppercase; 
    color: var(--muted); 
    border: none; padding: 0; margin: 0;
    font-weight: 600;
  }
  .totals-grid .value.total {
    font-size: 18px; 
    font-weight: 800;
    color: var(--ink);
  }
}

.card.warning-zone {
  background: rgba(255, 179, 0, 0.1) !important; 
  border: 1px solid rgba(255, 179, 0, 0.4) !important;
  box-shadow: 0 4px 20px rgba(255, 179, 0, 0.15) !important;
}

:root.dark .card.warning-zone {
  background: rgba(255, 179, 0, 0.15) !important;
  border-color: rgba(255, 179, 0, 0.5) !important;
}

.note-warning {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.warning-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: rgba(255, 179, 0, 0.2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #b36b00; /* Darker amber for icon */
}
:root.dark .warning-icon { color: #ffca28; }

.warning-title {
  display: block;
  font-size: 15px;
  font-weight: 800;
  color: #b36b00; /* Darker amber text */
  margin-bottom: 4px;
  letter-spacing: -0.3px;
  text-transform: uppercase;
}
:root.dark .warning-title { color: #ffca28; }

.warning-desc {
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
  margin: 0;
  opacity: 0.9;
}

/* Bold text di deskripsi warnanya ngikutin tema warning */
.warning-desc b {
  color: #b36b00;
  font-weight: 700;
}
:root.dark .warning-desc b { color: #ffca28; }

/* --- FOOTER EXPANDABLE (Mobile Only) --- */

/* Default: Tombol toggle sembunyi di Desktop */
.btn-toggle-detail {
  display: none;
}

@media (max-width: 520px) {
  /* 1. Munculin tombol toggle di Mobile */
  .btn-toggle-detail {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.05);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: var(--ink);
    cursor: pointer;
    transition: transform 0.3s ease, background 0.2s;
    margin-right: 8px; /* Jarak ke teks Total */
  }
  .btn-toggle-detail:active {
    background: rgba(0,0,0,0.1);
  }
  
  /* Posisi Sheet Right biar tombol ada di sebelah kiri teks */
  .sheet-right {
    position: relative;
    padding-left: 0; 
  }

  /* 2. Logic Show/Hide Rincian */
  
  /* Default Mobile: Sembunyikan rincian (kecuali Total) */
  .totals-grid .label:not(.total),
  .totals-grid .value:not(.total) {
    display: none; 
    font-size: 13px; /* Kecilin dikit biar muat */
    margin-bottom: 2px;
  }

  /* Kalo lagi EXPANDED: Munculin semua sebagai block */
  .sheet.is-expanded .totals-grid .label:not(.total),
  .sheet.is-expanded .totals-grid .value:not(.total) {
    display: block;
    animation: slideIn 0.2s ease-out forwards;
  }
  
  /* Layout Grid pas Expanded biar rapi (Kiri Label, Kanan Value) */
  .sheet.is-expanded .totals-grid {
    display: grid;
    grid-template-columns: 1fr auto; /* Label kiri, Value kanan */
    gap: 4px 16px;
    width: 100%;
    margin-bottom: 8px; /* Kasih jarak ke Total bawah */
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
  }
  
  /* Total Row pas Expanded */
  .sheet.is-expanded .label.total,
  .sheet.is-expanded .value.total {
    font-size: 16px; /* Balikin ukuran gede */
    margin-top: 4px;
  }

  /* 3. Puter Panah pas Expanded */
  .sheet.is-expanded .btn-toggle-detail {
    transform: rotate(180deg); /* Panah jadi nunjuk ke bawah */
    background: var(--accent); /* Kasih warna biar tau lagi aktif */
    color: var(--accent-ink);
  }

  /* Animasi halus */
  @keyframes slideIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
  }
  
  /* Adjust layout sheet biar tombol toggle gak nempel banget */
  .sheet-right {
    flex-wrap: wrap; /* Biar rincian bisa menuhin baris atas */
    align-items: center; /* Center vertikal */
  }
  
  /* Tombol Order tetep di kanan/bawah */
  #btnOrder {
    margin-left: auto;
  }
}