/**
 * SACRUM - Liturgical Vestments & Church Apparel Catalog
 * Design System: Ecclesiastical Gold & Deep Obsidian
 * Mobile-First, Touch-Optimized, High-Fidelity UI
 */

:root {
  /* Color Palette */
  --bg-primary: #0e1013;
  --bg-secondary: #14171d;
  --bg-surface: #1a1e24;
  --bg-surface-elevated: #222730;
  --bg-card: #181c22;
  --bg-glass: rgba(20, 23, 29, 0.85);

  --text-primary: #f5f6f8;
  --text-secondary: #c0c6d0;
  --text-muted: #848e9c;
  --text-gold: #e2c079;

  --gold-primary: #d4af37;
  --gold-light: #f3e5ab;
  --gold-dark: #a3801f;
  --gold-gradient: linear-gradient(135deg, #f5e197 0%, #d4af37 50%, #aa820a 100%);
  --gold-border: rgba(212, 175, 55, 0.28);
  --gold-glow: rgba(212, 175, 55, 0.15);

  --accent-red: #c1121f;
  --accent-green: #2a9d8f;
  --accent-blue: #1d3557;
  --accent-purple: #7209b7;

  --border-light: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.04);
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.5);
  --shadow-gold: 0 4px 20px rgba(212, 175, 55, 0.2);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --font-serif: 'Cormorant Garamond', 'Cinzel', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  --header-height: 68px;
  --bottom-nav-height: 64px;
}

/* Light Theme Variables (Applied explicitly or via system preference) */
:root[data-theme="light"],
body.light-theme {
  --bg-primary: #fcfbf7;
  --bg-secondary: #f4efe4;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #f7f3ea;
  --bg-card: #ffffff;
  --bg-glass: rgba(252, 251, 247, 0.92);

  --text-primary: #14171d;
  --text-secondary: #3e4450;
  --text-muted: #6f7887;
  --text-gold: #9d761a;

  --gold-primary: #bfa139;
  --gold-light: #8a6515;
  --gold-surface: #f7f0dc;
  --gold-dark: #6e4e08;
  --gold-gradient: linear-gradient(135deg, #e0ba52 0%, #c49d2c 50%, #9e7a17 100%);
  --gold-border: rgba(180, 140, 30, 0.32);
  --gold-glow: rgba(190, 150, 40, 0.16);

  --border-light: rgba(0, 0, 0, 0.08);
  --border-subtle: rgba(0, 0, 0, 0.04);
  
  --shadow-sm: 0 2px 8px rgba(30, 20, 10, 0.05);
  --shadow-md: 0 6px 22px rgba(30, 20, 10, 0.08);
  --shadow-lg: 0 14px 40px rgba(30, 20, 10, 0.12);
  --shadow-gold: 0 4px 18px rgba(180, 140, 30, 0.18);
}

/* Automatic System Preference for Light Theme when not manually set to dark */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg-primary: #fcfbf7;
    --bg-secondary: #f4efe4;
    --bg-surface: #ffffff;
    --bg-surface-elevated: #f7f3ea;
    --bg-card: #ffffff;
    --bg-glass: rgba(252, 251, 247, 0.92);

    --text-primary: #14171d;
    --text-secondary: #3e4450;
    --text-muted: #6f7887;
    --text-gold: #9d761a;

    --gold-primary: #bfa139;
    --gold-light: #8a6515;
    --gold-surface: #f7f0dc;
    --gold-dark: #6e4e08;
    --gold-gradient: linear-gradient(135deg, #e0ba52 0%, #c49d2c 50%, #9e7a17 100%);
    --gold-border: rgba(180, 140, 30, 0.32);
    --gold-glow: rgba(190, 150, 40, 0.16);

    --border-light: rgba(0, 0, 0, 0.08);
    --border-subtle: rgba(0, 0, 0, 0.04);
    
    --shadow-sm: 0 2px 8px rgba(30, 20, 10, 0.05);
    --shadow-md: 0 6px 22px rgba(30, 20, 10, 0.08);
    --shadow-lg: 0 14px 40px rgba(30, 20, 10, 0.12);
    --shadow-gold: 0 4px 18px rgba(180, 140, 30, 0.18);
  }
}

