:root {
  color-scheme: light;
  --brand: #D62872;
  --brand-dark: #AD1B59;
  --brand-light: #FFF0F6;
  --brand-contrast: #FFFFFF;
  --brand-gradient: linear-gradient(135deg, #D62872 0%, #E91E63 55%, #FF6B35 100%);
  --top-strip-bg: #1E1B4B;
  --top-strip-text: #F8FAFC;
  --sidebar-bg: #1E1B4B;
  --footer-bg: #1E293B;
  --footer-text: #CBD5E1;
  --footer-muted: #94A3B8;
  --accent: #FF6B35;
  --gold: #F59E0B;
  --bg: #F5F6FA;
  --surface: #FFFFFF;
  --surface-alt: #F8FAFC;
  --border: #E5E7EB;
  --border-strong: #CBD5E1;
  --text: #1E293B;
  --text-muted: #64748B;
  --success: #059669;
  --success-bg: #ECFDF5;
  --danger: #DC2626;
  --danger-bg: #FEF2F2;
  --info: #2563EB;
  --info-bg: #EFF6FF;
  --warn: #D97706;
  --warn-bg: #FFFBEB;
  --flash-bg: linear-gradient(135deg, #FFF0F6 0%, #FFF7ED 100%);
  --flash-border: #FBCFE8;
  --coupon-bg: linear-gradient(135deg, #FFF0F6 0%, #FFFFFF 100%);
  --coupon-border: #F472B6;
  --table-hover: #FFF9FC;
  --btn-radius: 10px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-hover: 0 14px 30px rgba(214, 40, 114, 0.14);
  --container-max: 1240px;
  accent-color: var(--brand);
}

/* ==================== COLOR THEME PRESETS ==================== */
:root[data-theme="ocean-tech"] {
  --brand: #0284C7;
  --brand-dark: #0369A1;
  --brand-light: #E0F2FE;
  --brand-gradient: linear-gradient(135deg, #0284C7 0%, #2563EB 100%);
  --top-strip-bg: #0F172A;
  --sidebar-bg: #0F172A;
  --accent: #0EA5E9;
  --bg: #F0F7FF;
  --flash-bg: linear-gradient(135deg, #E0F2FE 0%, #EFF6FF 100%);
  --flash-border: #BAE6FD;
  --coupon-bg: linear-gradient(135deg, #E0F2FE 0%, #FFFFFF 100%);
  --coupon-border: #38BDF8;
  --table-hover: #F0F9FF;
  --shadow-hover: 0 14px 30px rgba(2, 132, 199, 0.16);
}

:root[data-theme="sunset-orange"] {
  --brand: #EA580C;
  --brand-dark: #C2410C;
  --brand-light: #FFF7ED;
  --brand-gradient: linear-gradient(135deg, #EA580C 0%, #F97316 60%, #F59E0B 100%);
  --top-strip-bg: #431407;
  --sidebar-bg: #431407;
  --accent: #D97706;
  --bg: #FFFBF5;
  --flash-bg: linear-gradient(135deg, #FFEDD5 0%, #FEF3C7 100%);
  --flash-border: #FDBA74;
  --coupon-bg: linear-gradient(135deg, #FFF7ED 0%, #FFFFFF 100%);
  --coupon-border: #FB923C;
  --table-hover: #FFF7ED;
  --shadow-hover: 0 14px 30px rgba(234, 88, 12, 0.16);
}

:root[data-theme="emerald-fresh"] {
  --brand: #047857;
  --brand-dark: #065F46;
  --brand-light: #ECFDF5;
  --brand-gradient: linear-gradient(135deg, #047857 0%, #0D9488 100%);
  --top-strip-bg: #064E3B;
  --sidebar-bg: #064E3B;
  --accent: #0D9488;
  --bg: #F2FBF7;
  --flash-bg: linear-gradient(135deg, #D1FAE5 0%, #ECFDF5 100%);
  --flash-border: #6EE7B7;
  --coupon-bg: linear-gradient(135deg, #ECFDF5 0%, #FFFFFF 100%);
  --coupon-border: #34D399;
  --table-hover: #ECFDF5;
  --shadow-hover: 0 14px 30px rgba(4, 120, 87, 0.16);
}

:root[data-theme="muji-latte"] {
  --brand: #854D27;
  --brand-dark: #633619;
  --brand-light: #F7EFE6;
  --brand-gradient: linear-gradient(135deg, #854D27 0%, #B07D4F 100%);
  --top-strip-bg: #3B2314;
  --top-strip-text: #FAF6F0;
  --sidebar-bg: #3B2314;
  --footer-bg: #2C1A10;
  --accent: #B07D4F;
  --bg: #FAF6F0;
  --surface: #FFFFFF;
  --surface-alt: #F6F0E8;
  --border: #E7DCCE;
  --border-strong: #CBBBA6;
  --flash-bg: linear-gradient(135deg, #F7EFE6 0%, #FDF8F2 100%);
  --flash-border: #DFC7AC;
  --coupon-bg: linear-gradient(135deg, #F7EFE6 0%, #FFFFFF 100%);
  --coupon-border: #B07D4F;
  --table-hover: #FBF7F1;
  --shadow-hover: 0 14px 30px rgba(133, 77, 39, 0.14);
}

:root[data-theme="nordic-slate"] {
  --brand: #334155;
  --brand-dark: #1E293B;
  --brand-light: #EDF1F5;
  --brand-gradient: linear-gradient(135deg, #334155 0%, #475569 55%, #64748B 100%);
  --top-strip-bg: #0F172A;
  --top-strip-text: #F1F5F9;
  --sidebar-bg: #1E293B;
  --footer-bg: #0F172A;
  --accent: #475569;
  --bg: #F3F5F8;
  --surface: #FFFFFF;
  --surface-alt: #F8FAFC;
  --border: #DCE3EC;
  --border-strong: #94A3B8;
  --flash-bg: linear-gradient(135deg, #EDF1F5 0%, #F8FAFC 100%);
  --flash-border: #CBD5E1;
  --coupon-bg: linear-gradient(135deg, #EDF1F5 0%, #FFFFFF 100%);
  --coupon-border: #64748B;
  --table-hover: #F1F5F9;
  --shadow-hover: 0 14px 30px rgba(51, 65, 85, 0.15);
}

:root[data-theme="crimson-boutique"] {
  --brand: #9F1239;
  --brand-dark: #881337;
  --brand-light: #FFF1F2;
  --brand-gradient: linear-gradient(135deg, #9F1239 0%, #E11D48 100%);
  --top-strip-bg: #4C0519;
  --top-strip-text: #FFE4E6;
  --sidebar-bg: #4C0519;
  --footer-bg: #360514;
  --accent: #E11D48;
  --bg: #FFF5F6;
  --flash-bg: linear-gradient(135deg, #FFE4E6 0%, #FFF7ED 100%);
  --flash-border: #FDA4AF;
  --coupon-bg: linear-gradient(135deg, #FFF1F2 0%, #FFFFFF 100%);
  --coupon-border: #FB7185;
  --table-hover: #FFF1F2;
  --shadow-hover: 0 14px 30px rgba(159, 18, 57, 0.16);
}

:root[data-theme="sakura-blush"] {
  --brand: #BE185D;
  --brand-dark: #9D174D;
  --brand-light: #FDF2F8;
  --brand-gradient: linear-gradient(135deg, #BE185D 0%, #F472B6 100%);
  --top-strip-bg: #500724;
  --top-strip-text: #FCE7F3;
  --sidebar-bg: #500724;
  --footer-bg: #3B071C;
  --accent: #EC4899;
  --bg: #FFF7FA;
  --flash-bg: linear-gradient(135deg, #FCE7F3 0%, #FFF7FA 100%);
  --flash-border: #F9A8D4;
  --coupon-bg: linear-gradient(135deg, #FDF2F8 0%, #FFFFFF 100%);
  --coupon-border: #F472B6;
  --table-hover: #FDF2F8;
  --shadow-hover: 0 14px 30px rgba(190, 24, 93, 0.14);
}

:root[data-theme="matcha-olive"] {
  --brand: #4D7C0F;
  --brand-dark: #3F6212;
  --brand-light: #ECFCCB;
  --brand-gradient: linear-gradient(135deg, #4D7C0F 0%, #65A30D 100%);
  --top-strip-bg: #1A2E05;
  --top-strip-text: #ECFCCB;
  --sidebar-bg: #1A2E05;
  --footer-bg: #1A2E05;
  --accent: #65A30D;
  --bg: #F7FAF2;
  --flash-bg: linear-gradient(135deg, #ECFCCB 0%, #F7FEE7 100%);
  --flash-border: #BEF264;
  --coupon-bg: linear-gradient(135deg, #F7FEE7 0%, #FFFFFF 100%);
  --coupon-border: #84CC16;
  --table-hover: #F7FEE7;
  --shadow-hover: 0 14px 30px rgba(77, 124, 15, 0.14);
}

:root[data-theme="coastal-teal"] {
  --brand: #0E7490;
  --brand-dark: #155E75;
  --brand-light: #ECFEFF;
  --brand-gradient: linear-gradient(135deg, #0E7490 0%, #06B6D4 100%);
  --top-strip-bg: #083344;
  --top-strip-text: #CFFAFE;
  --sidebar-bg: #083344;
  --footer-bg: #083344;
  --accent: #0891B2;
  --bg: #F0FDFF;
  --flash-bg: linear-gradient(135deg, #CFFAFE 0%, #ECFEFF 100%);
  --flash-border: #67E8F9;
  --coupon-bg: linear-gradient(135deg, #ECFEFF 0%, #FFFFFF 100%);
  --coupon-border: #22D3EE;
  --table-hover: #ECFEFF;
  --shadow-hover: 0 14px 30px rgba(14, 116, 144, 0.15);
}

:root[data-theme="cobalt-navy"] {
  --brand: #1E3A8A;
  --brand-dark: #172554;
  --brand-light: #EFF6FF;
  --brand-gradient: linear-gradient(135deg, #1E3A8A 0%, #2563EB 100%);
  --top-strip-bg: #0F172A;
  --top-strip-text: #DBEAFE;
  --sidebar-bg: #172554;
  --footer-bg: #0F172A;
  --accent: #2563EB;
  --bg: #F4F7FC;
  --flash-bg: linear-gradient(135deg, #DBEAFE 0%, #EFF6FF 100%);
  --flash-border: #93C5FD;
  --coupon-bg: linear-gradient(135deg, #EFF6FF 0%, #FFFFFF 100%);
  --coupon-border: #60A5FA;
  --table-hover: #EFF6FF;
  --shadow-hover: 0 14px 30px rgba(30, 58, 138, 0.16);
}

:root[data-theme="amber-honey"] {
  --brand: #B45309;
  --brand-dark: #92400E;
  --brand-light: #FEF3C7;
  --brand-gradient: linear-gradient(135deg, #B45309 0%, #D97706 60%, #F59E0B 100%);
  --top-strip-bg: #451A03;
  --top-strip-text: #FEF3C7;
  --sidebar-bg: #451A03;
  --footer-bg: #361403;
  --accent: #D97706;
  --bg: #FFFDF4;
  --flash-bg: linear-gradient(135deg, #FEF3C7 0%, #FFFBEB 100%);
  --flash-border: #FCD34D;
  --coupon-bg: linear-gradient(135deg, #FFFBEB 0%, #FFFFFF 100%);
  --coupon-border: #F59E0B;
  --table-hover: #FFFBEB;
  --shadow-hover: 0 14px 30px rgba(180, 83, 9, 0.15);
}

/* ==================== VISUAL STYLE VARIANTS (10 STYLES) ==================== */
:root[data-style="minimal"] {
  --btn-radius: 4px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --shadow-sm: none;
  --shadow-md: none;
  --shadow-hover: 0 4px 12px rgba(15, 23, 42, 0.08);
}

:root[data-style="playful"] {
  --btn-radius: 999px;
  --radius-sm: 14px;
  --radius-md: 22px;
  --radius-lg: 28px;
  --shadow-sm: 0 4px 14px rgba(15, 23, 42, 0.07);
  --shadow-md: 0 12px 30px rgba(15, 23, 42, 0.11);
}

:root[data-style="editorial"] {
  --btn-radius: 0px;
  --radius-sm: 0px;
  --radius-md: 0px;
  --radius-lg: 0px;
  --shadow-sm: none;
  --shadow-md: none;
  --shadow-hover: 0 6px 20px rgba(15, 23, 42, 0.09);
}
:root[data-style="editorial"] h1,
:root[data-style="editorial"] h2,
:root[data-style="editorial"] .brand-logo,
:root[data-style="editorial"] .section-title {
  font-family: Georgia, "Noto Serif TC", "PMingLiU", serif;
  letter-spacing: 0.02em;
}
:root[data-style="editorial"] .card,
:root[data-style="editorial"] .product-card {
  border-color: var(--border-strong);
}

:root[data-style="soft-glass"] {
  --btn-radius: 14px;
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --shadow-sm: 0 6px 20px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 12px 32px rgba(15, 23, 42, 0.09);
}
:root[data-style="soft-glass"] .card,
:root[data-style="soft-glass"] .product-card,
:root[data-style="soft-glass"] .kpi-card {
  background: color-mix(in oklab, var(--surface), transparent 14%);
  backdrop-filter: blur(10px);
  border-color: color-mix(in oklab, var(--brand), white 75%);
}

:root[data-style="neo-pop"] {
  --btn-radius: 8px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 3px 3px 0 var(--text);
  --shadow-md: 5px 5px 0 var(--text);
  --shadow-hover: 6px 6px 0 var(--brand);
}
:root[data-style="neo-pop"] .card,
:root[data-style="neo-pop"] .product-card,
:root[data-style="neo-pop"] .kpi-card,
:root[data-style="neo-pop"] .quick-cat-card,
:root[data-style="neo-pop"] .btn-primary,
:root[data-style="neo-pop"] .btn-outline {
  border: 2px solid var(--text);
}

:root[data-style="bento-grid"] {
  --btn-radius: 12px;
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 24px;
  --shadow-sm: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 4px 14px rgba(15, 23, 42, 0.05);
  --shadow-md: inset 0 1px 0 rgba(255, 255, 255, 0.95), 0 10px 26px rgba(15, 23, 42, 0.08);
  --shadow-hover: 0 14px 30px color-mix(in oklab, var(--brand), transparent 82%);
}
:root[data-style="bento-grid"] .card,
:root[data-style="bento-grid"] .product-card,
:root[data-style="bento-grid"] .kpi-card,
:root[data-style="bento-grid"] .quick-cat-card {
  border: 1.5px solid color-mix(in oklab, var(--brand), var(--border) 78%);
}

:root[data-style="neumorph"] {
  --btn-radius: 14px;
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 22px;
  --shadow-sm: -4px -4px 10px rgba(255, 255, 255, 0.85), 5px 5px 14px rgba(15, 23, 42, 0.09);
  --shadow-md: -6px -6px 14px rgba(255, 255, 255, 0.9), 7px 7px 18px rgba(15, 23, 42, 0.12);
  --shadow-hover: -7px -7px 16px rgba(255, 255, 255, 0.95), 9px 9px 22px rgba(15, 23, 42, 0.14);
}
:root[data-style="neumorph"] .card,
:root[data-style="neumorph"] .product-card,
:root[data-style="neumorph"] .kpi-card,
:root[data-style="neumorph"] .quick-cat-card {
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: color-mix(in oklab, var(--surface), var(--bg) 32%);
}
:root[data-style="neumorph"] .btn-outline,
:root[data-style="neumorph"] .btn-ghost {
  box-shadow: -3px -3px 7px rgba(255, 255, 255, 0.85), 3px 3px 8px rgba(15, 23, 42, 0.09);
}

:root[data-style="boutique-frame"] {
  --btn-radius: 2px;
  --radius-sm: 2px;
  --radius-md: 3px;
  --radius-lg: 4px;
  --shadow-sm: 0 2px 10px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 6px 18px rgba(15, 23, 42, 0.07);
  --shadow-hover: 0 10px 26px rgba(15, 23, 42, 0.11);
}
:root[data-style="boutique-frame"] .card,
:root[data-style="boutique-frame"] .kpi-card {
  border-top: 3px solid var(--brand);
  box-shadow: 0 0 0 1px var(--border), inset 0 0 0 3px var(--surface), inset 0 0 0 4px color-mix(in oklab, var(--brand), transparent 80%);
}
:root[data-style="boutique-frame"] .product-card {
  border: 1px solid color-mix(in oklab, var(--brand), var(--border) 68%);
  box-shadow: inset 0 0 0 3px var(--surface), inset 0 0 0 4px color-mix(in oklab, var(--brand), transparent 85%);
}
:root[data-style="boutique-frame"] h1,
:root[data-style="boutique-frame"] h2,
:root[data-style="boutique-frame"] .section-title {
  letter-spacing: 0.05em;
}

:root[data-style="cyber-tech"] {
  --btn-radius: 4px;
  --radius-sm: 3px;
  --radius-md: 5px;
  --radius-lg: 6px;
  --shadow-sm: 0 0 0 1px color-mix(in oklab, var(--brand), transparent 82%), 0 4px 14px color-mix(in oklab, var(--brand), transparent 88%);
  --shadow-md: 0 0 0 1px color-mix(in oklab, var(--brand), transparent 72%), 0 10px 24px color-mix(in oklab, var(--brand), transparent 84%);
  --shadow-hover: 0 0 0 1.5px var(--brand), 0 10px 26px color-mix(in oklab, var(--brand), transparent 74%);
}
:root[data-style="cyber-tech"] .card,
:root[data-style="cyber-tech"] .product-card,
:root[data-style="cyber-tech"] .kpi-card {
  border: 1.5px solid color-mix(in oklab, var(--brand), transparent 58%);
}
:root[data-style="cyber-tech"] .price-sale,
:root[data-style="cyber-tech"] .kpi-value,
:root[data-style="cyber-tech"] .badge,
:root[data-style="cyber-tech"] .count-pill {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
}
:root[data-style="cyber-tech"] .section-title {
  border-left: 4px solid var(--brand);
  padding-inline-start: 0.55rem;
}

::selection {
  background: var(--brand);
  color: var(--brand-contrast);
}

@media (forced-colors: active) {
  .card, .product-card, .theme-choice-card, .btn {
    border: 2px solid ButtonText;
  }
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-padding-top: 90px;
  scroll-padding-bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
}

body {
  margin: 0;
  font-family: "Noto Sans TC", "Microsoft JhengHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--brand);
  text-decoration: none;
}
a:hover {
  color: var(--brand-dark);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  clip-path: inset(50%);
  overflow: hidden;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  white-space: nowrap;
}

.container {
  width: min(100% - 2rem, var(--container-max));
  margin-inline: auto;
}

main.page-main {
  flex: 1;
  padding-block: 1.5rem 3rem;
}

/* ==================== TOP PROMO STRIP & HEADER ==================== */
.top-strip {
  background: var(--top-strip-bg);
  color: var(--top-strip-text);
  font-size: 0.85rem;
  padding-block: 0.45rem;
}
.top-strip-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}
.top-strip a {
  color: #FFD166;
  font-weight: 600;
}
.top-strip a:hover {
  text-decoration: underline;
}

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
}

.header-main {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.25rem;
  padding-block: 0.85rem;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 900;
  font-size: 1.45rem;
  color: var(--brand);
  letter-spacing: -0.02em;
}
.brand-logo-img {
  max-height: 44px;
  max-width: 150px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
}
.brand-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--brand-gradient);
  color: var(--brand-contrast);
  font-weight: 900;
  font-size: 1.25rem;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.22);
}
.brand-sub {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  display: block;
  line-height: 1;
}

.header-search form {
  display: flex;
  align-items: stretch;
  border: 2px solid var(--brand);
  border-radius: var(--btn-radius);
  overflow: hidden;
  background: var(--surface);
  transition: box-shadow 0.2s;
}
.header-search form:focus-within {
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--brand), transparent 82%);
}
.header-search input[type="search"] {
  flex: 1;
  border: none;
  padding: 0.65rem 1.1rem;
  font: inherit;
  font-size: max(1rem, 1em);
  min-height: 44px;
  outline: none;
  background: transparent;
  color: var(--text);
}
.header-search button[type="submit"] {
  border: none;
  background: var(--brand-gradient);
  color: var(--brand-contrast);
  padding: 0 1.4rem;
  font-weight: 700;
  font: inherit;
  cursor: pointer;
  white-space: nowrap;
}
.header-search button[type="submit"]:hover {
  filter: brightness(1.06);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  border-radius: var(--btn-radius);
  color: var(--text);
  font-weight: 600;
  font-size: 0.92rem;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.18s;
  min-height: 42px;
}
.icon-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-light);
}
.icon-btn.primary-pill {
  background: var(--brand);
  color: var(--brand-contrast);
  border-color: var(--brand);
}
.icon-btn.primary-pill:hover {
  background: var(--brand-dark);
  color: var(--brand-contrast);
}

.count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding-inline: 6px;
  border-radius: 999px;
  background: var(--brand);
  color: var(--brand-contrast);
  font-size: 0.75rem;
  font-weight: 800;
}
.icon-btn.primary-pill .count-pill {
  background: #FFD166;
  color: #1E293B;
}

.cat-nav {
  background: var(--surface);
  border-top: 1px solid var(--border);
  overflow-x: auto;
}
.cat-nav-list {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0.45rem 0;
  white-space: nowrap;
}
.cat-nav-list a {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  transition: background 0.15s, color 0.15s;
}
.cat-nav-list a:hover,
.cat-nav-list a.active {
  background: var(--brand-light);
  color: var(--brand);
}
.cat-nav-list a.flash-link {
  color: #DC2626;
  font-weight: 800;
}

/* ==================== ALERTS / TOASTS ==================== */
.alert {
  padding: 0.9rem 1.15rem;
  border-radius: var(--radius-md);
  margin-block-end: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-weight: 600;
  border: 1px solid transparent;
}
.alert-success {
  background: var(--success-bg);
  color: #065F46;
  border-color: #A7F3D0;
}
.alert-error {
  background: var(--danger-bg);
  color: #991B1B;
  border-color: #FECACA;
}
.alert-info {
  background: var(--info-bg);
  color: #1E40AF;
  border-color: #BFDBFE;
}
.alert-close {
  background: transparent;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: inherit;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
}

/* ==================== CAROUSEL (Modern Scroll-Snap) ==================== */
.carousel {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-block-end: 1.75rem;
  background: #1E1B4B;
}

.carousel-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  touch-action: manipulation;
}
.carousel-track::-webkit-scrollbar {
  display: none;
}

@media (prefers-reduced-motion: no-preference) {
  .carousel-track {
    scroll-behavior: smooth;
  }
}

.carousel-slide {
  flex: 0 0 100%;
  scroll-snap-align: center;
  position: relative;
  display: block;
}
.carousel-slide img {
  width: 100%;
  aspect-ratio: 3 / 1;
  object-fit: cover;
  min-height: 220px;
}

.carousel-controls {
  position: absolute;
  inset-block: 0;
  inset-inline: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
  z-index: 3;
}
.carousel-controls button {
  pointer-events: auto;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.75);
  background: rgba(15, 23, 42, 0.55);
  color: #fff;
  font-size: 1.35rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  transition: background 0.15s, transform 0.15s;
}
.carousel-controls button:hover {
  background: var(--brand);
  transform: scale(1.06);
}

.carousel-markers {
  position: absolute;
  inset-block-end: 0.75rem;
  inset-inline: 0;
  display: flex;
  justify-content: center;
  gap: 0.35rem;
  z-index: 3;
}
.carousel-markers button {
  width: 28px;
  height: 28px;
  padding: 8px;
  background: transparent;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.carousel-markers button::before {
  content: "";
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(15, 23, 42, 0.3);
  transition: width 0.2s, background 0.2s;
}
.carousel-markers button[aria-current="true"] {
  width: 40px;
}
.carousel-markers button[aria-current="true"]::before {
  width: 24px;
  background: #FFD166;
  border-color: #7C123E;
}

/* ==================== QUICK CATEGORIES & COUPON STRIP ==================== */
.quick-cats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.85rem;
  margin-block-end: 2rem;
}
.quick-cat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 0.75rem;
  text-align: center;
  color: var(--text);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.quick-cat-card:hover {
  transform: translateY(-3px);
  border-color: var(--brand);
  color: var(--brand);
  box-shadow: var(--shadow-hover);
}
.quick-cat-icon {
  font-size: 2rem;
  display: block;
  margin-block-end: 0.35rem;
}

.coupon-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-block-end: 2rem;
}
.coupon-ticket {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--coupon-bg);
  border: 2px dashed var(--coupon-border);
  border-radius: var(--radius-md);
  padding: 0.9rem 1.1rem;
}
.coupon-code-badge {
  display: inline-block;
  background: var(--brand);
  color: var(--brand-contrast);
  font-weight: 900;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  font-size: 0.92rem;
  letter-spacing: 0.04em;
}

/* ==================== SECTION HEADERS & FLASH SALE ==================== */
.section-block {
  margin-block-end: 2.5rem;
}
.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-block-end: 1.15rem;
}
.section-title {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.flash-banner {
  background: var(--flash-bg);
  border: 1px solid var(--flash-border);
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  margin-block-end: 2.5rem;
}
.countdown-box {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 800;
  color: var(--brand-dark);
}
.countdown-digit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 0.2rem 0.45rem;
  border-radius: 8px;
  background: #1E293B;
  color: #FFD166;
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
}

/* ==================== PRODUCT GRID & CARDS ==================== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 1.15rem;
}

.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  position: relative;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: #F472B6;
}

.product-thumb-link {
  position: relative;
  display: block;
  background: var(--surface-alt);
  aspect-ratio: 1 / 1;
  overflow: hidden;
}
.product-thumb-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.product-card:hover .product-thumb-link img {
  transform: scale(1.04);
}

.discount-tag {
  position: absolute;
  inset-block-start: 10px;
  inset-inline-start: 10px;
  background: var(--brand);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(214, 40, 114, 0.35);
}
.flash-tag {
  position: absolute;
  inset-block-start: 10px;
  inset-inline-end: 10px;
  background: #F59E0B;
  color: #1E293B;
  font-size: 0.74rem;
  font-weight: 900;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}
.promo-tag {
  position: absolute;
  inset-block-start: 10px;
  inset-inline-end: 10px;
  background: #DC2626;
  color: #FFFFFF;
  font-size: 0.74rem;
  font-weight: 900;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.35);
}
.secondhand-tag {
  position: absolute;
  inset-block-start: 10px;
  inset-inline-end: 10px;
  background: #047857;
  color: #FFFFFF;
  font-size: 0.74rem;
  font-weight: 900;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(4, 120, 87, 0.35);
}
.secondhand-banner {
  background: linear-gradient(135deg, #ECFDF5 0%, #F0FDF4 100%);
  border: 1px solid #A7F3D0;
  border-radius: var(--radius-lg);
  padding: 1.35rem;
  margin-block-end: 2.5rem;
}
.condition-report-card {
  background: #ECFDF5;
  border: 1.5px solid #6EE7B7;
  border-radius: var(--radius-md);
  padding: 0.95rem 1.1rem;
  margin-block-end: 1.2rem;
}
.secondhand-ack-box {
  background: #ECFDF5;
  border: 1.5px solid #34D399;
  border-radius: var(--radius-md);
  padding: 0.95rem 1.1rem;
  margin-block-end: 1.25rem;
}

/* Proxy Shopping Hero */
.proxy-hero {
  background: var(--brand-gradient);
  border-radius: var(--radius-lg);
  padding: 1.65rem 1.75rem;
  box-shadow: var(--shadow-md);
}
.proxy-steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-block-start: 1.25rem;
}
.proxy-step-pill {
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  padding: 0.7rem 0.9rem;
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.proxy-step-pill span {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.9);
}

.product-body {
  padding: 0.95rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.45rem;
}
.product-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.product-name {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.75em;
}
.product-name a {
  color: var(--text);
}
.product-name a:hover {
  color: var(--brand);
}

.price-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-block-start: auto;
}
.sale-price {
  color: var(--brand);
  font-size: 1.25rem;
  font-weight: 900;
}
.orig-price {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-decoration: line-through;
}

.product-card-footer {
  display: flex;
  gap: 0.5rem;
  margin-block-start: 0.5rem;
}

/* ==================== BUTTONS ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.15rem;
  border-radius: var(--btn-radius);
  font: inherit;
  font-size: 0.94rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.16s;
  min-height: 44px;
  text-align: center;
}
.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  min-height: 36px;
}
.btn-lg {
  padding: 0.8rem 1.6rem;
  font-size: 1.05rem;
  min-height: 50px;
}
.btn-block {
  width: 100%;
}
.btn-primary {
  background: var(--brand);
  color: var(--brand-contrast);
}
.btn-primary:hover {
  background: var(--brand-dark);
  color: var(--brand-contrast);
}
.btn-accent {
  background: var(--accent);
  color: var(--brand-contrast);
}
.btn-accent:hover {
  filter: brightness(0.92);
  color: var(--brand-contrast);
}
.btn-outline {
  background: var(--surface);
  color: var(--brand);
  border-color: var(--brand);
}
.btn-outline:hover {
  background: var(--brand-light);
}
.btn-ghost {
  background: var(--surface-alt);
  color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover {
  border-color: var(--border-strong);
  background: var(--brand-light);
  color: var(--text);
}
.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover {
  background: #B91C1C;
  color: #fff;
}
.btn-wish {
  min-width: 44px;
  padding-inline: 0.65rem;
}
.btn-wish.active {
  background: #FFE4E6;
  color: #E11D48;
  border-color: #FDA4AF;
}

/* ==================== CARDS, PANELS & BADGES ==================== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  box-shadow: var(--shadow-sm);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}
.badge-primary { background: var(--brand-light); color: var(--brand-dark); }
.badge-success { background: var(--success-bg); color: #065F46; }
.badge-warn { background: var(--warn-bg); color: #92400E; }
.badge-info { background: var(--info-bg); color: #1E40AF; }
.badge-danger { background: var(--danger-bg); color: #991B1B; }
.badge-muted { background: #F1F5F9; color: #475569; }

/* ==================== FORMS (Modern Web Guidance) ==================== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-block-end: 1.2rem;
}
.form-group label {
  font-weight: 700;
  font-size: 0.93rem;
  color: var(--text);
}
.form-hint {
  font-size: 0.84rem;
  color: var(--text-muted);
}
.form-control,
.form-select,
textarea.form-control {
  width: 100%;
  font: inherit;
  font-size: max(1rem, 1em);
  padding: 0.68rem 0.88rem;
  min-height: 46px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
input[type="file"].form-control::file-selector-button {
  background: var(--brand-light);
  color: var(--brand);
  border: 1px solid var(--brand);
  border-radius: 6px;
  padding: 0.35rem 0.75rem;
  margin-inline-end: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}
textarea.form-control {
  min-height: 92px;
  resize: vertical;
}
.form-control:focus,
.form-select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(214, 40, 114, 0.16);
}
.form-control:user-invalid,
.form-select:user-invalid {
  border-color: var(--danger);
}
.field-validation-error,
.validation-summary-errors {
  color: var(--danger);
  font-size: 0.86rem;
  font-weight: 600;
}
.validation-summary-errors ul {
  margin: 0 0 1rem;
  padding-inline-start: 1.25rem;
}
input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--brand);
  width: 1.1rem;
  height: 1.1rem;
}
.check-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-weight: 600;
}
.password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.password-wrap input {
  padding-inline-end: 4.5rem;
}
.password-toggle {
  position: absolute;
  inset-inline-end: 0.5rem;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.35rem 0.65rem;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--text);
}

fieldset.form-fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  margin: 0 0 1.25rem;
}
fieldset.form-fieldset legend {
  font-weight: 800;
  padding-inline: 0.5rem;
  color: var(--brand-dark);
}

/* ==================== CATALOG / DETAIL / CART / CHECKOUT ==================== */
.catalog-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(280px, 460px) 1fr;
  gap: 2rem;
  align-items: start;
}

.spec-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}
.spec-radio {
  position: relative;
}
.spec-radio input {
  position: absolute;
  clip-path: inset(50%);
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.spec-radio label {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.95rem;
  border: 1.5px solid var(--border-strong);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  background: #fff;
  min-height: 40px;
}
.spec-radio input:checked + label {
  border-color: var(--brand);
  background: var(--brand-light);
  color: var(--brand-dark);
}
.spec-radio input:focus-visible + label {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}

/* Bundle & Multi-Item Color/Size Combo Picker */
.bundle-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.6rem;
}
.bundle-choice-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0.72rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.bundle-choice-card input[type="radio"] {
  position: absolute;
  clip-path: inset(50%);
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.bundle-choice-card:hover {
  border-color: var(--brand);
}
.bundle-choice-card:has(input:focus-visible) {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}
.bundle-choice-card:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-light);
  box-shadow: 0 0 0 1.5px var(--brand);
}

.combo-slots-list {
  display: grid;
  gap: 0.65rem;
}
.combo-slot-box {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  padding: 0.72rem 0.85rem;
}
.combo-slot-title {
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--brand-dark);
  margin-block-end: 0.45rem;
}
.combo-slot-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.65rem;
}

.admin-bundle-row {
  display: grid;
  grid-template-columns: 2fr 1.1fr 0.7fr 1fr auto;
  gap: 0.55rem;
  align-items: end;
  padding: 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
}
@media (max-width: 720px) {
  .admin-bundle-row {
    grid-template-columns: 1fr 1fr;
  }
}

/* Cart Auto-Update Quantity Stepper */
.qty-stepper {
  display: inline-flex;
  align-items: stretch;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
}
.qty-stepper.is-updating {
  opacity: 0.65;
}
.qty-step-btn {
  width: 36px;
  min-height: 38px;
  border: none;
  background: var(--surface-alt);
  color: var(--text);
  font-size: 1.15rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.14s, color 0.14s;
}
.qty-step-btn:hover {
  background: var(--brand-light);
  color: var(--brand);
}
.qty-step-input {
  width: 56px;
  min-height: 38px;
  border: none;
  border-inline: 1px solid var(--border);
  text-align: center;
  font: inherit;
  font-size: max(1rem, 1em);
  font-weight: 700;
  color: var(--text);
  background: var(--surface);
  padding: 0.2rem;
}
.qty-step-input::-webkit-inner-spin-button,
.qty-step-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.qty-step-input {
  -moz-appearance: textfield;
}

.two-col-layout {
  display: grid;
  grid-template-columns: 1fr 370px;
  gap: 1.5rem;
  align-items: start;
}

.progress-bar-wrap {
  background: #E2E8F0;
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
  margin-block: 0.45rem;
}
.progress-bar-fill {
  height: 100%;
  background: var(--brand-gradient);
  border-radius: 999px;
  transition: width 0.3s;
}

/* Checkout Progress Stepper */
.step-tracker {
  display: flex;
  justify-content: center;
  gap: 1rem;
  list-style: none;
  padding: 0;
  margin: 0 0 1.75rem;
  flex-wrap: wrap;
}
.step-tracker li {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.05rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-weight: 700;
  color: var(--text-muted);
}
.step-tracker li.step-active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.step-tracker li.step-done {
  background: var(--success-bg);
  color: #065F46;
  border-color: #A7F3D0;
}

/* ==================== RESPONSIVE DATA TABLES (Container Queries) ==================== */
.table-wrapper {
  overflow: auto;
  max-inline-size: 100%;
  container-type: inline-size;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
  font-size: 0.92rem;
}
.data-table caption {
  text-align: left;
  font-weight: 800;
  padding: 0.85rem 1rem;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
}
.data-table thead {
  position: sticky;
  inset-block-start: 0;
  z-index: 2;
  background: var(--surface-alt);
}
.data-table th,
.data-table td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table thead th {
  font-weight: 800;
  color: var(--text-muted);
  font-size: 0.84rem;
  white-space: nowrap;
}
.data-table tbody tr:hover {
  background: var(--table-hover);
}

@container (width < 640px) {
  .data-table.responsive-stack,
  .data-table.responsive-stack thead,
  .data-table.responsive-stack tbody,
  .data-table.responsive-stack tr,
  .data-table.responsive-stack th,
  .data-table.responsive-stack td {
    display: block;
  }
  .data-table.responsive-stack thead {
    display: none;
  }
  .data-table.responsive-stack tr {
    margin: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
  }
  .data-table.responsive-stack tbody th {
    background: var(--brand-light);
    color: var(--brand-dark);
    font-weight: 800;
  }
  .data-table.responsive-stack td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid #F1F5F9;
  }
  .data-table.responsive-stack td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.82rem;
  }
}

/* ==================== ACCOUNT & ADMIN SIDEBARS ==================== */
.account-layout {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 1.5rem;
  align-items: start;
}
.side-menu {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.side-menu a {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  color: var(--text);
  font-weight: 600;
}
.side-menu a:hover,
.side-menu a.active {
  background: var(--brand-light);
  color: var(--brand-dark);
}

/* Admin Shell */
.admin-shell {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
}
.admin-sidebar {
  background: var(--sidebar-bg);
  color: #E2E8F0;
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.admin-nav a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.72rem 0.95rem;
  border-radius: 10px;
  color: #CBD5E1;
  font-weight: 600;
}
.admin-nav a:hover,
.admin-nav a.active {
  background: rgba(233, 30, 99, 0.25);
  color: #FFFFFF;
}
.admin-main {
  padding: 1.75rem;
  overflow-x: hidden;
}
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
  margin-block-end: 1.5rem;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  box-shadow: var(--shadow-sm);
}
.kpi-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 700;
}
.kpi-value {
  font-size: 1.75rem;
  font-weight: 900;
  color: var(--text);
  margin-block: 0.25rem;
}

/* ==================== CHECKOUT CONVENIENCE STORE PICKER (MOMO STYLE) ==================== */
.delivery-mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
}
.delivery-mode-card {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.delivery-mode-card:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-light);
  box-shadow: 0 0 0 1.5px var(--brand);
}
.store-selected-box {
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--surface-alt);
  padding: 1rem 1.1rem;
}
.store-summary-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
}
.store-clear-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: #94A3B8;
  color: #FFFFFF;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.store-clear-btn:hover {
  background: var(--danger);
}
.store-brand-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

dialog.store-dialog {
  width: min(94vw, 760px);
  max-height: 90vh;
  padding: 0;
  border: none;
  border-radius: 16px;
  background: #F4F5F7;
  color: var(--text);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.32);
  overflow: hidden;
}
dialog.store-dialog[open] {
  display: flex;
  flex-direction: column;
}
dialog.store-dialog:modal {
  overscroll-behavior: contain;
}
dialog.store-dialog::backdrop {
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
  overflow: hidden;
  overscroll-behavior: contain;
}
.store-dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.95rem 1.25rem;
  background: #EAECEF;
  border-bottom: 1px solid #DCE0E6;
}
.store-dialog-close {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  color: #475569;
  cursor: pointer;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.store-dialog-close:hover {
  background: rgba(15, 23, 42, 0.08);
}
.store-dialog-body {
  padding: 1rem 1.15rem;
  display: grid;
  gap: 0.95rem;
  overflow-y: auto;
  flex: 1;
}
.store-dialog-card {
  background: #FFFFFF;
  border-radius: 12px;
  padding: 1rem 1.15rem;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}
.store-dialog-card-title {
  margin: 0 0 0.75rem;
  font-size: 0.96rem;
  font-weight: 800;
  color: #1E293B;
}
.store-brand-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}
.store-brand-pill {
  min-width: 112px;
  min-height: 40px;
  padding: 0.45rem 1.25rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: #F1F5F9;
  color: #64748B;
  font: inherit;
  font-weight: 700;
  font-size: 0.94rem;
  cursor: pointer;
  transition: all 0.15s;
}
.store-brand-pill:hover {
  background: var(--brand-light);
  color: var(--brand);
}
.store-brand-pill.active,
.store-brand-pill[aria-pressed="true"] {
  background: var(--brand);
  color: var(--brand-contrast);
  box-shadow: 0 4px 10px color-mix(in oklab, var(--brand), transparent 72%);
}

.store-saved-list {
  display: grid;
  gap: 0.5rem;
  margin-block-end: 0.65rem;
}
.store-option-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1.5px solid #E5E7EB;
  background: #FFFFFF;
  cursor: pointer;
  transition: border-color 0.14s, background 0.14s;
}
.store-option-row:hover {
  border-color: var(--brand);
  background: #FFFBFD;
}
.store-option-row:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-light);
}
.store-open-search-link {
  background: transparent;
  border: none;
  padding: 0.45rem 0.25rem;
  color: #0284C7;
  font: inherit;
  font-size: 0.93rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.store-open-search-link:hover {
  text-decoration: underline;
}

.store-finder-panel {
  margin-block-start: 0.65rem;
  padding-block-start: 0.75rem;
  border-top: 1px solid #E5E7EB;
}
.store-finder-filters {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  margin-block-end: 0.75rem;
}
.store-results-list {
  display: grid;
  gap: 0.45rem;
  max-height: 240px;
  overflow-y: auto;
  padding-inline-end: 2px;
}

.store-dialog-footer {
  display: flex;
  justify-content: center;
  gap: 0.85rem;
  padding: 0.9rem 1.25rem;
  background: #FFFFFF;
  border-top: 1px solid #E5E7EB;
}
.store-footer-btn {
  min-width: 132px;
  border-radius: 999px !important;
}

/* ==================== PRODUCT GALLERY & MAGNIFIER ZOOM ==================== */
.product-gallery {
  position: relative;
}
.gallery-stage-wrap {
  position: relative;
}
.gallery-stage {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #FFFFFF;
  aspect-ratio: 1 / 1;
  cursor: zoom-in;
  user-select: none;
}
.gallery-stage img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.gallery-caption-pill {
  position: absolute;
  inset-block-end: 10px;
  inset-inline-start: 10px;
  background: rgba(15, 23, 42, 0.72);
  color: #FFFFFF;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  pointer-events: none;
}
.gallery-zoom-hint {
  position: absolute;
  inset-block-end: 10px;
  inset-inline-end: 10px;
  background: rgba(255, 255, 255, 0.92);
  color: #1E293B;
  border: 1px solid var(--border);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  pointer-events: none;
}

/* Magnifier Lens Box */
.zoom-lens {
  position: absolute;
  width: 160px;
  height: 160px;
  border: 2px solid var(--brand);
  background: color-mix(in oklab, var(--brand), transparent 84%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.85) inset;
  pointer-events: none;
  display: none;
  z-index: 4;
}
.gallery-stage.zoom-active .zoom-lens {
  display: block;
}

/* Floating Side Magnified Preview Pane (Desktop) */
.zoom-result {
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: calc(100% + 16px);
  width: 440px;
  height: 440px;
  border-radius: var(--radius-md);
  border: 2px solid var(--brand);
  background-color: #FFFFFF;
  background-repeat: no-repeat;
  box-shadow: 0 20px 44px rgba(15, 23, 42, 0.22);
  display: none;
  z-index: 60;
  pointer-events: none;
}
.zoom-result.visible {
  display: block;
}

@media (max-width: 960px) {
  .zoom-lens,
  .zoom-result,
  .gallery-zoom-hint {
    display: none !important;
  }
}

/* Thumbnail Strip with Left/Right Arrows (MOMO Style) */
.gallery-thumbs-bar {
  display: grid;
  grid-template-columns: 32px 1fr 32px;
  align-items: center;
  gap: 0.4rem;
  margin-block-start: 0.75rem;
}
.gallery-arrow-btn {
  width: 32px;
  height: 76px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: var(--surface-alt);
  color: var(--text);
  font-size: 1.35rem;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.gallery-arrow-btn:hover {
  background: var(--brand-light);
  border-color: var(--brand);
  color: var(--brand);
}
.gallery-thumbs-track {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  overscroll-behavior-x: contain;
  padding: 2px;
}
.gallery-thumb {
  flex: 0 0 76px;
  width: 76px;
  height: 76px;
  padding: 2px;
  border-radius: 8px;
  border: 2px solid var(--border);
  background: #FFFFFF;
  cursor: pointer;
  overflow: hidden;
  scroll-snap-align: start;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 5px;
}
.gallery-thumb:hover {
  border-color: var(--brand);
}
.gallery-thumb.active,
.gallery-thumb[aria-pressed="true"] {
  border-color: var(--text);
  box-shadow: 0 0 0 2px var(--brand);
}

/* Accessible Fullscreen Lightbox Dialog */
dialog.lightbox-dialog {
  width: min(92vw, 900px);
  max-height: 92vh;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35);
}
dialog.lightbox-dialog:modal {
  overscroll-behavior: contain;
}
dialog.lightbox-dialog::backdrop {
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(3px);
  overflow: hidden;
  overscroll-behavior: contain;
}
.lightbox-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid var(--border);
}
.lightbox-body {
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem;
  background: #F8FAFC;
}
.lightbox-img-wrap {
  overflow: auto;
  max-height: 70vh;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: zoom-in;
}
.lightbox-img-wrap img {
  max-height: 68vh;
  width: auto;
  object-fit: contain;
  border-radius: 8px;
  transition: transform 0.2s ease;
}
.lightbox-img-wrap.is-zoomed {
  cursor: zoom-out;
  align-items: flex-start;
  justify-content: flex-start;
}
.lightbox-img-wrap.is-zoomed img {
  max-height: none;
  width: 185%;
  max-width: none;
}
.lightbox-nav-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 1.5rem;
  font-weight: 800;
  cursor: pointer;
}
.lightbox-nav-btn:hover {
  background: var(--brand);
  color: var(--brand-contrast);
  border-color: var(--brand);
}
.lightbox-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.65rem 1.15rem;
  border-top: 1px solid var(--border);
  font-size: 0.84rem;
}

