/* ============================================================
   MedanKahwin — Fusion Design System
   ============================================================
   Structure & Clarity (retail DNA) + Ethereal Statecraft (modern flair)
   ============================================================ */

/* ----- Design Tokens ----- */
:root {
  /* ── Primary: Deep Navy (S&C) ── */
  --color-primary: #041627;
  --color-primary-gradient: linear-gradient(135deg, #041627, #1a2b3c);
  --color-on-primary: #ffffff;
  --color-primary-container: #1a2b3c;
  --color-on-primary-container: #8192a7;
  --color-primary-fixed: #d2e4fb;
  --color-primary-fixed-dim: #b7c8de;
  --color-on-primary-fixed: #0b1d2d;
  --color-on-primary-fixed-variant: #38485a;
  --color-inverse-primary: #b7c8de;

  /* ── Secondary: Vibrant Orange (S&C) ── */
  --color-secondary: #fea520;
  --color-secondary-gradient: linear-gradient(135deg, #fea520, #ffb961);
  --color-on-secondary: #041627;
  --color-secondary-container: #865300;
  --color-on-secondary-container: #694000;
  --color-secondary-fixed: #ffddb9;
  --color-secondary-fixed-dim: #ffb961;
  --color-on-secondary-fixed: #2b1700;
  --color-on-secondary-fixed-variant: #663e00;

  /* ── Surface (S&C base + Ethereal cooler background) ── */
  --color-background: #f7f9fb;
  --color-on-background: #191c1d;
  --color-surface: #f7f9fb;
  --color-surface-dim: #d9dadb;
  --color-surface-bright: #f7f9fb;
  --color-surface-container-lowest: #ffffff;
  --color-surface-container-low: #f3f4f5;
  --color-surface-container: #edeeef;
  --color-surface-container-high: #e7e8e9;
  --color-surface-container-highest: #e1e3e4;
  --color-surface-variant: #e1e3e4;
  --color-surface-tint: #4f6073;

  /* ── On-surface (text) ── */
  --color-on-surface: #191c1d;
  --color-on-surface-variant: #44474c;

  /* ── Tertiary (warm brown accent) ── */
  --color-tertiary: #211200;
  --color-on-tertiary: #ffffff;
  --color-tertiary-container: #38260b;
  --color-on-tertiary-container: #a88c69;

  /* ── Error ── */
  --color-error: #ba1a1a;
  --color-on-error: #ffffff;
  --color-error-container: #ffdad6;
  --color-on-error-container: #93000a;

  /* ── Outline ── */
  --color-outline: #74777d;
  --color-outline-variant: #c4c6cd;

  /* ── Inverse ── */
  --color-inverse-surface: #2e3132;
  --color-inverse-on-surface: #f0f1f2;

  /* ── Typography (S&C fonts) ── */
  --font-headline: 'Manrope', -apple-system, sans-serif;
  --font-body: 'Work Sans', -apple-system, sans-serif;
  --fs-display-lg: 48px;
  --fs-display-lg-mobile: 32px;
  --fs-headline-md: 32px;
  --fs-headline-sm: 24px;
  --fs-body-lg: 18px;
  --fs-body-md: 16px;
  --fs-label-md: 14px;
  --fs-label-sm: 12px;

  /* ── Spacing (8px scale) ── */
  --space-xs: 4px;
  --space-sm: 12px;
  --space-base: 8px;
  --space-md: 24px;
  --space-lg: 48px;
  --space-xl: 80px;
  --space-gutter: 24px;
  --space-margin-mobile: 16px;
  --space-margin-desktop: 64px;

  /* ── Border Radius (blend: S&C sizes + Ethereal full pill) ── */
  --radius-sm: 0.25rem;
  --radius-DEFAULT: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;

  /* ── Shadows (S&C ambient shadows) ── */
  --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.12);

  /* ── Glass (from Ethereal) ── */
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-blur: blur(40px) saturate(1.8);
  --glass-border: 1px solid rgba(255, 255, 255, 0.6);
  --glass-shadow: 0 4px 24px -1px rgba(0, 0, 0, 0.04);

  /* ── Component Surfaces ── */
  --card-bg: #ffffff;
  --card-bg-hover: #ffffff;
  --card-border: 1px solid transparent;
  --input-bg: #ffffff;
  --input-bg-focus: #ffffff;
  --input-border: 1px solid #c4c6cd;
  --input-focus-ring: 0 0 0 3px rgba(4, 22, 39, 0.1);
  --divider-line: rgba(116, 119, 125, 0.12);
  --divider-line-strong: rgba(116, 119, 125, 0.2);

  /* ── Layout ── */
  --container-max: 1440px;
  --sidebar-width: 260px;
}

/* ============================================================
   DARK THEME — Ethereal-inspired deep navy-purple
   ============================================================ */
:root[data-theme="dark"] {
  --color-primary: #b7c8de;
  --color-primary-gradient: linear-gradient(135deg, #b7c8de, #d2e4fb);
  --color-on-primary: #041627;
  --color-primary-container: #38485a;
  --color-on-primary-container: #d2e4fb;

  --color-secondary: #ffb961;
  --color-secondary-gradient: linear-gradient(135deg, #ffb961, #ffddb9);
  --color-on-secondary: #2b1700;
  --color-secondary-container: #663e00;
  --color-on-secondary-container: #ffddb9;

  --color-background: #161625;
  --color-on-background: #e2e2e8;
  --color-surface: #161625;
  --color-surface-dim: #121220;
  --color-surface-bright: #1e1e30;
  --color-surface-container-lowest: #121220;
  --color-surface-container-low: #181828;
  --color-surface-container: #1e1e32;
  --color-surface-container-high: #262640;
  --color-surface-container-highest: #303058;
  --color-surface-variant: #383860;

  --color-on-surface: #e2e2e8;
  --color-on-surface-variant: #b8b8c8;

  --color-outline: #8e8e9e;
  --color-outline-variant: #505068;

  --color-inverse-surface: #f0f1f2;
  --color-inverse-on-surface: #2e3132;

  /* Glass → dark frosted glass */
  --glass-bg: rgba(22, 22, 37, 0.75);
  --glass-blur: blur(40px) saturate(1.6);
  --glass-border: 1px solid rgba(255, 255, 255, 0.12);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);

  /* Component surfaces → dark */
  --card-bg: #1e1e32;
  --card-bg-hover: #262640;
  --card-border: 1px solid rgba(255, 255, 255, 0.06);
  --input-bg: #1a1a2c;
  --input-bg-focus: #222238;
  --input-border: 1px solid #505068;
  --input-focus-ring: 0 0 0 3px rgba(183, 200, 222, 0.15);
  --divider-line: rgba(255, 255, 255, 0.08);
  --divider-line-strong: rgba(255, 255, 255, 0.12);

  --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.16);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.22);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.30);
  --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.40);
}