/* Dark Theme Explicit Override */
:root[data-theme="dark"] {
  --bg-primary: #0e1013;
  --bg-secondary: #14171d;
  --bg-surface: #1a1e24;
  --bg-surface-elevated: #222730;
  --bg-card: #181c22;
  --bg-glass: rgba(20, 23, 29, 0.85);

  --text-primary: #f5f6f8;
  --text-secondary: #c0c6d0;
  --text-muted: #848e9c;
  --text-gold: #e2c079;

  --gold-primary: #d4af37;
  --gold-light: #f3e5ab;
  --gold-dark: #a3801f;
  --gold-gradient: linear-gradient(135deg, #f5e197 0%, #d4af37 50%, #aa820a 100%);
  --gold-border: rgba(212, 175, 55, 0.28);
  --gold-glow: rgba(212, 175, 55, 0.15);

  --border-light: rgba(255, 255, 255, 0.08);
  --border-subtle: rgba(255, 255, 255, 0.04);
  
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.5);
  --shadow-gold: 0 4px 20px rgba(212, 175, 55, 0.2);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  padding-bottom: calc(var(--bottom-nav-height) + 12px);
}

@media (min-width: 992px) {
  body {
    padding-bottom: 0;
  }
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

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

/* Typography Helpers */
.font-serif {
  font-family: var(--font-serif);
}

.gold-gradient-text {
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

/* Announcement Top Bar */
.top-bar {
  background: linear-gradient(90deg, #1c1508, #2a2010, #1c1508);
  border-bottom: 1px solid var(--gold-border);
  font-size: 0.8rem;
  color: var(--gold-light);
  padding: 6px 16px;
  text-align: center;
  position: relative;
  z-index: 50;
}

.top-bar-content {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.top-bar-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-light);
  height: var(--header-height);
  display: flex;
  align-items: center;
}

.header-container {
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  user-select: none;
}

.brand-icon {
  width: 40px;
  height: 40px;
  background: var(--bg-surface-elevated);
  border: 1.5px solid var(--gold-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 14px var(--gold-glow);
  overflow: hidden;
  flex-shrink: 0;
}

.brand-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.brand-icon svg {
  width: 22px;
  height: 22px;
  fill: var(--gold-primary);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: 3px;
  line-height: 1;
  color: var(--text-gold);
}

.brand-sub {
  font-size: 0.65rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  line-height: 1.2;
}

/* Header Search (Desktop) */
.header-search {
  flex: 1;
  max-width: 440px;
  position: relative;
  display: none;
}

@media (min-width: 768px) {
  .header-search {
    display: block;
  }
}

.header-search input {
  width: 100%;
  padding: 9px 16px 9px 38px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 0.88rem;
  transition: all 0.2s ease;
}

.header-search input:focus {
  outline: none;
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 3px var(--gold-glow);
  background: var(--bg-surface-elevated);
}

.header-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-header-contact {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-full);
  color: var(--gold-light);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s;
}

@media (min-width: 640px) {
  .btn-header-contact {
    display: inline-flex;
  }
}

.btn-header-contact:hover {
  background: var(--gold-primary);
  color: #000000;
}

.btn-cart-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  background: var(--gold-gradient);
  color: #0e1013;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: var(--radius-full);
  box-shadow: 0 2px 10px rgba(212, 175, 55, 0.3);
  transition: transform 0.15s, box-shadow 0.15s;
  min-height: 44px;
}

.btn-cart-trigger:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(212, 175, 55, 0.45);
}

.btn-cart-trigger:active {
  transform: translateY(1px);
}

.cart-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #0e1013;
  color: var(--gold-light);
  font-size: 0.75rem;
  font-weight: 700;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  margin-left: 2px;
}

/* Hero Section */
.hero {
  position: relative;
  padding: 36px 16px 28px;
  background: radial-gradient(circle at 50% 10%, rgba(212, 175, 55, 0.08) 0%, transparent 65%),
              linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
  border-bottom: 1px solid var(--border-light);
  text-align: center;
}

.hero-inner {
  max-width: 900px;
  margin: 0 auto;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid var(--gold-border);
  color: var(--text-gold);
  font-size: 0.78rem;
  font-weight: 500;
  margin-bottom: 14px;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(1.85rem, 4vw, 2.85rem);
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}

.hero-desc {
  font-size: clamp(0.92rem, 1.8vw, 1.05rem);
  color: var(--text-secondary);
  max-width: 680px;
  margin: 0 auto 20px;
}