/* ==================== SOCIAL LOGIN BUTTONS (FB / LINE / GOOGLE) ==================== */
.social-login-section {
  margin-block-start: 1.35rem;
}
.social-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  margin-block-end: 0.9rem;
}
.social-divider::before,
.social-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.social-login-stack {
  display: grid;
  gap: 0.65rem;
}
.social-btn {
  width: 100%;
  min-height: 48px;
  padding: 0.55rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  border-radius: var(--btn-radius);
  border: 1.5px solid #CBD5E1;
  background: linear-gradient(180deg, #FFFFFF 0%, #F1F5F9 100%);
  color: #1E293B;
  font: inherit;
  font-size: 0.96rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.14s, border-color 0.14s, box-shadow 0.14s, background 0.14s;
}
.social-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
}
.social-btn-fb:hover {
  border-color: #1877F2;
  background: #F0F6FF;
}
.social-btn-line:hover {
  border-color: #06C755;
  background: #F0FDF4;
}
.social-btn-google:hover {
  border-color: #4285F4;
  background: #F8FAFC;
}
.social-icon-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}
.social-btn-label {
  flex: 1;
  text-align: left;
}
.social-mode-tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: #E2E8F0;
  color: #475569;
}

/* ==================== SITE SETTINGS: THEME & STYLE PICKER ==================== */
.preview-header-bar {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface);
}
.preview-top-strip {
  background: var(--top-strip-bg);
  color: var(--top-strip-text);
  padding: 0.45rem 1rem;
  font-size: 0.82rem;
  font-weight: 600;
}
.preview-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.85rem 1.1rem;
}