/* Dark mode footer & surfaces */
[data-theme="dark"] .bg-surface-container-highest {
  background-color: #1a1a2c;
}
[data-theme="dark"] .bg-surface-container-high {
  background-color: #262640;
}
[data-theme="dark"] .bg-surface-container {
  background-color: #1e1e32;
}
[data-theme="dark"] .bg-surface-container-low {
  background-color: #181828;
}
[data-theme="dark"] .bg-surface-container-lowest {
  background-color: #121220;
}
[data-theme="dark"] .border-outline-variant {
  border-color: #505068;
}

/* Dark mode text — Tailwind utility overrides */
[data-theme="dark"] .cart-count {
  color: #000000;
}
[data-theme="dark"] .text-primary {
  color: #b7c8de;
}
[data-theme="dark"] .text-on-surface-variant {
  color: #b8b8c8;
}
[data-theme="dark"] .text-on-surface {
  color: #e2e2e8;
}
[data-theme="dark"] .hover\:text-primary:hover {
  color: var(--color-secondary);
}
/* group-hover text — prevents dark text on dark bg in dark mode */
[data-theme="dark"] .group:hover .group-hover\:text-on-surface {
  color: #e2e2e8;
}

/* Dark mode — checkbox (override Tailwind Forms white bg) */
[data-theme="dark"] input[type="checkbox"] {
  background-color: #1a1a2c;
  border-color: #505068;
  color-scheme: dark;
}
[data-theme="dark"] input[type="checkbox"]:checked {
  background-color: #fea520;
  border-color: #fea520;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

html {
  font-family: var(--font-body);
  font-size: var(--fs-body-md);
  color: var(--color-on-surface);
  background: var(--color-background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  line-height: 1.6;
  background: var(--color-background);
  color: var(--color-on-surface);
  transition: background 0.35s ease, color 0.35s ease;
  margin: 0;
  padding: 0;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { opacity: 0.85; }
button { color: inherit; font-family: inherit; }
img { max-width: 100%; height: auto; }

/* ============================================================
   TYPOGRAPHY UTILITIES
   ============================================================ */
.display-lg {
  font-family: var(--font-headline);
  font-size: var(--fs-display-lg);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.display-lg-mobile {
  font-family: var(--font-headline);
  font-size: var(--fs-display-lg-mobile);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
}
.headline-md {
  font-family: var(--font-headline);
  font-size: var(--fs-headline-md);
  font-weight: 700;
  line-height: 1.25;
}
.headline-sm {
  font-family: var(--font-headline);
  font-size: var(--fs-headline-sm);
  font-weight: 600;
  line-height: 1.3;
}
.body-lg {
  font-family: var(--font-body);
  font-size: var(--fs-body-lg);
  font-weight: 400;
  line-height: 1.6;
}
.body-md {
  font-family: var(--font-body);
  font-size: var(--fs-body-md);
  font-weight: 400;
  line-height: 1.5;
}
.label-md {
  font-family: var(--font-body);
  font-size: var(--fs-label-md);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.01em;
}
.label-sm {
  font-family: var(--font-body);
  font-size: var(--fs-label-sm);
  font-weight: 500;
  line-height: 1.3;
}

/* Text gradient (from Ethereal) */
.text-gradient {
  background: linear-gradient(135deg, #ffffff, var(--color-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================================
   GLASS COMPONENTS (from Ethereal — nav, dropdowns, modals only)
   ============================================================ */
/* Menu card — frosted glass card for grouped nav items */
.menu-card {
  display: flex;
  align-items: center;
  gap: 20px;
  background: rgba(4, 22, 39, 0.9);
  backdrop-filter: blur(20px) saturate(1.8);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 14px 28px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}
:root[data-theme="dark"] .menu-card {
  background: rgba(22, 22, 37, 0.85);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}
.menu-card a {
  color: rgba(255, 255, 255, 0.8);
  font-family: var(--font-body);
  font-size: var(--fs-label-md);
  font-weight: 500;
  line-height: 2;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s ease;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}
.menu-card a:hover {
  color: var(--color-secondary);
}
.menu-card a.active {
  color: var(--color-secondary);
  font-weight: 700;
}
.menu-card button {
  color: rgba(255, 255, 255, 0.8);
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: all 0.2s ease;
  padding: 0;
}
.menu-card button:hover {
  color: var(--color-secondary);
}

/* When the menu-card IS the link/button (icon cards) */
a.menu-card,
button.menu-card {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}
a.menu-card:hover,
button.menu-card:hover {
  color: var(--color-secondary);
}
a.menu-card.active {
  color: var(--color-secondary);
}

/* Icon-only card — square/circular */
.menu-card-icon {
  padding: 14px;
  gap: 0;
}

/* Top bar — wraps brand card + nav pills as independent floating cards */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  pointer-events: none;
  flex-wrap: wrap;
}
.top-bar > * {
  pointer-events: auto;
}

/* Brand card — standalone logo card */
.brand-card {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 200px;
  background: rgba(4, 22, 39, 0.9);
  backdrop-filter: blur(20px) saturate(1.8);
  -webkit-backdrop-filter: blur(20px) saturate(1.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 14px 28px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  font-family: var(--font-headline);
  font-size: 20px;
  line-height: 1.4;
  font-weight: 700;
  color: #ffffff;
  text-decoration: none;
  letter-spacing: -0.01em;
  transition: all 0.2s ease;
}
.brand-card:hover {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  transform: translateY(-1px);
}
:root[data-theme="dark"] .brand-card {
  background: rgba(22, 22, 37, 0.85);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.glass-dropdown {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: var(--shadow-xl);
  border-radius: var(--radius-lg);
}
:root[data-theme="dark"] .glass-dropdown {
  background: rgba(30, 30, 50, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: var(--card-border);
  border-radius: var(--radius-lg);
}

/* ============================================================
   BUTTONS (S&C colors + Ethereal gradient + pill shape)
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  font-family: var(--font-body);
  font-size: var(--fs-label-md);
  font-weight: 600;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
}
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

/* Primary — gradient navy */
.btn-primary {
  background: var(--color-primary-gradient);
  color: var(--color-on-primary);
  box-shadow: 0 4px 16px rgba(4, 22, 39, 0.25);
}
.btn-primary:hover {
  opacity: 0.92;
  box-shadow: 0 6px 24px rgba(4, 22, 39, 0.35);
  transform: translateY(-1px);
}

/* Secondary — gradient orange */
.btn-secondary {
  background: var(--color-secondary-gradient);
  color: var(--color-on-secondary);
  box-shadow: 0 4px 16px rgba(254, 165, 32, 0.25);
}
.btn-secondary:hover {
  opacity: 0.92;
  box-shadow: 0 6px 24px rgba(254, 165, 32, 0.4);
  transform: translateY(-1px);
}

/* Outline */
.btn-outline {
  background: transparent;
  border: 1px solid var(--color-outline-variant);
  color: var(--color-on-surface-variant);
}
.btn-outline:hover {
  background: rgba(4, 22, 39, 0.04);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--color-on-surface-variant);
}
.btn-ghost:hover {
  background: rgba(4, 22, 39, 0.05);
  color: var(--color-on-surface);
}

/* Sizes */
.btn-sm { padding: 6px 16px; font-size: var(--fs-label-sm); }
.btn-lg { padding: 14px 32px; font-size: var(--fs-body-md); }
.btn-icon {
  width: 40px; height: 40px; padding: 0;
  border-radius: var(--radius-full);
}

/* ============================================================
   CARDS (S&C clean white + Ethereal hover lift)
   ============================================================ */
.card {
  background: var(--card-bg);
  border: var(--card-border);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
}

.product-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
}
.product-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

/* Compact card for related products */
.product-card-compact {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: var(--space-sm);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}
.product-card-compact:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* ============================================================
   INPUTS (Ethereal glass input + S&C focus ring)
   ============================================================ */
.input-glass {
  width: 100%;
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: var(--fs-body-md);
  color: var(--color-on-surface);
  background: var(--input-bg);
  border: var(--input-border);
  border-radius: var(--radius-xl);
  outline: none;
  transition: all 0.2s ease;
}
.input-glass:focus {
  border-color: var(--color-primary);
  box-shadow: var(--input-focus-ring);
  background: var(--input-bg-focus);
}
.input-glass::placeholder { color: var(--color-outline); opacity: 0.6; }

textarea.input-glass {
  resize: vertical;
  min-height: 100px;
}

/* Search capsule (from Ethereal) */
.search-capsule {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 400px;
  height: 44px;
  padding: 0 16px;
  background: var(--input-bg);
  border: var(--input-border);
  border-radius: var(--radius-full);
  transition: all 0.2s ease;
}
.search-capsule:focus-within {
  border-color: var(--color-primary);
  box-shadow: var(--input-focus-ring);
}
.search-capsule input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-family: var(--font-body);
  font-size: var(--fs-label-md);
  color: var(--color-on-surface);
}
.search-capsule input::placeholder { color: var(--color-outline); opacity: 0.5; }
.search-capsule .material-symbols-outlined {
  font-size: 20px;
  color: var(--color-outline);
}

/* ============================================================
   BADGES & CHIPS (Ethereal pill badges + S&C colors)
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  font-size: var(--fs-label-sm);
  font-weight: 600;
  border-radius: var(--radius-full);
}
.badge-new {
  background: rgba(254, 165, 32, 0.12);
  color: var(--color-secondary);
}
.badge-sale {
  background: var(--color-secondary);
  color: var(--color-on-secondary);
}
.badge-out {
  background: rgba(116, 119, 125, 0.12);
  color: var(--color-outline);
}
.badge-instock {
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
}

/* ============================================================
   SEGMENTED CONTROL (from Ethereal)
   ============================================================ */
.segmented-control {
  display: flex;
  background: var(--color-surface-container-low);
  border-radius: var(--radius-full);
  padding: 4px;
  border: 1px solid var(--color-outline-variant);
}
.segmented-option {
  flex: 1;
  text-align: center;
  padding: 8px 20px;
  border-radius: var(--radius-full);
  font-size: var(--fs-label-md);
  font-weight: 500;
  color: var(--color-on-surface-variant);
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  background: transparent;
  font-family: inherit;
}
.segmented-option.active {
  background: var(--color-surface-container-lowest);
  box-shadow: var(--shadow-sm);
  color: var(--color-on-surface);
  font-weight: 600;
}

/* ============================================================
   SUB NAV PILLS (from Ethereal — for filter tabs)
   ============================================================ */
.subnav {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--color-surface-container-low);
  border-radius: 32px;
  border: 1px solid var(--color-outline-variant);
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.subnav::-webkit-scrollbar { display: none; }
.subnav-pill {
  padding: 8px 20px;
  font-size: var(--fs-label-md);
  font-weight: 500;
  color: var(--color-on-surface-variant);
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  text-align: center;
  text-decoration: none;
  font-family: inherit;
  line-height: 1.5;
}
.subnav-pill.active {
  background: var(--color-surface-container-lowest);
  box-shadow: var(--shadow-sm);
  color: var(--color-on-surface);
  font-weight: 600;
}

/* ============================================================
   STATUS DOTS (from Ethereal)
   ============================================================ */
.status-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot-green  { background: #22c55e; box-shadow: 0 0 6px rgba(34,197,94,0.4); }
.status-dot-orange { background: #fea520; box-shadow: 0 0 6px rgba(254,165,32,0.4); }
.status-dot-red    { background: #ef4444; box-shadow: 0 0 6px rgba(239,68,68,0.4); }

/* ============================================================
   SHOP FILTERS (sidebar)
   ============================================================ */
.filter-section {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--divider-line);
}
.filter-section + .filter-section { margin-top: var(--space-sm); }
.filter-heading {
  font-family: var(--font-headline);
  font-size: var(--fs-headline-sm);
  font-weight: 600;
  color: var(--color-on-surface);
  margin-bottom: var(--space-sm);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--divider-line-strong);
}
.filter-checkbox-group { display: flex; flex-direction: column; gap: 2px; }
.filter-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--fs-label-md);
  color: var(--color-on-surface-variant);
  transition: all 0.15s;
  border-bottom: 1px solid var(--divider-line);
}
.filter-checkbox:last-child { border-bottom: none; }
.filter-checkbox:hover { background: rgba(4, 22, 39, 0.03); color: var(--color-on-surface); }
[data-theme="dark"] .filter-checkbox:hover { background: rgba(255, 255, 255, 0.04); }
.filter-checkbox input[type="checkbox"] { accent-color: var(--color-primary); }
[data-theme="dark"] .filter-checkbox input[type="checkbox"] { accent-color: var(--color-secondary); color-scheme: dark; }
[data-theme="dark"] input[type="checkbox"] { color-scheme: dark; accent-color: var(--color-secondary); }

/* ============================================================
   QUANTITY SELECTOR (cart)
   ============================================================ */
.qty-selector {
  display: flex;
  align-items: center;
  border: 1px solid var(--color-outline-variant);
  border-radius: var(--radius-full);
  overflow: hidden;
  background: var(--color-surface-container-lowest);
}
.qty-selector button {
  width: 36px; height: 36px;
  border: none; background: transparent;
  color: var(--color-primary);
  cursor: pointer;
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.qty-selector button:hover { background: var(--color-surface-container-low); }
.qty-selector input {
  width: 48px; text-align: center;
  border: none; background: transparent;
  font-family: var(--font-body);
  font-size: var(--fs-body-md);
  font-weight: 600;
  color: var(--color-on-surface);
  outline: none;
}

/* Price stepper: input left, +/- pills stacked right */
.price-stepper-vertical {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--color-outline-variant);
  border-radius: var(--radius-full);
  overflow: hidden;
  background: var(--color-surface-container-lowest);
  width: 90px;
}
.price-stepper-vertical input {
  flex: 1;
  min-width: 0; text-align: center;
  border: none; background: transparent;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-on-surface);
  outline: none;
  padding: 4px 2px;
  pointer-events: none;
}
.price-stepper-vertical .stepper-btns {
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--color-outline-variant);
}
.price-stepper-vertical .stepper-btns button {
  flex: 1;
  width: 26px;
  border: none; background: transparent;
  color: var(--color-primary);
  cursor: pointer;
  font-size: 14px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
  line-height: 1;
}
.price-stepper-vertical .stepper-btns button:first-child {
  border-bottom: 1px solid var(--color-outline-variant);
}
.price-stepper-vertical .stepper-btns button:hover { background: var(--color-surface-container-low); }

/* ============================================================
   DIVIDER
   ============================================================ */
.divider {
  height: 1px;
  background: var(--divider-line-strong);
  margin: var(--space-sm) 0;
}

/* ============================================================
   TOGGLE SWITCH (from Ethereal)
   ============================================================ */
.toggle-switch {
  display: inline-block;
  position: relative;
  width: 44px; height: 24px;
  background: var(--color-outline-variant);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
  vertical-align: middle;
}
.toggle-switch.active { background: var(--color-primary); }
.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 20px; height: 20px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
.toggle-switch.active::after { transform: translateX(20px); }

/* ============================================================
   USER MENU DROPDOWN (glass)
   ============================================================ */
.user-menu { position: relative; display: inline-block; }
.user-menu-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 8px;
  min-width: 240px;
  z-index: 100;
  overflow: hidden;
}
.user-menu-dropdown.show { display: block; animation: fadeInUp 0.2s ease-out; }
.user-menu-dropdown .menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  color: var(--color-on-surface);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}
.user-menu-dropdown .menu-item:hover { background: rgba(4, 22, 39, 0.04); }
.user-menu-dropdown .menu-item.danger { color: var(--color-error); }
.menu-section-label {
  padding: 10px 18px 4px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  color: var(--color-outline);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.lang-check { visibility: hidden; color: var(--color-primary); font-weight: 700; }

/* ============================================================
   CART ITEM ROW
   ============================================================ */
.cart-item-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-sm);
  align-items: center;
  padding: var(--space-md);
  border-bottom: 1px solid var(--divider-line);
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}
.cart-item-row:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
@media (min-width: 768px) {
  .cart-item-row {
    grid-template-columns: 6fr 2fr 2fr 2fr;
  }
}