.hero-badges {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.hero-badge-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hero-badge-item svg {
  color: var(--gold-primary);
}

/* Main Container Layout */
.main-content {
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 16px 40px;
  flex: 1;
}

/* Category Navigation (Horizontal Swipeable Bar) */
.category-nav-wrapper {
  margin-bottom: 16px;
  position: sticky;
  top: var(--header-height);
  z-index: 30;
  background: var(--bg-primary);
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
}

.category-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 4px 2px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

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

.category-chip {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  transition: all 0.2s ease;
  min-height: 44px;
}

.category-chip:hover {
  background: var(--bg-surface-elevated);
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
}

.category-chip.active {
  background: rgba(212, 175, 55, 0.15);
  border-color: var(--gold-primary);
  color: var(--gold-light);
  box-shadow: 0 0 12px var(--gold-glow);
}

.category-chip-count {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.75rem;
}

.category-chip.active .category-chip-count {
  background: var(--gold-primary);
  color: #0e1013;
  font-weight: 700;
}

/* Subcategory Pills Row */
.subcategory-nav {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 6px 2px 14px;
  margin-bottom: 12px;
  -webkit-overflow-scrolling: touch;
}

.subcategory-nav::-webkit-scrollbar {
  display: none;
}

.subcategory-pill {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.82rem;
  transition: all 0.15s;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
}

.subcategory-pill:hover {
  color: var(--text-primary);
  border-color: var(--border-light);
}

.subcategory-pill.active {
  background: var(--bg-surface-elevated);
  border-color: var(--gold-border);
  color: var(--text-gold);
  font-weight: 600;
}

/* Catalog Controls & Toolbar */
.catalog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.toolbar-info {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.toolbar-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

@media (min-width: 640px) {
  .toolbar-controls {
    width: auto;
  }
}

.mobile-search-box {
  flex: 1;
  position: relative;
  display: block;
}

@media (min-width: 768px) {
  .mobile-search-box {
    display: none;
  }
}

.mobile-search-box input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  color: var(--text-primary);
}

.mobile-search-box svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.sort-select {
  padding: 8px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.85rem;
  outline: none;
  min-height: 40px;
}

.sort-select:focus {
  border-color: var(--gold-primary);
}

/* Product Grid: 1 column on mobile for Pixel 6a and smartphones */
.product-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

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

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

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

/* Product Card */
.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.product-card:hover {
  transform: translateY(-3px);
  border-color: var(--gold-border);
  box-shadow: var(--shadow-md);
}

.product-image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #0f1115;
  overflow: hidden;
  cursor: pointer;
}

@media (min-width: 640px) {
  .product-image-wrap {
    aspect-ratio: 4 / 3.2;
  }
}

.product-image-wrap img, .product-image-wrap svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.product-card:hover .product-image-wrap img,
.product-card:hover .product-image-wrap svg {
  transform: scale(1.03);
}

.product-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.badge-popular {
  background: var(--gold-gradient);
  color: #0e1013;
}

.badge-new {
  background: #2a9d8f;
  color: #ffffff;
}

.badge-handcrafted {
  background: #c1121f;
  color: #ffffff;
}

.badge-custom {
  background: #7209b7;
  color: #ffffff;
}

.product-info {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

@media (min-width: 640px) {
  .product-info {
    padding: 16px;
  }
}

.product-meta {
  font-size: 0.74rem;
  color: var(--gold-light);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.product-title {
  font-family: var(--font-serif);
  font-size: clamp(1.1rem, 2.5vw, 1.25rem);
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 8px;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  cursor: pointer;
}

.product-title:hover {
  color: var(--text-gold);
}

.product-fabric {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.product-price {
  display: flex;
  flex-direction: column;
}

.price-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.price-val {
  font-family: var(--font-sans);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-gold);
}

.btn-card-order {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--gold-border);
  color: var(--gold-light);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  transition: all 0.15s;
  min-height: 44px;
  min-width: 100px;
}

.btn-card-order:hover {
  background: var(--gold-primary);
  color: #0e1013;
}

/* Modals & Overlays */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}

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

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-lg);
  max-width: 760px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(0.98);
  transition: transform 0.25s ease;
}

.modal-overlay.active .modal-card {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  z-index: 10;
  transition: all 0.15s;
}

.modal-close:hover {
  color: var(--text-primary);
  background: var(--bg-surface-elevated);
}