.theme-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 0.6rem;
}
.style-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
  gap: 0.6rem;
}

.theme-choice-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0.62rem 0.72rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.theme-choice-card:hover {
  border-color: var(--brand);
  transform: translateY(-1px);
}
.theme-choice-card input[type="radio"] {
  position: absolute;
  clip-path: inset(50%);
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.theme-choice-card:has(input:focus-visible) {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}
.theme-choice-card:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-light);
  box-shadow: 0 0 0 1.5px var(--brand);
}
.theme-choice-card:has(input:checked)::after {
  content: "✓";
  position: absolute;
  inset-block-start: 0.45rem;
  inset-inline-end: 0.45rem;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand);
  color: var(--brand-contrast);
  font-size: 0.72rem;
  font-weight: 900;
  border-radius: 999px;
}

.theme-choice-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-block-end: 0.35rem;
}
.theme-swatches {
  display: inline-flex;
  gap: 0.22rem;
}
.swatch-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1.5px solid rgba(15, 23, 42, 0.22);
  forced-color-adjust: none;
}
.style-preview-chip {
  display: inline-block;
  width: 26px;
  height: 18px;
  flex-shrink: 0;
  border: 1.5px solid var(--brand);
  background: var(--brand-light);
}
.style-chip-neo-pop {
  border: 2px solid var(--text);
  box-shadow: 2px 2px 0 var(--text);
}
.style-chip-editorial {
  border: 1.5px solid var(--text);
  background: var(--surface);
}
.style-chip-soft-glass {
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.14);
}
.style-chip-bento-grid {
  border: 1.5px solid var(--brand);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 2px 6px rgba(15, 23, 42, 0.1);
}
.style-chip-neumorph {
  border: 1px solid rgba(255, 255, 255, 0.8);
  background: var(--bg);
  box-shadow: -2px -2px 4px rgba(255, 255, 255, 0.9), 2px 2px 5px rgba(15, 23, 42, 0.16);
}
.style-chip-boutique-frame {
  border: 1px solid var(--border-strong);
  border-top: 3px solid var(--brand);
  background: var(--surface);
  box-shadow: inset 0 0 0 2px var(--surface), inset 0 0 0 3px var(--brand);
}
.style-chip-cyber-tech {
  border: 1.5px solid var(--brand);
  background: var(--surface);
  box-shadow: 0 0 8px color-mix(in oklab, var(--brand), transparent 45%);
}
.theme-choice-title {
  font-weight: 800;
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.25;
  margin-block-end: 0.15rem;
}
.theme-choice-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.35;
}

