/* LiveOptical — Frontend CSS */

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

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary: #64748b;
  --success: #16a34a;
  --warning: #ca8a04;
  --danger: #dc2626;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --bg: #f8fafc;
  --white: #fff;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  /* theme-overridable */
  --nav-bg: #1e293b;
  --nav-text: #cbd5e1;
  --nav-text-hover: #ffffff;
  --hero-from: #1e40af;
  --hero-to: #7c3aed;
}

body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; color: var(--text); background: var(--bg); line-height: 1.6; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }
/* Inside site-body, max-width centering is already handled */
.site-main .container { max-width: none; margin: 0; }

/* Buttons */
.btn { display: inline-block; padding: .5rem 1.25rem; border-radius: var(--radius); border: none; cursor: pointer; font-size: .9rem; font-weight: 500; transition: background .15s; text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; text-decoration: none; }
.btn-secondary { background: var(--secondary); color: #fff; }
.btn-secondary:hover { opacity: .9; color: #fff; text-decoration: none; }
.btn-block { display: block; width: 100%; text-align: center; margin-bottom: .5rem; }
.btn-large { padding: .75rem 2rem; font-size: 1rem; }
.btn-add-cart { background: var(--primary); color: #fff; border: none; padding: .4rem .8rem; border-radius: var(--radius); cursor: pointer; width: 100%; }
.btn-link { background: none; border: none; color: var(--primary); cursor: pointer; padding: 0; }
.btn-remove { background: none; border: none; color: var(--danger); font-size: 1.2rem; cursor: pointer; }
.btn-mirror { background: #f1f5f9; border: 1px solid var(--border); color: var(--text); }
.btn-mirror:hover { background: var(--border); }

/* Alerts */
.alert { padding: .75rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; }
.alert-success { background: #dcfce7; color: #166534; }
.alert-error { background: #fee2e2; color: #991b1b; }

/* ═══════════════════════════════════════════════
   HEADER
═══════════════════════════════════════════════ */
.site-header {
  background: var(--white);
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-top { padding: .85rem 0; border-bottom: 1px solid var(--border); }
.header-top .container { display: flex; align-items: center; gap: 1.5rem; }
.logo { font-size: 1.5rem; font-weight: 700; color: var(--text); letter-spacing: -.02em; display: inline-flex; align-items: center; }
.logo span { color: var(--primary); }
.logo-img { max-height: 44px; width: auto; display: block; }
.header-search { flex: 1; display: flex; }
.header-search input {
  flex: 1;
  padding: .55rem 1rem;
  border: 1px solid #cbd5e1;
  border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
  font-size: .9rem;
  outline: none;
  transition: border-color .15s;
}
.header-search input:focus { border-color: var(--primary); }
.header-search button {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: .55rem 1.1rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  cursor: pointer;
  font-size: .875rem;
  font-weight: 500;
  transition: background .15s;
}
.header-search button:hover { background: var(--primary-dark); }
.header-actions { display: flex; align-items: center; gap: 1rem; font-size: .875rem; white-space: nowrap; }
.header-actions a { color: var(--secondary); }
.header-actions a:hover { color: var(--primary); text-decoration: none; }
.cart-btn {
  background: var(--primary);
  color: #fff !important;
  border: none;
  padding: .45rem 1rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: .875rem;
  font-weight: 600;
  font-family: inherit;
  transition: background .15s;
}
.cart-btn:hover { background: var(--primary-dark); text-decoration: none; }

/* ═══════════════════════════════════════════════
   TOP NAVIGATION — horizontal multi-level dropdown
═══════════════════════════════════════════════ */
.main-nav {
  background: var(--nav-bg);
  position: relative;
  z-index: 99;
  border-bottom: 3px solid var(--primary);
}
.main-nav .container { display: flex; padding: 0 1rem; }
.top-nav-list { list-style: none; display: flex; margin: 0; padding: 0; }

/* Top-level nav items */
.top-nav-item { position: relative; }
.top-nav-item > a {
  display: flex;
  align-items: center;
  gap: .35rem;
  padding: .85rem 1.2rem;
  color: #e2e8f0;
  font-size: .875rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  margin-bottom: -3px;        /* overlap nav border-bottom */
  transition: color .15s, border-color .15s;
}
.top-nav-item > a:hover {
  color: #fff;
  border-bottom-color: #fff;
  text-decoration: none;
}
/* Down-arrow indicator for items with children */
.top-nav-item.has-dropdown > a::after {
  content: '▾';
  font-size: .7rem;
  opacity: .7;
  line-height: 1;
}

/* ── First-level dropdown panel ── */
.top-nav-item .dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 3px);   /* clear the nav border */
  left: 0;
  min-width: 220px;
  background: #fff;
  border: 1px solid #d1d5db;
  border-top: 3px solid var(--primary);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,.12), 0 2px 6px rgba(0,0,0,.06);
  list-style: none;
  margin: 0;
  padding: .4rem 0;
  z-index: 200;
}
.top-nav-item:hover > .dropdown { display: block; }

/* Dropdown list items */
.top-nav-item .dropdown li { position: relative; }
.top-nav-item .dropdown li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .55rem 1.1rem;
  color: #374151;
  font-size: .85rem;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background .1s, color .1s, border-color .1s;
}
.top-nav-item .dropdown li a:hover {
  background: #eff6ff;
  color: var(--primary);
  border-left-color: var(--primary);
  text-decoration: none;
}
/* Right-arrow on items that have a fly-out */
.top-nav-item .dropdown li.has-dropdown > a::after {
  content: '›';
  font-size: 1rem;
  color: #9ca3af;
  line-height: 1;
}
.top-nav-item .dropdown li.has-dropdown > a:hover::after { color: var(--primary); }

/* ── Second-level fly-out panel ── */
.top-nav-item .dropdown .dropdown-right {
  display: none;
  position: absolute;
  top: -4px;
  left: calc(100% + 1px);
  min-width: 220px;
  background: #fff;
  border: 1px solid #d1d5db;
  border-top: 3px solid var(--primary);
  border-radius: 0 var(--radius) var(--radius) var(--radius);
  box-shadow: 6px 8px 24px rgba(0,0,0,.12);
  list-style: none;
  margin: 0;
  padding: .4rem 0;
  z-index: 201;
}
.top-nav-item .dropdown li.has-dropdown:hover > .dropdown-right { display: block; }

/* ═══════════════════════════════════════════════
   FLASH MESSAGES
═══════════════════════════════════════════════ */
.flash-messages { padding-top: 1rem; }

/* ═══════════════════════════════════════════════
   SITE BODY LAYOUT — sidebar + content
═══════════════════════════════════════════════ */
.site-body {
  display: flex;
  align-items: flex-start;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  gap: 1.25rem;
}
.site-sidebar {
  width: 215px;
  flex-shrink: 0;
  padding: 1.25rem 0 2rem;
}
.site-main { flex: 1; min-width: 0; min-height: 70vh; }

/* ═══════════════════════════════════════════════
   SIDE NAVIGATION — collapsible category tree
═══════════════════════════════════════════════ */
.side-nav-box {
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
/* Stacked boxes (Categories + Shop by Brand + Shop by Price) */
.side-nav-box + .side-nav-box { margin-top: 1.25rem; }

/* Box title bar */
.side-nav-title {
  background: var(--nav-bg);
  color: #94a3b8;
  padding: .7rem 1rem;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

/* Root-level list */
.side-nav { list-style: none; margin: 0; padding: 0; }

/* Every nav item */
.side-nav-item { border-bottom: 1px solid #e5e7eb; }
.side-nav-item:last-child { border-bottom: none; }

/* Row = link + optional toggle */
.side-nav-row {
  display: flex;
  align-items: stretch;
  min-height: 38px;
}

/* Category link */
.side-nav-link {
  flex: 1;
  display: flex;
  align-items: center;
  padding: .5rem .9rem;
  color: #374151;
  font-size: .875rem;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background .12s, color .12s, border-color .12s;
}
.side-nav-link:hover {
  background: #eff6ff;
  color: var(--primary);
  border-left-color: var(--primary);
  text-decoration: none;
}

/* Toggle button — chevron arrow */
.side-nav-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  flex-shrink: 0;
  background: none;
  border: none;
  border-left: 1px solid #e5e7eb;
  color: #9ca3af;
  cursor: pointer;
  font-size: .65rem;
  transition: background .12s, color .12s, transform .2s;
  padding: 0;
}
/* Right-pointing triangle as chevron */
.side-nav-toggle::before { content: '▶'; }
.side-nav-toggle:hover { background: #f1f5f9; color: var(--primary); }
/* Rotate to down-pointing when open */
.side-nav-item.is-open > .side-nav-row > .side-nav-toggle { transform: rotate(90deg); color: var(--primary); }

/* Child list — hidden by default */
.side-nav-children {
  list-style: none;
  margin: 0;
  padding: 0;
  display: none;
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
}
.side-nav-item.is-open > .side-nav-children { display: block; }

/* Child items */
.side-nav-children > .side-nav-item { border-bottom: 1px solid #eef0f2; }
.side-nav-children > .side-nav-item:last-child { border-bottom: none; }
.side-nav-children .side-nav-link {
  padding-left: 1.6rem;
  font-size: .825rem;
  color: #4b5563;
}
.side-nav-children .side-nav-toggle { border-left-color: #eef0f2; }

/* Grandchild items */
.side-nav-children .side-nav-children { background: #f1f5f9; border-top: none; }
.side-nav-children .side-nav-children .side-nav-item { border-bottom: 1px solid #e9ecef; }
.side-nav-children .side-nav-children .side-nav-link {
  padding-left: 2.4rem;
  font-size: .8rem;
  color: #6b7280;
}

/* Footer */
.site-footer { background: var(--text); color: #94a3b8; margin-top: 4rem; padding: 3rem 0 1rem; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 2rem; margin-bottom: 2rem; }
.footer-col h4 { color: var(--white); margin-bottom: .75rem; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: .25rem; }
.footer-col a { color: #94a3b8; }
.footer-col a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid #334155; padding-top: 1rem; text-align: center; font-size: .8rem; }

/* Hero */
.hero { background: linear-gradient(135deg, var(--hero-from) 0%, var(--hero-to) 100%); color: #fff; padding: 5rem 0; text-align: center; }
.hero h1 { font-size: 2.5rem; margin-bottom: 1rem; }
.hero p { font-size: 1.2rem; margin-bottom: 2rem; opacity: .9; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; }

/* Product Grid */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.5rem; margin: 2rem 0; }
/* LAYOUT_GRID_COLUMNS — fixed column count on wider viewports */
@media (min-width: 900px) {
  .product-grid[style*="--grid-cols"] { grid-template-columns: repeat(var(--grid-cols), 1fr); }
}
.product-card { background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .15s; }
.product-card:hover { transform: translateY(-2px); }
.product-image { aspect-ratio: 4/3; overflow: hidden; background: var(--bg); }
.product-image img { width: 100%; height: 100%; object-fit: contain; }
.product-info { padding: 1rem; }
.product-info h3 { font-size: .95rem; margin-bottom: .25rem; }
.product-info .brand { font-size: .8rem; color: var(--text-muted); text-transform: uppercase; }
.pricing { display: flex; align-items: baseline; gap: .5rem; }
.price { font-size: 1.1rem; font-weight: 700; color: var(--primary); }
.list-price { font-size: .9rem; color: var(--text-muted); text-decoration: line-through; }
.savings { font-size: .8rem; color: var(--success); }
.product-actions { padding: .75rem 1rem; border-top: 1px solid var(--border); display: flex; gap: .5rem; }
.badge { display: inline-block; padding: .2rem .5rem; border-radius: 4px; font-size: .75rem; font-weight: 600; }
.badge-featured { background: #fef3c7; color: #92400e; }

/* Product list layout (FEATURED_LAYOUT / LIST_LAYOUT = list) — LiveCart productList.tpl */
.product-list { list-style: none; margin: 1.5rem 0; padding: 0; display: flex; flex-direction: column; gap: 1rem; }
.product-list-item {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.25rem;
  transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease;
}
.product-list-item:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, .1);
  border-color: #cbd5e1;
  transform: translateY(-1px);
}
.product-list-item .pli-image {
  flex: 0 0 120px;
  width: 120px;
  height: 120px;
  overflow: hidden;
  background: var(--bg);
  border-radius: 6px;
  display: block;
}
.product-list-item .pli-image img { width: 100%; height: 100%; object-fit: contain; display: block; }
.product-list-item .pli-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .35rem; }
.product-list-item .pli-brand { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.product-list-item .pli-title { margin: 0; font-size: 1.15rem; line-height: 1.3; }
.product-list-item .pli-title a { color: var(--primary); font-weight: 700; }
.product-list-item .pli-title a:hover { text-decoration: underline; }
.product-list-item .pli-descr {
  margin: 0;
  font-size: .875rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-list-item .pli-foot {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-top: .5rem;
  flex-wrap: wrap;
}
.product-list-item .pli-price { display: inline-flex; align-items: baseline; gap: .5rem; margin-right: auto; }
.product-list-item .pli-cart { margin: 0; }
.product-list-item .pli-foot .btn { white-space: nowrap; }

@media (max-width: 640px) {
  .product-list-item { flex-direction: column; align-items: stretch; padding: 1rem; }
  .product-list-item .pli-image { width: 100%; height: 200px; flex-basis: auto; }
  .product-list-item .pli-foot .pli-price { margin-right: 0; width: 100%; }
}

/* Product table layout (FEATURED_LAYOUT = table) — LiveCart productTable.tpl */
.product-table-wrap { margin: 2rem 0; overflow-x: auto; }
.product-table { width: 100%; border-collapse: collapse; background: var(--white); box-shadow: var(--shadow); border-radius: var(--radius); overflow: hidden; }
.product-table th, .product-table td { padding: .7rem .9rem; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
.product-table thead th { background: var(--bg); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.product-table tbody tr:last-child td { border-bottom: none; }
.product-table .pt-image { width: 72px; }
.product-table .pt-image img { width: 64px; height: 48px; object-fit: contain; border-radius: 4px; display: block; background: var(--bg); }
.product-table .pt-price { white-space: nowrap; }
.product-table .pt-action { width: 1%; white-space: nowrap; text-align: right; }
.product-table .pt-action form { margin: 0; }

/* Categories */
.categories-section, .featured-products, .news-section { padding: 3rem 0; }
.categories-section h2, .featured-products h2, .news-section h2 { margin-bottom: 1.5rem; font-size: 1.5rem; }
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; }
.category-card { background: var(--white); border-radius: var(--radius); padding: 1.5rem 1rem; text-align: center; box-shadow: var(--shadow); color: var(--text); }
.category-card:hover { background: var(--primary); color: #fff; text-decoration: none; }

/* Virtual Mirror Promo */
.virtual-mirror-promo { background: var(--white); padding: 3rem 0; }
.mirror-promo-content { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
.mirror-promo-text h2 { font-size: 1.8rem; margin-bottom: 1rem; }
.mirror-promo-text p { color: var(--text-muted); margin-bottom: 1.5rem; }

/* News */
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }
.news-card { background: var(--white); padding: 1.5rem; border-radius: var(--radius); box-shadow: var(--shadow); }
.news-card h3 { margin-bottom: .5rem; }
.news-card h3 a { color: inherit; text-decoration: none; }
.news-card h3 a:hover { color: var(--primary); }
.news-card small { color: var(--text-muted); }
.news-card-body { margin-top: .5rem; line-height: 1.6; }
.news-card-body img { width: auto; max-width: 100%; height: auto; border-radius: var(--radius); margin: .75rem 0; }
.news-archive-link { margin-top: 1.5rem; text-align: center; }

.news-list { display: flex; flex-direction: column; gap: 2.5rem; }
.news-post { border-bottom: 1px solid var(--border); padding-bottom: 2rem; }
.news-post:last-child { border-bottom: none; }
.news-post h2 { margin-bottom: .25rem; }
.news-post small { color: var(--text-muted); display: block; margin-bottom: .75rem; }

/* Category Page */
.category-header { display: flex; justify-content: space-between; align-items: center; padding: 1.5rem 0 1rem; }
.category-header h1 { font-size: 1.5rem; }
.category-controls { display: flex; align-items: center; gap: 1rem; font-size: .875rem; color: var(--text-muted); }
.category-controls select { padding: .4rem; border-radius: var(--radius); border: 1px solid var(--border); }
.layout-switch { display: inline-flex; gap: .25rem; }
.layout-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text-muted); background: var(--white); font-size: 1rem; line-height: 1;
}
.layout-btn:hover { color: var(--primary); border-color: var(--primary); text-decoration: none; }
.layout-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.category-description { margin-bottom: 1rem; color: var(--text-muted); line-height: 1.6; }
/* Subcategory chips */
.subcategory-bar { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.subcategory-chip { display: inline-block; padding: .3rem .9rem; border: 1px solid var(--border); border-radius: 2rem; font-size: .8rem; color: var(--text); background: var(--white); }
.subcategory-chip:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
/* Filter bar */
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-bottom: 1rem; font-size: .85rem; }
.filter-label { color: var(--text-muted); margin-right: .25rem; }
.filter-chip { display: inline-block; padding: .2rem .75rem; border: 1px solid var(--border); border-radius: 2rem; color: var(--text); background: var(--white); cursor: pointer; }
.filter-chip:hover, .filter-chip.active { background: var(--primary); color: #fff; border-color: var(--primary); text-decoration: none; }
.filter-chip-clear { background: #fee2e2; color: var(--danger); border-color: #fca5a5; }
.filter-count { opacity: .65; font-size: .9em; }
.filter-chip-clear:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
/* Empty state */
.empty-state { text-align: center; padding: 3rem 0; color: var(--text-muted); }
.empty-state p { margin-bottom: 1rem; }
.pagination { display: flex; gap: .5rem; justify-content: center; margin-top: 2rem; }
.pagination a { display: inline-block; padding: .4rem .8rem; border: 1px solid var(--border); border-radius: var(--radius); }
.pagination a.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Product Detail */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; padding: 2rem 0; }
.manufacturer-logo { margin-bottom: .75rem; }
.manufacturer-logo img { max-height: 50px; width: auto; object-fit: contain; }
.main-image { position: relative; }
.main-image a { display: block; cursor: zoom-in; }
.main-image img { width: 100%; height: auto; aspect-ratio: auto; border-radius: var(--radius); }
.watermark-overlay { display: block; width: auto; height: auto; -webkit-user-select: none; user-select: none; }
.image-thumbs { display: flex; gap: .5rem; margin-top: .5rem; }
.thumb { object-fit: contain; background: var(--bg); border-radius: var(--radius); cursor: pointer; border: 2px solid var(--border); }
.thumb:hover { border-color: var(--primary); }
.product-details-info .brand { font-size: .85rem; color: var(--text-muted); text-transform: uppercase; margin-bottom: .25rem; }
.product-details-info h1 { font-size: 1.8rem; margin-bottom: .5rem; }
.product-pricing { margin: 1rem 0; font-size: 1.4rem; }
.product-specs { background: var(--bg); padding: 1rem; border-radius: var(--radius); margin: 1rem 0; font-size: .9rem; }
.product-specs div { padding: .25rem 0; }
.option-group { margin-bottom: 1rem; }
.option-group label { display: block; font-weight: 600; margin-bottom: .25rem; }
.option-group select { width: 100%; padding: .5rem; border: 1px solid var(--border); border-radius: var(--radius); }
.variation-selectors { margin-bottom: 1rem; }
.variation-group { display: flex; align-items: center; gap: .75rem; margin-bottom: .75rem; }
.variation-group label { min-width: 90px; font-size: .95rem; }
.variation-group select { flex: 1; max-width: 260px; padding: .45rem .6rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: .95rem; }
.qty-field { display: flex; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.qty-field input, .qty-field select { width: 80px; padding: .5rem; border: 1px solid var(--border); border-radius: var(--radius); }
.add-to-cart-form { margin-top: 1rem; }

.purchase-variations-form { border-top: 1px solid var(--border); padding-top: 1rem; }
.variation-purchase-list { display: flex; flex-wrap: wrap; gap: 1.25rem; margin-bottom: 1.25rem; }
.variation-purchase-row { flex: 1 1 240px; border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.variation-purchase-title { font-size: 1rem; margin: 0 0 .75rem; }
.variation-purchase-actions { text-align: center; }

@media (max-width: 700px) {
  .variation-purchase-list { flex-direction: column; }
  .variation-purchase-row { flex-basis: auto; }
}
.product-tabs { padding: 2rem 0; }
.tab-nav { display: flex; gap: .25rem; border-bottom: 2px solid var(--border); margin-bottom: 1.5rem; overflow-x: auto; }
.tab-btn {
  background: none; border: none; padding: .75rem 1.5rem; cursor: pointer;
  font-size: .95rem; font-family: inherit; color: var(--text-muted);
  border-bottom: 2px solid transparent; margin-bottom: -2px; white-space: nowrap;
  border-radius: var(--radius) var(--radius) 0 0;
  transition: color .15s, background .15s, border-color .15s;
}
.tab-btn:hover { color: var(--text); background: #f1f5f9; }
.tab-btn.active { border-bottom-color: var(--primary); color: var(--primary); font-weight: 600; }
.tab-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.tab-content { display: none; }
.tab-content.active { display: block; }
/* PRODUCT_TABS off — sections stack, each with its own heading */
.product-tabs.is-stacked .tab-content { display: block; margin-bottom: 2.5rem; }
.product-tabs.is-stacked .tab-content h2 { font-size: 1.3rem; margin-bottom: 1rem; padding-bottom: .4rem; border-bottom: 2px solid var(--border); }
.tab-content .short-description { font-weight: 500; margin-bottom: 1rem; }
.tab-content .short-description + * { margin-top: 0; }

/* Stock display — PRODUCT_DISPLAY_STOCK / _LOW_STOCK / _NO_STOCK */
.product-stock { margin: .5rem 0 .75rem; font-size: .9rem; font-weight: 600; }
.product-stock .stock-in { color: var(--success); }
.product-stock .stock-low { color: var(--warning); }
.product-stock .stock-out { color: var(--danger); }
.review { padding: 1rem 0; border-bottom: 1px solid var(--border); }
.review-header { display: flex; gap: 1rem; align-items: center; margin-bottom: .5rem; }
.rating { color: #f59e0b; }
.review-form { margin-top: 2rem; padding: 1.5rem; background: var(--bg); border-radius: var(--radius); }
.review-form h3 { margin-bottom: 1rem; }
.related-products { padding: 2rem 0; }
.related-products h2 { margin-bottom: 1rem; }
.product-specification { padding: 0 0 2rem; }
.product-specification h2 { margin-bottom: 1rem; }
.inquiry-intro { color: var(--text-muted); margin-bottom: 1rem; }
.product-tabs.is-stacked #tab-inquiry { padding: 1.5rem; background: var(--bg); border-radius: var(--radius); }
.inquiry-form { max-width: 520px; }
.inquiry-form .form-group { margin-bottom: 1rem; }
.inquiry-form label { display: block; margin-bottom: .35rem; font-weight: 600; }
.inquiry-form input, .inquiry-form textarea { width: 100%; padding: .6rem .75rem; border: 1px solid var(--border); border-radius: var(--radius); font: inherit; }
.inquiry-form textarea { resize: vertical; }
.spec-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.spec-table tr:nth-child(odd) { background: var(--bg); }
.spec-table td { padding: .65rem 1rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.spec-table .spec-label { width: 30%; font-weight: 600; color: var(--text-muted); }
.spec-table .spec-value p:first-child { margin-top: 0; }
.spec-table .spec-value p:last-child { margin-bottom: 0; }

/* Cart */
.cart-layout { display: grid; grid-template-columns: 1fr 320px; gap: 2rem; padding: 2rem 0; }
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th, .cart-table td { padding: .75rem; text-align: left; border-bottom: 1px solid var(--border); }
.cart-table th { background: var(--bg); }
.cart-product { display: flex; align-items: center; gap: 1rem; }
.cart-product img { width: 60px; height: 60px; object-fit: cover; border-radius: var(--radius); }
.cart-product input[type=number] { width: 70px; padding: .4rem; border: 1px solid var(--border); border-radius: var(--radius); }
.cart-summary { background: var(--white); padding: 1.5rem; border-radius: var(--radius); box-shadow: var(--shadow); align-self: start; }
.summary-row, .summary-total { display: flex; justify-content: space-between; margin-bottom: .75rem; }
.summary-total { font-size: 1.1rem; border-top: 2px solid var(--border); padding-top: .75rem; margin-top: .75rem; }
.empty-cart { text-align: center; padding: 4rem 0; }
/* Qty stepper (cart page + mini-cart) */
.qty-control { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.qty-btn { background: none; border: none; width: 32px; height: 32px; cursor: pointer; font-size: 1rem; color: var(--secondary); display: flex; align-items: center; justify-content: center; transition: background .1s; }
.qty-btn:hover { background: var(--bg); }
.qty-value { min-width: 36px; text-align: center; font-size: .9rem; font-weight: 500; padding: 0 .25rem; }
/* Coupon row */
.coupon-row { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border); }
/* cart-btn is styled in the Header section above */

/* Checkout */
.checkout-layout { display: grid; grid-template-columns: 1fr 340px; gap: 2rem; padding: 2rem 0; }
.checkout-section { background: var(--white); padding: 1.5rem; border-radius: var(--radius); margin-bottom: 1.5rem; box-shadow: var(--shadow); }
.checkout-section h2 { font-size: 1.1rem; margin-bottom: 1rem; border-bottom: 1px solid var(--border); padding-bottom: .5rem; }
.checkout-summary { background: var(--white); padding: 1.5rem; border-radius: var(--radius); box-shadow: var(--shadow); align-self: start; position: sticky; top: 80px; }
.checkout-summary h3 { margin-bottom: 1rem; }
.checkout-item { display: flex; justify-content: space-between; padding: .5rem 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.checkout-total { display: flex; justify-content: space-between; margin-top: 1rem; font-size: 1rem; }
/* Progress steps */
.checkout-steps { display: flex; align-items: center; gap: .5rem; padding: 1.25rem 0 .25rem; font-size: .85rem; }
.checkout-steps .step { color: var(--primary); font-weight: 600; }
.checkout-steps .step-sep { color: var(--text-muted); }
/* Payment options */
.payment-option { display: flex; align-items: flex-start; gap: 1rem; padding: 1rem; border: 2px solid var(--border); border-radius: var(--radius); cursor: pointer; margin-bottom: .75rem; transition: border-color .15s; }
.payment-option input { margin-top: .2rem; }
.payment-option.selected { border-color: var(--primary); background: #eff6ff; }
.payment-option-content { flex: 1; }
/* Shipping options */
.shipping-option { display: flex; align-items: center; gap: .75rem; padding: .85rem 1rem; border: 2px solid var(--border); border-radius: var(--radius); cursor: pointer; margin-bottom: .6rem; transition: border-color .15s; }
.shipping-option input { margin: 0; flex-shrink: 0; }
.shipping-option-name { flex: 1; }
.shipping-option-price { flex-shrink: 0; white-space: nowrap; margin-left: 1rem; }
.shipping-option.selected { border-color: var(--primary); background: #eff6ff; }
.payment-icons img { height: 24px; margin-right: .5rem; }
/* Card fields block */
.card-fields-wrap { background: var(--bg); border-radius: var(--radius); padding: 1rem; margin-top: .75rem; }
/* Test card notice */
.test-card-notice { background: #fef9c3; border: 1px solid #fde047; border-radius: 6px; padding: .6rem .9rem; font-size: .85rem; color: #713f12; margin-bottom: 1rem; }
/* Terms + submit */
.checkout-terms { margin: 1rem 0; display: flex; align-items: center; gap: .5rem; font-size: .9rem; cursor: pointer; }

/* User Account */
.account-layout { display: grid; grid-template-columns: 220px 1fr; gap: 2rem; padding: 2rem 0; }
.account-sidebar ul { list-style: none; }
.account-sidebar ul li { border-bottom: 1px solid var(--border); }
.account-sidebar ul li a { display: block; padding: .75rem; color: var(--text); }
.account-sidebar ul li a:hover, .account-sidebar ul li a.active { color: var(--primary); background: #eff6ff; text-decoration: none; }
.account-sidebar h3 { font-size: 1.1rem; margin-bottom: .75rem; }
.auth-form { max-width: 420px; margin: 3rem auto; background: var(--white); padding: 2rem; border-radius: var(--radius); box-shadow: var(--shadow); }
.auth-form h1 { margin-bottom: 1.5rem; }
.auth-links { margin-top: 1rem; text-align: center; font-size: .9rem; display: flex; flex-direction: column; gap: .5rem; }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: .25rem; font-weight: 500; font-size: .9rem; }
.form-group input[type=text],
.form-group input[type=email],
.form-group input[type=password],
.form-group input[type=number],
.form-group input[type=tel],
.form-group input[type=search],
.form-group select,
.form-group textarea { width: 100%; padding: .5rem .75rem; border: 1px solid var(--border); border-radius: var(--radius); font-size: .95rem; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }

/* Tables */
.orders-table { width: 100%; border-collapse: collapse; }
.orders-table th, .orders-table td { padding: .75rem; text-align: left; border-bottom: 1px solid var(--border); }
.orders-table th { background: var(--bg); font-size: .85rem; }

/* Breadcrumb */
.breadcrumb { padding: 1rem 0; font-size: .85rem; color: var(--text-muted); }
.breadcrumb a { color: var(--text-muted); }

/* Order Complete */
.order-complete { text-align: center; padding: 4rem 1rem; max-width: 600px; margin: 0 auto; }
.success-icon { font-size: 4rem; color: var(--success); }
.order-summary-box { background: var(--bg); padding: 1.5rem; border-radius: var(--radius); text-align: left; margin: 2rem 0; }
.order-item-row, .order-total-row { display: flex; justify-content: space-between; padding: .5rem 0; border-bottom: 1px solid var(--border); }
.next-steps { display: flex; gap: 1rem; justify-content: center; }

/* Modal */
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.modal-backdrop { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,.5); }
.modal-content { position: relative; z-index: 1; background: var(--white); border-radius: var(--radius); padding: 2rem; max-width: 900px; width: 95%; max-height: 90vh; overflow: auto; box-shadow: 0 25px 50px rgba(0,0,0,.25); }

/* Virtual Mirror */
.mirror-wrapper { display: grid; grid-template-columns: 1fr 340px; gap: 1.5rem; }
.face-container { position: relative; width: 100%; max-width: 400px; }
.face-container .face img { width: 100%; border-radius: var(--radius); }
.frame-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }
.frame-overlay img { width: 60%; position: absolute; top: 30%; left: 20%; }
.input-tabs { display: flex; margin-bottom: 1rem; border-bottom: 2px solid var(--border); }
.input-tab { background: none; border: none; padding: .5rem 1rem; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.input-tab.active { border-bottom-color: var(--primary); color: var(--primary); }
.input-panel { display: none; }
.input-panel.active { display: block; }
.sample-face-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: .25rem; }
.sample-face-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; cursor: pointer; border: 2px solid transparent; }
.sample-face-grid img:hover, .sample-face-grid img.active { border-color: var(--primary); }
.gender-toggle { display: flex; gap: .5rem; margin-bottom: .75rem; }
.gender-btn { padding: .25rem .75rem; border: 1px solid var(--border); border-radius: var(--radius); background: none; cursor: pointer; }
.gender-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.frame-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin-top: .75rem; }
.frame-grid img { width: 100%; border-radius: 4px; cursor: pointer; border: 2px solid transparent; background: var(--bg); }
.frame-grid img:hover, .frame-grid img.active { border-color: var(--primary); }

/* Static page */
.static-page { max-width: 780px; margin: 2rem auto; }
.static-page h1 { margin-bottom: 1rem; }
.page-lead { font-size: 1.05rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.page-body { line-height: 1.8; }
.page-body h2, .page-body h3 { margin: 1.5rem 0 .5rem; }
.page-body p { margin-bottom: 1rem; }
.page-body ul, .page-body ol { margin: .5rem 0 1rem 1.5rem; }
.page-body li { margin-bottom: .25rem; }
.page-body img { width: auto; max-width: 100%; height: auto; border-radius: var(--radius); margin: .75rem 0; }

/* Status badges */
.badge-success { background: #dcfce7; color: #166534; }
.badge-warning { background: #fef9c3; color: #854d0e; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-secondary { background: #f1f5f9; color: #475569; }

@media (max-width: 768px) {
  .category-layout, .product-detail, .cart-layout, .checkout-layout,
  .account-layout, .mirror-promo-content, .mirror-wrapper { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.8rem; }
  .header-top .container { flex-wrap: wrap; }
  .header-search { order: 3; flex-basis: 100%; }
}