/* Cart Drawer / Bottom Sheet */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

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

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 480px;
  background: var(--bg-secondary);
  border-left: 1px solid var(--gold-border);
  box-shadow: var(--shadow-lg);
  z-index: 95;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (max-width: 640px) {
  .cart-drawer {
    top: auto;
    bottom: 0;
    max-width: 100%;
    height: 92vh;
    border-left: none;
    border-top: 1px solid var(--gold-border);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    transform: translateY(100%);
  }
}

.drawer-overlay.active .cart-drawer {
  transform: translate(0, 0);
}

.drawer-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text-gold);
}

.drawer-body {
  padding: 16px 20px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cart-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
}

.cart-item-img {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  background: #000;
  overflow: hidden;
  flex-shrink: 0;
}

.cart-item-details {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.cart-item-name {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.cart-item-option {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.cart-item-price {
  font-weight: 700;
  color: var(--text-gold);
  font-size: 0.92rem;
  margin-top: 4px;
}

.cart-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.qty-btn {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-light);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: var(--text-primary);
}

.qty-val {
  font-size: 0.88rem;
  min-width: 20px;
  text-align: center;
  font-weight: 600;
}

.btn-remove-item {
  margin-left: auto;
  color: var(--accent-red);
  font-size: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.drawer-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-surface);
}

.order-total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 1.05rem;
}

.order-total-val {
  font-family: var(--font-sans);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-gold);
}

.btn-checkout {
  width: 100%;
  padding: 12px;
  background: var(--gold-gradient);
  color: #0e1013;
  font-weight: 700;
  font-size: 1rem;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(212, 175, 55, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
}

/* Form Styles */
.form-group {
  margin-bottom: 12px;
}

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

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

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--gold-primary);
  background: var(--bg-surface-elevated);
}

.form-help {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Mobile Sticky Bottom Nav */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-height);
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 50;
  padding: 0 8px;
}

@media (min-width: 992px) {
  .mobile-bottom-nav {
    display: none;
  }
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 500;
  padding: 6px 0;
  position: relative;
  min-height: 44px;
}

.bottom-nav-item.active {
  color: var(--text-gold);
}

.bottom-nav-item svg {
  width: 20px;
  height: 20px;
}

.bottom-nav-badge {
  position: absolute;
  top: 2px;
  right: calc(50% - 16px);
  background: var(--gold-primary);
  color: #000;
  font-size: 0.68rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* Footer */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-light);
  padding: 36px 16px 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-container {
  max-width: 1320px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}

@media (min-width: 768px) {
  .footer-container {
    grid-template-columns: 2fr 1fr 1fr;
  }
}

.footer-col h4 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--text-gold);
  margin-bottom: 12px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-links a:hover {
  color: var(--text-primary);
}

.footer-bottom {
  max-width: 1320px;
  margin: 28px auto 0;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.78rem;
}

/* Theme Toggle Button */
.btn-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  color: var(--text-gold);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.btn-theme-toggle:hover {
  background: var(--bg-surface-elevated);
  border-color: var(--gold-primary);
  transform: translateY(-1px);
}

.btn-theme-toggle svg {
  width: 18px;
  height: 18px;
  transition: transform 0.3s ease;
}

.btn-theme-toggle:active svg {
  transform: scale(0.9) rotate(30deg);
}

/* Light Theme Element Refinements */
:root[data-theme="light"] .top-bar,
body.light-theme .top-bar {
  background: linear-gradient(90deg, #f2ece0, #faeed4, #f2ece0);
  border-bottom: 1px solid var(--gold-border);
  color: #7a5c17;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .top-bar {
    background: linear-gradient(90deg, #f2ece0, #faeed4, #f2ece0);
    border-bottom: 1px solid var(--gold-border);
    color: #7a5c17;
  }
}

:root[data-theme="light"] .hero,
body.light-theme .hero {
  background: radial-gradient(circle at 50% 10%, rgba(212, 175, 55, 0.12) 0%, transparent 65%),
              linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .hero {
    background: radial-gradient(circle at 50% 10%, rgba(212, 175, 55, 0.12) 0%, transparent 65%),
                linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
  }
}

:root[data-theme="light"] .product-image-wrap,
body.light-theme .product-image-wrap {
  background: #14171d;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .product-image-wrap {
    background: #14171d;
  }
}