/* ==================== FOOTER ==================== */
.site-footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  padding-block: 2.5rem 1.5rem;
  margin-block-start: auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.5rem;
  margin-block-end: 1.75rem;
}
.site-footer h3 {
  color: #fff;
  margin-block-start: 0;
  font-size: 1.02rem;
}
.site-footer a {
  color: #CBD5E1;
}
.site-footer a:hover {
  color: #F472B6;
}
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-block-start: 1.1rem;
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
}

/* ==================== PAGINATION ==================== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.45rem;
  margin-block-start: 2rem;
  flex-wrap: wrap;
}
.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding-inline: 0.75rem;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-weight: 700;
  color: var(--text);
}
.pagination a.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

/* ==================== PWA INSTALL BUTTON & MOBILE BOTTOM TAB BAR ==================== */
.top-strip-install-btn {
  background: rgba(255, 255, 255, 0.16);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 0.18rem 0.65rem;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}
.top-strip-install-btn:hover {
  background: rgba(255, 255, 255, 0.28);
}

.mobile-tab-bar {
  display: none;
}

@media (max-width: 768px) {
  body {
    padding-bottom: calc(4.4rem + env(safe-area-inset-bottom, 0px));
  }
  .mobile-tab-bar {
    position: fixed;
    inset-inline: 0;
    inset-block-end: 0;
    z-index: 80;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    background: var(--surface);
    border-top: 1px solid var(--border);
    box-shadow: 0 -6px 20px rgba(15, 23, 42, 0.08);
    padding-top: 0.25rem;
    padding-bottom: max(0.45rem, env(safe-area-inset-bottom, 0px));
    padding-inline-start: env(safe-area-inset-left, 0px);
    padding-inline-end: env(safe-area-inset-right, 0px);
  }
  .mobile-tab-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    min-block-size: 48px;
    min-inline-size: 44px;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    text-decoration: none;
  }
  .mobile-tab-item[aria-current="page"] {
    color: var(--brand);
    font-weight: 900;
  }
  .mobile-tab-item[aria-current="page"]::before {
    content: "";
    position: absolute;
    inset-block-start: -0.25rem;
    width: 28px;
    height: 3px;
    border-radius: 999px;
    background: var(--brand);
  }
  .mobile-tab-icon {
    position: relative;
    font-size: 1.25rem;
    line-height: 1;
  }
  .mobile-tab-badge {
    position: absolute;
    inset-block-start: -6px;
    inset-inline-end: -12px;
    min-width: 18px;
    height: 18px;
    padding-inline: 4px;
    border-radius: 999px;
    background: var(--brand);
    color: var(--brand-contrast);
    font-size: 0.68rem;
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* ==================== RESPONSIVE BREAKPOINTS ==================== */
@media (max-width: 960px) {
  .header-main {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  .header-actions {
    justify-content: flex-end;
    flex-wrap: wrap;
  }
  .catalog-layout,
  .detail-grid,
  .two-col-layout,
  .account-layout,
  .admin-shell {
    grid-template-columns: 1fr;
  }
  .admin-sidebar {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
  }
  .admin-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

/* ==================== ONLINE CUSTOMER SERVICE (LIVE CHAT & SUPPORT DESK) ==================== */
@supports not selector(:popover-open) {
  [popover]:not(.\:popover-open) {
    display: none;
  }
}

.support-fab {
  position: fixed;
  inset-block-end: 1.35rem;
  inset-inline-end: 1.35rem;
  z-index: 950;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.72rem 1.15rem;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  background: var(--brand);
  color: var(--brand-contrast);
  font: inherit;
  font-size: 0.94rem;
  font-weight: 800;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.24);
  cursor: pointer;
  transition: transform 0.16s, box-shadow 0.16s, background 0.16s;
}
.support-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.3);
}
.support-fab-icon {
  font-size: 1.18rem;
  line-height: 1;
}
.support-fab-badge,
.support-unread-pill {
  min-width: 20px;
  height: 20px;
  padding-inline: 5px;
  border-radius: 999px;
  background: #EF4444;
  color: #FFFFFF;
  font-size: 0.72rem;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.support-fab-badge[hidden],
.support-unread-pill[hidden] {
  display: none;
}

.support-chat-panel {
  position: fixed;
  inset: auto 1.35rem 5.15rem auto;
  margin: 0;
  padding: 0;
  width: min(395px, calc(100vw - 1.5rem));
  height: min(560px, calc(100dvh - 7rem));
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 22px 54px rgba(15, 23, 42, 0.28);
  flex-direction: column;
  overflow: hidden;
}
.support-chat-panel:is(:popover-open, .\:popover-open) {
  display: flex;
}

.support-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: var(--brand-contrast);
  flex-shrink: 0;
}
.support-chat-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 900;
  font-size: 0.98rem;
}
.support-chat-sub {
  font-size: 0.75rem;
  opacity: 0.9;
  margin-block-start: 0.12rem;
}
.support-online-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #22C55E;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.28);
  flex-shrink: 0;
}
.support-chat-header-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.support-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.14);
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}
.support-icon-btn:hover {
  background: rgba(255, 255, 255, 0.26);
}