/* ============================================================
   MODAL OVERLAY (from Ethereal)
   ============================================================ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 100;
  display: none;
}
.modal-backdrop.active { display: block; }

.modal-dialog {
  position: fixed;
  inset: 0;
  z-index: 101;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}
.modal-dialog.active {
  pointer-events: auto;
  opacity: 1;
}
.modal-dialog-card {
  background: var(--color-surface-container-highest);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  max-width: 420px;
  width: calc(100% - 32px);
  box-shadow: var(--shadow-xl);
  text-align: center;
}
[data-theme="dark"] .modal-dialog-card {
  background: #262640;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.modal-dialog-card .modal-icon {
  font-size: 48px;
  color: var(--color-secondary);
  margin-bottom: var(--space-sm);
}
.modal-dialog-card .modal-title {
  font-family: var(--font-headline);
  font-size: var(--fs-headline-sm);
  color: var(--color-on-surface);
  margin-bottom: var(--space-xs);
}
.modal-dialog-card .modal-message {
  font-size: var(--fs-body-md);
  color: var(--color-on-surface-variant);
  margin-bottom: var(--space-lg);
  line-height: 1.6;
}
.modal-dialog-card .modal-actions {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
}

/* ============================================================
   SKELETON LOADING
   ============================================================ */
.skeleton {
  background: linear-gradient(90deg,
    var(--color-surface-container) 25%,
    var(--color-surface-container-highest) 50%,
    var(--color-surface-container) 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}
@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================================
   TOAST NOTIFICATION
   ============================================================ */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--color-primary);
  color: var(--color-on-primary);
  padding: 12px 24px;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  font-family: var(--font-body);
  font-size: var(--fs-label-md);
  font-weight: 500;
  animation: slideUp 0.3s ease-out;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideUp {
  from { transform: translateY(100px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes scaleIn {
  from { transform: scale(0.8); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.animate-fade-in-up { animation: fadeInUp 0.4s ease forwards; }
.animate-fade-in    { animation: fadeIn 0.3s ease forwards; }
.animate-slide-up   { animation: slideUp 0.3s ease-out; }
.animate-float      { animation: float 3s ease-in-out infinite; }
.animate-scale-in   { animation: scaleIn 0.35s ease forwards; }

/* ============================================================
   SCROLLBAR STYLING
   ============================================================ */
.custom-scrollbar::-webkit-scrollbar { width: 5px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: var(--color-outline-variant);
  border-radius: 10px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover { background: var(--color-outline); }
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ============================================================
   LINE CLAMP
   ============================================================ */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============================================================
   MOBILE FILTER PANEL
   ============================================================ */
@media (max-width: 767px) {
  #filter-panel {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 85%;
    max-width: 320px;
    z-index: 40;
    background: var(--color-background);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
  }
  #filter-panel.open { transform: translateX(0); }
}

/* ============================================================
   RESPONSIVE HELPERS
   ============================================================ */
@media (max-width: 768px) {
  :root {
    --fs-display-lg: var(--fs-display-lg-mobile);
  }
  .display-lg { font-size: var(--fs-display-lg-mobile); line-height: 1.25; }
}

/* ── Mobile: Compact top bar (≤480px) ── */
@media (max-width: 480px) {
  .brand-card {
    min-width: auto !important;
    padding: 8px 12px !important;
    font-size: 15px !important;
  }
  .menu-card-icon {
    padding: 9px !important;
  }
  .top-bar {
    gap: 6px !important;
    padding: 8px 8px !important;
  }
  .menu-card {
    padding: 6px 12px !important;
    gap: 10px !important;
  }
  .menu-card a {
    font-size: 12px !important;
  }
  /* Auth card — reduce massive padding on small phones */
  .auth-card {
    padding: var(--space-md) !important;   /* 24px instead of 80px */
  }
  .auth-page {
    padding: var(--space-md) var(--space-margin-mobile) !important;
  }
  /* Toast — center on narrow screens */
  .toast {
    left: 16px !important;
    right: 16px !important;
    text-align: center !important;
  }
  /* Contact map — shorter */
  .map-placeholder {
    height: 180px !important;
  }
  /* Product spec name — tighter */
  .spec-row-name {
    min-width: 56px !important;
  }
}

/* ── Mobile Navigation Panel ── */
.mobile-nav-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  z-index: 60; display: none; opacity: 0; transition: opacity 0.3s;
}
.mobile-nav-overlay.open { display: block; opacity: 1; }

.mobile-nav-panel {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 80%; max-width: 320px;
  background: var(--color-surface-container-lowest, #fff);
  z-index: 61;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-xl);
  overflow-y: auto;
}
.mobile-nav-panel.open { transform: translateX(0); }

.mobile-nav-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-outline-variant, #e0e0e0);
}
.mobile-nav-header h3 {
  font-family: var(--font-headline); font-size: 18px; font-weight: 700;
  color: var(--color-primary, #041627); margin: 0;
}
.mobile-nav-close {
  background: none; border: none; font-size: 24px; cursor: pointer;
  color: var(--color-on-surface-variant, #666); padding: 4px;
  line-height: 1; border-radius: 50%;
}
.mobile-nav-close:hover { color: var(--color-error, #ba1a1a); }

.mobile-nav-links {
  display: flex; flex-direction: column; padding: 12px 0;
}
.mobile-nav-links a {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px; font-size: 15px; font-weight: 500;
  color: var(--color-on-surface, #191c1d); text-decoration: none;
  transition: background 0.15s;
}
.mobile-nav-links a:hover { background: rgba(0,0,0,0.04); }
.mobile-nav-links a .material-symbols-outlined { font-size: 22px; color: var(--color-on-surface-variant, #666); }

.mobile-nav-section {
  padding: 20px 20px 8px; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--color-outline, #74777d);
  border-top: 1px solid var(--color-outline-variant, #e0e0e0);
}

.mobile-nav-actions {
  padding: 8px 12px; display: flex; flex-direction: column; gap: 4px;
  border-top: 1px solid var(--color-outline-variant, #e0e0e0);
  margin-top: auto;
}
.mobile-nav-actions button, .mobile-nav-actions .nav-action {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 12px 8px; font-size: 14px; font-weight: 500;
  color: var(--color-on-surface, #191c1d); background: none; border: none;
  cursor: pointer; border-radius: 8px; font-family: inherit; text-align: left;
  text-decoration: none;
}
.mobile-nav-actions button:hover, .mobile-nav-actions .nav-action:hover {
  background: rgba(0,0,0,0.04);
}

/* Dark mode overrides for mobile nav */
[data-theme="dark"] .mobile-nav-panel {
  background: #1e1e32;
}
[data-theme="dark"] .mobile-nav-header {
  border-color: #505068;
}
[data-theme="dark"] .mobile-nav-header h3 {
  color: #e2e2e8;
}
[data-theme="dark"] .mobile-nav-links a {
  color: #e2e2e8;
}
[data-theme="dark"] .mobile-nav-links a:hover {
  background: rgba(255,255,255,0.05);
}
[data-theme="dark"] .mobile-nav-section {
  border-color: #505068;
}
[data-theme="dark"] .mobile-nav-actions {
  border-color: #505068;
}
[data-theme="dark"] .mobile-nav-actions button, [data-theme="dark"] .mobile-nav-actions .nav-action {
  color: #e2e2e8;
}
[data-theme="dark"] .mobile-nav-actions button:hover, [data-theme="dark"] .mobile-nav-actions .nav-action:hover {
  background: rgba(255,255,255,0.05);
}
[data-theme="dark"] .mobile-nav-overlay {
  background: rgba(0,0,0,0.6);
}

/* ── Mobile Bottom Navigation (root menu) ── */
/* Urutan: Laman Utama → Cari → Produk → Beg */
.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 25; /* di bawah overlay (30/60) supaya drawer menutupinya */
  display: flex;
  background: var(--color-surface-container-lowest, #ffffff);
  border-top: 1px solid var(--color-outline-variant, #e0e0e0);
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.07);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.bottom-nav a {
  flex: 1 1 0;
  min-width: 0; /* setiap tab kekal sama lebar walaupun kandungan panjang */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 2px;
  text-decoration: none;
  color: var(--color-on-surface-variant, #666666);
  transition: color 0.15s ease;
}
.bottom-nav a .material-symbols-outlined {
  font-size: 24px;
  line-height: 1;
  max-width: 100%;
  overflow: hidden; /* teks sandaran ikon tidak melebarkan tab */
}
.bottom-nav a > span:last-child {
  font-size: 10px;
  font-weight: 500;
  line-height: 1.2;
  width: 100%;
  white-space: nowrap; /* label tidak balut ke baris kedua */
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center; /* sentiasa di tengah tab */
}
.bottom-nav a.active {
  color: var(--color-secondary, #fea520);
}
.bottom-nav a.active .material-symbols-outlined {
  font-variation-settings: 'FILL' 1;
}
/* Ruang simpanan supaya bar tetap tidak menutup kandungan */
@media (max-width: 767.98px) {
  body {
    padding-bottom: calc(62px + env(safe-area-inset-bottom, 0px));
  }
}
@media (min-width: 768px) {
  .bottom-nav { display: none; }
}
[data-theme="dark"] .bottom-nav {
  background: #1e1e32;
  border-color: #505068;
}
[data-theme="dark"] .bottom-nav a {
  color: #a9a9bd;
}
[data-theme="dark"] .bottom-nav a.active {
  color: var(--color-secondary, #ffb961);
}

/* Pada telefon: ikon carian & beg pada top bar disembunyikan
   (menu bawah sudah ada Cari / Produk / Beg). Desktop kekal. */
@media (max-width: 767.98px) {
  .top-bar a.hide-on-mobile {
    display: none;
  }
  /* Butang "Saya" & pautan Kedai/Jualan/Hubungi turut disembunyikan:
     kelas .hidden/.md:block Tailwind dikalahkan oleh .user-menu/.menu-card
     dalam fail ini (kekhususan sama, fusion.css dimuatkan kemudian). */
  .top-bar .user-menu,
  .top-bar .menu-card:not(.menu-card-icon) {
    display: none;
  }
}

/* ── Mobile Filter Panel (left drawer) ── */
#filter-panel {
  pointer-events: none;
}
#filter-panel.open {
  transform: translateX(0);
  pointer-events: auto;
}
#filter-overlay {
  transition: opacity 0.3s;
}
#filter-overlay:not(.hidden) {
  display: block; opacity: 1;
}
[data-theme="dark"] #filter-panel {
  background: #1e1e32;
}
[data-theme="dark"] #filter-panel .filter-heading {
  color: #e2e2e8;
}
[data-theme="dark"] #filter-panel .border-outline-variant {
  border-color: #505068;
}

/* ── Spec Selection Modal (shared: add-to-cart + cart edit) ── */
.spec-pick-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 10000; padding: 16px; animation: fadeIn 0.2s ease;
}
.spec-pick-modal {
  background: var(--color-surface-container-lowest, #fff);
  border-radius: 16px; width: 100%; max-width: 420px; max-height: 85vh;
  overflow-y: auto; box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  animation: scaleIn 0.2s ease;
}
.spec-pick-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--color-outline-variant, #e0e0e0);
  position: sticky; top: 0; background: var(--color-surface-container-lowest, #fff);
  z-index: 1; border-radius: 16px 16px 0 0;
}
.spec-pick-header h3 {
  font-family: var(--font-headline, Manrope, sans-serif); font-size: 16px;
  font-weight: 700; color: var(--color-primary, #041627); margin: 0;
}
.spec-pick-close {
  background: none; border: none; font-size: 24px; cursor: pointer;
  color: var(--color-on-surface-variant, #666); padding: 0; line-height: 1;
}
.spec-pick-close:hover { color: var(--color-error, #ba1a1a); }
.spec-pick-body { padding: 20px; }
.spec-pick-product-name {
  font-weight: 600; font-size: 14px; color: var(--color-on-surface, #191c1d);
  margin-bottom: 16px; line-height: 1.4;
}
.spec-pick-row { margin-bottom: 14px; }
.spec-pick-label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--color-primary, #041627); margin-bottom: 8px;
}
.spec-pick-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.spec-pick-pill {
  display: inline-block; padding: 5px 14px;
  background: transparent; color: var(--color-on-surface, #333);
  border: 1.5px solid var(--color-outline, #ccc);
  border-radius: 999px; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all 0.2s; font-family: inherit;
}
.spec-pick-pill:hover { border-color: var(--color-secondary, #fea520); color: var(--color-secondary, #fea520); }
.spec-pick-pill.active {
  background: var(--color-primary-container, #1a2b3c);
  color: var(--color-on-primary, #fff); border-color: var(--color-primary-container, #1a2b3c);
}
.spec-pick-check {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px;
  cursor: pointer; color: var(--color-on-surface-variant, #44474c); user-select: none;
}
.spec-pick-check input { width: auto; accent-color: var(--color-secondary, #fea520); }
.spec-pick-custom-body { margin-top: 8px; }
.spec-pick-custom-body textarea {
  width: 100%; min-height: 72px; font-size: 13px; padding: 8px 10px;
  border: 1px solid var(--color-outline-variant, #c4c6cd); border-radius: 8px;
  background: var(--color-surface-container-lowest, #fff);
  color: var(--color-on-surface, #191c1d); outline: none;
  resize: vertical; font-family: inherit; line-height: 1.5;
}
.spec-pick-custom-body textarea:focus { border-color: var(--color-secondary, #fea520); }
.spec-pick-count { display: block; text-align: right; font-size: 11px; color: var(--color-on-surface-variant, #44474c); margin-top: 4px; }
.spec-pick-footer {
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 16px 20px; border-top: 1px solid var(--color-outline-variant, #e0e0e0);
}
.spec-pick-footer button, .spec-pick-footer a {
  font-family: inherit; font-size: 14px; font-weight: 600;
  padding: 10px 20px; border-radius: 8px; cursor: pointer;
  transition: all 0.2s; text-decoration: none; display: inline-flex;
  align-items: center; gap: 6px;
}

/* Dark mode */
[data-theme="dark"] .spec-pick-modal { background: #1e1e32; }
[data-theme="dark"] .spec-pick-header { background: #1e1e32; border-color: #505068; }
[data-theme="dark"] .spec-pick-header h3 { color: #e2e2e8; }
[data-theme="dark"] .spec-pick-product-name { color: #e2e2e8; }
[data-theme="dark"] .spec-pick-label { color: #e2e2e8; }
[data-theme="dark"] .spec-pick-pill { border-color: #505068; color: #c8c8d8; }
[data-theme="dark"] .spec-pick-pill:hover { border-color: #fea520; color: #fea520; }
[data-theme="dark"] .spec-pick-pill.active { background: #fea520; color: #1a1a2c; border-color: #fea520; }
[data-theme="dark"] .spec-pick-check { color: #a8a8b8; }
[data-theme="dark"] .spec-pick-custom-body textarea { background: #1a1a2c; color: #e2e2e8; border-color: #505068; }
[data-theme="dark"] .spec-pick-footer { border-color: #505068; }

/* Cart page legacy classes reuse */
.edit-spec-pill {  /* extend .spec-pick-pill */ }
.edit-spec-pill.active { background: var(--color-primary-container, #1a2b3c); color: var(--color-on-primary, #fff); border-color: var(--color-primary-container, #1a2b3c); }
[data-theme="dark"] .edit-spec-pill { border-color: #505068; color: #c8c8d8; }
[data-theme="dark"] .edit-spec-pill:hover { border-color: #fea520; color: #fea520; }
[data-theme="dark"] .edit-spec-pill.active { background: #fea520; color: #1a1a2c; border-color: #fea520; }

/* ============================================================
   MATERIAL SYMBOLS BASE
   ============================================================ */
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined', sans-serif;
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-smoothing: antialiased;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}
.icon-filled {
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* ============================================================
   PRODUCT IMAGE ASPECT RATIO
   ============================================================ */
.product-image-container {
  aspect-ratio: 3 / 4;
  background: var(--color-surface-container);
  position: relative;
  overflow: hidden;
}
.product-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.product-card:hover .product-image-container img { transform: scale(1.05); }

/* ============================================================
   AUTH PAGES — Login & Register
   ============================================================ */
.auth-page {
  display: flex; align-items: center; justify-content: center;
  min-height: calc(100vh - 140px);
  padding: var(--space-lg) var(--space-margin-mobile);
}
.auth-card {
  width: 100%; max-width: 440px;
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  box-shadow: 0 8px 40px rgba(0,0,0,0.06);
}
.auth-card .auth-icon {
  width: 56px; height: 56px;
  border-radius: var(--radius-full);
  background: var(--color-secondary);
  color: var(--color-on-secondary);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto var(--space-md);
}
.auth-card .auth-icon .material-symbols-outlined { font-size: 28px; }

.auth-card h1 {
  font-family: var(--font-headline);
  font-size: var(--fs-headline-md);
  font-weight: 700;
  color: var(--color-on-surface);
  text-align: center;
  margin-bottom: 4px;
}
.auth-card .auth-subtitle {
  font-size: var(--fs-body-md);
  color: var(--color-on-surface-variant);
  text-align: center;
  margin-bottom: var(--space-lg);
}
.auth-field {
  margin-bottom: var(--space-sm);
}
.auth-field label {
  display: block;
  font-family: var(--font-label);
  font-size: var(--fs-label-md);
  font-weight: 600;
  color: var(--color-on-surface);
  margin-bottom: 4px;
}
.auth-field .input-wrapper {
  position: relative;
  display: flex; align-items: center;
}
.auth-field .input-wrapper .material-symbols-outlined {
  position: absolute; left: 12px;
  font-size: 20px; color: var(--color-outline);
  pointer-events: none;
}
.auth-field .input-wrapper input {
  width: 100%;
  padding: 12px 40px 12px 40px;
  font-family: var(--font-body);
  font-size: var(--fs-body-md);
  background: var(--color-surface-container-lowest);
  border: 1px solid var(--color-outline-variant);
  border-radius: var(--radius-full);
  color: var(--color-on-surface);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.auth-field .input-wrapper input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(4, 22, 39, 0.1);
}
.auth-field .input-wrapper input::placeholder { color: var(--color-outline); opacity: 0.6; }

.auth-field .toggle-pwd {
  position: absolute; right: 8px;
  width: 32px; height: 32px;
  border: none; background: transparent;
  color: var(--color-outline);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-full);
  transition: color 0.15s;
}
.auth-field .toggle-pwd:hover { color: var(--color-on-surface-variant); }

.auth-link {
  display: block; text-align: right;
  font-size: var(--fs-label-sm);
  color: var(--color-primary);
  text-decoration: none;
  margin-bottom: var(--space-md);
  font-weight: 500;
}
.auth-link:hover { text-decoration: underline; opacity: 0.8; }

.auth-footer {
  text-align: center;
  font-size: var(--fs-body-md);
  color: var(--color-on-surface-variant);
  margin-top: var(--space-md);
}
.auth-footer a {
  color: var(--color-secondary);
  font-weight: 600;
  text-decoration: none;
}
.auth-footer a:hover { text-decoration: underline; }

.auth-divider {
  display: flex; align-items: center;
  margin: var(--space-md) 0;
  color: var(--color-on-surface-variant);
  font-size: var(--fs-label-sm);
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1;
  border-bottom: 1px solid var(--color-outline-variant);
}
.auth-divider span { padding: 0 var(--space-sm); }

.auth-error {
  background: var(--color-error-container);
  color: var(--color-error);
  font-size: var(--fs-label-sm);
  padding: 8px 16px;
  border-radius: var(--radius);
  margin-bottom: var(--space-sm);
  display: none;
}
.auth-error.show { display: block; }

/* Dark mode */
[data-theme="dark"] .auth-field .input-wrapper input {
  background-color: #1a1a2c; color: #e2e2e8; border-color: #505068;
}
[data-theme="dark"] .auth-field .input-wrapper input:focus {
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 3px rgba(254, 165, 32, 0.15);
}
[data-theme="dark"] .auth-card {
  background: rgba(24, 24, 40, 0.85);
  border-color: rgba(255,255,255,0.06);
}