:root[data-theme="light"] .product-card,
body.light-theme .product-card {
  box-shadow: 0 4px 18px rgba(40, 30, 10, 0.06);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .product-card {
    box-shadow: 0 4px 18px rgba(40, 30, 10, 0.06);
  }
}

/* ==========================================================================
   Comprehensive Light Theme Overrides & Active States
   ========================================================================== */
:root[data-theme="light"],
body.light-theme {
  --text-gold: #7a5406;
  --gold-light: #7a5406;
  --gold-primary: #bfa139;
  --gold-dark: #6e4e08;
}

/* 1. Header Phone & Contacts */
:root[data-theme="light"] .btn-header-contact,
body.light-theme .btn-header-contact,
:root:not([data-theme="dark"]) .btn-header-contact {
  background: #fbf5e6 !important;
  border-color: #d4af37 !important;
  color: #7a5406 !important;
  font-weight: 700 !important;
}

:root[data-theme="light"] .btn-header-contact svg,
body.light-theme .btn-header-contact svg,
:root:not([data-theme="dark"]) .btn-header-contact svg {
  stroke: #7a5406 !important;
}

:root[data-theme="light"] .btn-header-contact:hover,
body.light-theme .btn-header-contact:hover,
:root:not([data-theme="dark"]) .btn-header-contact:hover {
  background: #d4af37 !important;
  border-color: #bfa139 !important;
  color: #1a1505 !important;
}

:root[data-theme="light"] .btn-header-contact:hover svg,
body.light-theme .btn-header-contact:hover svg,
:root:not([data-theme="dark"]) .btn-header-contact:hover svg {
  stroke: #1a1505 !important;
}

/* 2. Category Chips & Navigation */
:root[data-theme="light"] .category-chip,
body.light-theme .category-chip,
:root:not([data-theme="dark"]) .category-chip {
  background: #ffffff !important;
  border-color: rgba(0, 0, 0, 0.14) !important;
  color: #2c323f !important;
  font-weight: 600 !important;
}

:root[data-theme="light"] .category-chip:hover,
body.light-theme .category-chip:hover,
:root:not([data-theme="dark"]) .category-chip:hover {
  background: #fbf8f0 !important;
  border-color: #bfa139 !important;
  color: #1a1505 !important;
}

:root[data-theme="light"] .category-chip-count,
body.light-theme .category-chip-count,
:root:not([data-theme="dark"]) .category-chip-count {
  background: #efe9db !important;
  color: #4a3e20 !important;
  font-weight: 700 !important;
}

/* ACTIVE Category Chip */
:root[data-theme="light"] .category-chip.active,
body.light-theme .category-chip.active,
:root[data-theme="light"] .category-chip.active:hover,
body.light-theme .category-chip.active:hover,
:root:not([data-theme="dark"]) .category-chip.active,
:root:not([data-theme="dark"]) .category-chip.active:hover {
  background: #d4af37 !important;
  border-color: #bfa139 !important;
  color: #1a1505 !important;
  font-weight: 800 !important;
  box-shadow: 0 4px 16px rgba(180, 140, 30, 0.28) !important;
}

:root[data-theme="light"] .category-chip.active .category-chip-count,
body.light-theme .category-chip.active .category-chip-count,
:root:not([data-theme="dark"]) .category-chip.active .category-chip-count {
  background: #1a1505 !important;
  color: #ffffff !important;
  font-weight: 700 !important;
}

/* 3. Subcategory Pills */
:root[data-theme="light"] .subcategory-pill,
body.light-theme .subcategory-pill,
:root:not([data-theme="dark"]) .subcategory-pill {
  background: #f4efe4 !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
  color: #3e4450 !important;
  font-weight: 500 !important;
}

:root[data-theme="light"] .subcategory-pill:hover,
body.light-theme .subcategory-pill:hover,
:root:not([data-theme="dark"]) .subcategory-pill:hover {
  background: #eadeca !important;
  color: #14171d !important;
  border-color: rgba(0, 0, 0, 0.2) !important;
}