.support-quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.55rem 0.75rem;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.support-chip {
  padding: 0.28rem 0.62rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.14s, background 0.14s, color 0.14s;
}
.support-chip:hover {
  border-color: var(--brand);
  color: var(--brand);
}
.support-chip-accent {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.support-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  background: var(--bg);
}
.support-messages-tall {
  min-height: 400px;
  max-height: 540px;
}

.support-msg {
  display: flex;
  flex-direction: column;
  max-width: 84%;
  gap: 0.2rem;
}
.support-msg-customer {
  align-self: flex-end;
  align-items: flex-end;
}
.support-msg-admin,
.support-msg-bot {
  align-self: flex-start;
  align-items: flex-start;
}
.support-msg-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  padding-inline: 0.25rem;
}
.support-msg-bubble {
  padding: 0.6rem 0.82rem;
  border-radius: 14px;
  font-size: 0.88rem;
  line-height: 1.55;
  white-space: pre-line;
  word-break: break-word;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
.support-msg-customer .support-msg-bubble {
  background: var(--brand);
  color: var(--brand-contrast);
  border-bottom-right-radius: 4px;
}
.support-msg-admin .support-msg-bubble {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.support-msg-bot .support-msg-bubble {
  background: var(--brand-soft);
  color: var(--text);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-bottom-left-radius: 4px;
}

.support-chat-form {
  padding: 0.65rem 0.75rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
  display: grid;
  gap: 0.45rem;
  flex-shrink: 0;
}
.support-guest-input {
  width: 100%;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  font-size: 0.82rem;
  background: var(--surface-alt);
  color: var(--text);
}
.support-input-row {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
}
.support-auto-textarea {
  flex: 1;
  field-sizing: content;
  width: 100%;
  height: auto;
  min-block-size: 2.2lh;
  max-block-size: 5.5lh;
  padding: 0.48rem 0.72rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font: inherit;
  font-size: 0.9rem;
  line-height: 1.45;
  background: var(--surface);
  color: var(--text);
  resize: none;
}
.support-auto-textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.support-send-btn {
  flex-shrink: 0;
  align-self: flex-end;
  min-height: 40px;
}

/* Full-Page Support Center */
.support-hero {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: var(--brand-contrast);
  padding: 1.4rem 1.6rem;
  border-radius: var(--radius-lg);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-block-end: 1.25rem;
}
.support-page-grid {
  display: grid;
  grid-template-columns: 330px 1fr;
  gap: 1.25rem;
  align-items: start;
}
.support-page-sidebar {
  display: grid;
  gap: 1rem;
}
.support-ticket-list {
  display: grid;
  gap: 0.45rem;
  max-height: 280px;
  overflow-y: auto;
}
.support-ticket-item {
  display: block;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.14s, background 0.14s;
}
.support-ticket-item:hover,
.support-ticket-item.is-active {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.support-faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.75rem;
  background: var(--surface-alt);
}
.support-faq-item summary {
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
}
.support-faq-item p {
  margin: 0.45rem 0 0;
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.6;
}
.support-page-chat {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.support-page-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

/* Admin Live Support Desk */
.admin-support-grid {
  display: grid;
  grid-template-columns: 330px 1fr;
  gap: 1rem;
  align-items: start;
}
.admin-support-inbox {
  overflow: hidden;
}
.admin-support-list {
  max-height: 620px;
  overflow-y: auto;
}
.admin-inbox-item {
  display: block;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  transition: background 0.14s;
}
.admin-inbox-item:hover {
  background: var(--surface-alt);
}
.admin-inbox-item.is-active {
  background: var(--brand-soft);
  border-inline-start: 4px solid var(--brand);
}
.admin-inbox-preview {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-support-chat {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

@media (max-width: 960px) {
  .support-page-grid,
  .admin-support-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 768px) {
  .support-fab {
    inset-block-end: calc(4.85rem + env(safe-area-inset-bottom, 0px));
    inset-inline-end: 0.85rem;
    width: 48px;
    height: 48px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }
  .support-fab-label {
    position: absolute;
    clip-path: inset(50%);
    overflow: hidden;
    width: 1px;
    height: 1px;
  }
  .support-fab-badge {
    position: absolute;
    inset-block-start: -4px;
    inset-inline-end: -4px;
  }
  .support-chat-panel {
    inset: auto 0.5rem calc(4.6rem + env(safe-area-inset-bottom, 0px)) 0.5rem;
    width: auto;
    height: min(520px, calc(100dvh - 6.5rem));
  }
}

/* ==================== HORIZONTAL CATALOG FILTER & SORT TOOLBAR ==================== */
.catalog-full {
  width: 100%;
  min-inline-size: 0;
}
.catalog-active-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: var(--brand-light);
  color: var(--brand-dark);
  font-size: 0.84rem;
  border: 1px solid color-mix(in oklab, var(--brand), transparent 65%);
}
.catalog-chip-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--brand-contrast);
  font-size: 0.72rem;
  font-weight: 900;
  text-decoration: none;
  line-height: 1;
}
.catalog-toolbar {
  container: catalog-toolbar / inline-size;
  padding: 0.85rem 1rem;
  margin-block-end: 1.15rem;
  display: grid;
  gap: 0.72rem;
  min-inline-size: 0;
  max-inline-size: 100%;
}
.catalog-toolbar > * {
  min-inline-size: 0;
}
.catalog-sort-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-inline-size: 0;
  overflow-x: auto;
  scrollbar-width: none;
  padding-block: 0.1rem;
}
.catalog-sort-bar::-webkit-scrollbar {
  display: none;
}
.catalog-sort-label {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.catalog-sort-pills {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.4rem;
}
.sort-pill-btn {
  display: inline-flex;
  align-items: center;
  min-block-size: 36px;
  padding: 0.32rem 0.78rem;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.83rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: border-color 0.14s, background 0.14s, color 0.14s, transform 0.12s;
}
.sort-pill-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
  transform: translateY(-1px);
}
.sort-pill-btn.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-contrast);
  box-shadow: 0 3px 10px color-mix(in oklab, var(--brand), transparent 65%);
}

.catalog-filter-disclosure {
  border-top: 1px solid var(--border);
  padding-block-start: 0.72rem;
  min-inline-size: 0;
}
.catalog-filter-summary {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-block-size: 40px;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}
.catalog-filter-summary::-webkit-details-marker {
  display: none;
}
.catalog-filter-chevron {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}

.catalog-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  min-inline-size: 0;
}
.catalog-filter-field {
  flex: 1 1 140px;
  min-inline-size: 0;
}
.catalog-filter-kw {
  flex: 1.35 1 170px;
}
.catalog-filter-row .form-control,
.catalog-filter-row .form-select {
  width: 100%;
  min-inline-size: 0;
  max-inline-size: 100%;
  padding: 0.42rem 0.62rem;
  font-size: 0.86rem;
  min-block-size: 38px;
}
.catalog-price-range {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  flex: 0 1 auto;
  min-inline-size: 0;
}
.catalog-price-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}
.catalog-price-sep {
  color: var(--text-muted);
  font-weight: 700;
}
.catalog-price-range .form-control {
  width: 82px;
  text-align: center;
  padding-inline: 0.35rem;
}
.catalog-flash-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.72rem;
  min-block-size: 38px;
  border: 1.5px solid var(--border);
  border-radius: var(--btn-radius);
  background: var(--surface-alt);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}