:root[data-theme="light"] .subcategory-pill.active,
body.light-theme .subcategory-pill.active,
:root:not([data-theme="dark"]) .subcategory-pill.active {
  background: #2a2010 !important;
  border-color: #2a2010 !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

/* 4. Product Cards in Catalog */
:root[data-theme="light"] .product-meta,
body.light-theme .product-meta,
:root:not([data-theme="dark"]) .product-meta {
  color: #7a5406 !important;
  font-weight: 700 !important;
}

:root[data-theme="light"] .product-title,
body.light-theme .product-title,
:root:not([data-theme="dark"]) .product-title {
  color: #14171d !important;
  font-weight: 700 !important;
}

:root[data-theme="light"] .product-title:hover,
body.light-theme .product-title:hover,
:root:not([data-theme="dark"]) .product-title:hover {
  color: #7a5406 !important;
}

:root[data-theme="light"] .price-val,
body.light-theme .price-val,
:root:not([data-theme="dark"]) .price-val {
  color: #7a5406 !important;
  font-weight: 800 !important;
}

:root[data-theme="light"] .gold-gradient-text,
body.light-theme .gold-gradient-text,
:root:not([data-theme="dark"]) .gold-gradient-text {
  background: linear-gradient(135deg, #9d761a 0%, #7a5406 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}

/* 5. Buttons in Light Mode */
:root[data-theme="light"] .btn-card-order,
body.light-theme .btn-card-order,
:root:not([data-theme="dark"]) .btn-card-order {
  background: #ffffff !important;
  border-color: #c49d2c !important;
  color: #7a5406 !important;
  font-weight: 700 !important;
}

:root[data-theme="light"] .btn-card-order:hover,
body.light-theme .btn-card-order:hover,
:root:not([data-theme="dark"]) .btn-card-order:hover {
  background: #d4af37 !important;
  border-color: #bfa139 !important;
  color: #1a1505 !important;
}

/* 6. Admin Panel Navigation & Elements */
:root[data-theme="light"] .admin-nav,
body.light-theme .admin-nav,
:root:not([data-theme="dark"]) .admin-nav {
  background: rgba(255, 255, 255, 0.96) !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05) !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
}

:root[data-theme="light"] .admin-link,
body.light-theme .admin-link,
:root:not([data-theme="dark"]) .admin-link {
  color: #3e4450 !important;
  font-weight: 500 !important;
}

:root[data-theme="light"] .admin-link:hover,
body.light-theme .admin-link:hover,
:root:not([data-theme="dark"]) .admin-link:hover {
  background: #f7f3ea !important;
  color: #14171d !important;
}

/* ACTIVE Admin Nav Link */
:root[data-theme="light"] .admin-link.active,
body.light-theme .admin-link.active,
:root:not([data-theme="dark"]) .admin-link.active {
  background: #fbf5e4 !important;
  color: #7a5406 !important;
  border: 1px solid #c49d2c !important;
  font-weight: 700 !important;
}

:root[data-theme="light"] .admin-link-site,
body.light-theme .admin-link-site,
:root:not([data-theme="dark"]) .admin-link-site {
  color: #7a5406 !important;
  font-weight: 700 !important;
}

/* Mobile Bottom Nav in Light Mode */
:root[data-theme="light"] .admin-mobile-nav,
body.light-theme .admin-mobile-nav,
:root:not([data-theme="dark"]) .admin-mobile-nav {
  background: rgba(255, 255, 255, 0.96) !important;
  border-top-color: rgba(0, 0, 0, 0.1) !important;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06) !important;
}

:root[data-theme="light"] .admin-mobile-nav-item,
body.light-theme .admin-mobile-nav-item,
:root:not([data-theme="dark"]) .admin-mobile-nav-item {
  color: #555e6d !important;
}

:root[data-theme="light"] .admin-mobile-nav-item.active,
body.light-theme .admin-mobile-nav-item.active,
:root:not([data-theme="dark"]) .admin-mobile-nav-item.active {
  color: #7a5406 !important;
  font-weight: 800 !important;
}

/* Order Details Typography in Light Mode */
:root[data-theme="light"] .order-badge-number,
body.light-theme .order-badge-number,
:root:not([data-theme="dark"]) .order-badge-number {
  color: #7a5406 !important;
  font-weight: 800 !important;
}

:root[data-theme="light"] .order-phone-link,
body.light-theme .order-phone-link,
:root:not([data-theme="dark"]) .order-phone-link {
  color: #7a5406 !important;
  font-weight: 800 !important;
}

:root[data-theme="light"] .order-item-options,
body.light-theme .order-item-options,
:root:not([data-theme="dark"]) .order-item-options {
  color: #7a5406 !important;
  font-weight: 600 !important;
}