.catalog-flash-toggle:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-light);
  color: var(--brand-dark);
}
.catalog-filter-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-inline-start: auto;
}

/* Container-responsive compact filter grid (zero horizontal overflow down to 320px) */
@container catalog-toolbar (inline-size <= 700px) {
  .catalog-filter-summary {
    display: flex;
  }
  .catalog-filter-disclosure[open] .catalog-filter-summary {
    margin-block-end: 0.65rem;
  }
  .catalog-filter-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }
  .catalog-filter-kw {
    grid-column: 1 / -1;
  }
  .catalog-price-range {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 0.35rem;
  }
  .catalog-price-range .form-control {
    width: 100%;
  }
  .catalog-flash-toggle {
    grid-column: 1 / -1;
    justify-content: center;
  }
  .catalog-filter-actions {
    grid-column: 1 / -1;
    margin-inline-start: 0;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.45rem;
  }
}

.catalog-product-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
@media (max-width: 1180px) {
  .catalog-product-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 900px) {
  .catalog-product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .container {
    width: min(100% - 1.1rem, var(--container-max));
  }
  .site-header {
    position: static;
  }
  .header-main {
    grid-template-columns: 1fr auto;
    gap: 0.55rem;
    padding-block: 0.55rem;
  }
  .brand-logo {
    font-size: 1.15rem;
    min-inline-size: 0;
  }
  .brand-logo-img {
    max-height: 34px;
    max-width: 100px;
  }
  .header-search {
    grid-column: 1 / -1;
    order: 3;
  }
  .header-actions {
    gap: 0.35rem;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .header-actions .icon-btn {
    padding: 0.34rem 0.52rem;
    font-size: 0.78rem;
  }
  .cat-nav-list {
    scrollbar-width: none;
  }
  .cat-nav-list::-webkit-scrollbar {
    display: none;
  }
  .catalog-toolbar {
    padding: 0.7rem 0.75rem;
    gap: 0.55rem;
  }
  .catalog-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
  }
  .catalog-product-grid .product-body {
    padding: 0.65rem;
  }
  .catalog-product-grid .product-title {
    font-size: 0.86rem;
  }
  .catalog-product-grid .price-sale {
    font-size: 1rem;
  }
}
