/* Bulkstock2 (Bramleigh-style) — shared storefront + admin stylesheet.
   Theming: body carries theme-<preset> mode-<light|dark> accent-<key> classes; CSS variables
   below resolve the actual colours used everywhere else in this file. */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-family: 'Barlow Condensed', Inter, sans-serif; font-weight: 700; margin: 0 0 .4em; letter-spacing: .2px; }
p { line-height: 1.55; }

/* ---------- theme variable resolution ---------- */
body.theme-nexaweb {
  --bg: radial-gradient(1200px 600px at 15% -10%, rgba(124,58,237,.35), transparent 60%), radial-gradient(900px 500px at 110% 10%, rgba(124,58,237,.18), transparent 55%), #0c0815;
  --bg-solid: #0c0815;
  --bg-elevated: #17101f;
  --bg-elevated-2: #1d1628;
  --text: #f4f1fb;
  --muted: #ab9fc9;
  --border: rgba(255,255,255,.09);
}
body.theme-classic.mode-light {
  --bg: #faf7f2; --bg-solid:#faf7f2; --bg-elevated: #ffffff; --bg-elevated-2: #f2ede4;
  --text: #221e19; --muted: #756c5e; --border: #e7ded0;
}
body.theme-classic.mode-dark {
  --bg: #15110c; --bg-solid:#15110c; --bg-elevated: #1f1912; --bg-elevated-2: #271f16;
  --text: #f6efe3; --muted: #bcae97; --border: #362c1e;
}
body.accent-bright_red { --accent: #e5484d; --accent-text: #fff; }
body.accent-deep_gold { --accent: #c8932a; --accent-text: #201804; }
body.accent-burgundy { --accent: #7a2331; --accent-text: #fff; }
body.accent-warm_yellow { --accent: #e0b120; --accent-text: #211a02; }
body.accent-charcoal { --accent: #3a3a40; --accent-text: #fff; }
body.accent-electric_purple { --accent: #7c3aed; --accent-text: #fff; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 24px; }

/* ---------- announcement strip ---------- */
.strip { background: var(--bg-elevated-2); border-bottom: 1px solid var(--border); overflow: hidden; white-space: nowrap; }
.strip-track { display: inline-block; padding: 9px 0; animation: bs2-scroll 26s linear infinite; font-size: 13px; color: var(--muted); }
.strip-track span { margin: 0 28px; }
@keyframes bs2-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- header ---------- */
.site-header { border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 40; background: var(--bg-solid); }
.site-header-in { max-width: 1240px; margin: 0 auto; padding: 18px 24px; display: flex; align-items: center; gap: 28px; }
.logo { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 22px; }
.main-nav { display: flex; gap: 22px; flex: 1; }
.main-nav a { color: var(--text); font-size: 15px; opacity: .88; }
.main-nav a:hover { opacity: 1; color: var(--accent); }
.head-actions { display: flex; align-items: center; gap: 20px; font-size: 14px; }
.head-actions a { display: inline-flex; align-items: center; gap: 6px; color: var(--text); opacity: .9; }
.search-box { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 999px; padding: 9px 16px; color: var(--muted); font-size: 14px; display: flex; align-items: center; gap: 8px; min-width: 220px; }
.search-box input { background: transparent; border: 0; outline: 0; color: var(--text); font-size: 14px; width: 100%; }
.cart-badge { position: relative; }
.cart-badge .count { position: absolute; top: -8px; right: -10px; background: var(--accent); color: var(--accent-text); font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 6px; }
.menu-btn { display: none; background: none; border: 0; color: var(--text); font-size: 22px; cursor: pointer; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 22px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-elevated); color: var(--text); font-size: 14px; font-weight: 600; cursor: pointer; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.block { width: 100%; }
.btn.sm { padding: 7px 14px; font-size: 13px; }
.btn.secondary { background: transparent; }
.btn.danger { background: #c0392b; color: #fff; border-color: #c0392b; }
.btn.wa { background: #1fa855; color: #fff; border-color: #1fa855; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- hero ---------- */
.hero { padding: 70px 0 50px; }
.hero .eyebrow { color: var(--accent); font-weight: 700; letter-spacing: 1px; text-transform: uppercase; font-size: 13px; }
.hero h1 { font-size: 52px; line-height: 1.05; max-width: 720px; }
.hero p.lead { color: var(--muted); font-size: 17px; max-width: 560px; margin-bottom: 26px; }
.hero-actions { display: flex; gap: 14px; }
.promo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 46px; }
.promo-card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 16px; padding: 26px; }
.promo-card h3 { font-size: 22px; margin-bottom: 6px; }
.promo-card p { color: var(--muted); margin: 0; font-size: 14px; }
.trust-strip { display: flex; gap: 30px; flex-wrap: wrap; margin-top: 40px; color: var(--muted); font-size: 13px; }
.trust-strip span { display: flex; align-items: center; gap: 8px; }

.cat-nav { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 40px 0; }
.cat-card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 14px; padding: 22px; text-align: center; font-weight: 600; }
.cat-card:hover { border-color: var(--accent); }

/* ---------- product grid ---------- */
.section-head { display: flex; align-items: center; justify-content: space-between; margin: 46px 0 20px; }
.products-page { display: grid; grid-template-columns: 250px 1fr; gap: 32px; padding: 30px 0 60px; align-items: start; }
.filters { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 14px; padding: 20px; position: sticky; top: 90px; }
.filters h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin: 18px 0 10px; }
.filters h4:first-child { margin-top: 0; }
.filters label { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 8px 0; cursor: pointer; }
.filters input[type=text], .filters input[type=number] { width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; color: var(--text); }
.price-range { display: flex; gap: 8px; align-items: center; }
.results-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.select-sort { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 10px; padding: 9px 14px; color: var(--text); }

.grid-products { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.product-card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; position: relative; }
.product-card .thumb { aspect-ratio: 1/1; background: linear-gradient(160deg, var(--bg-elevated-2), var(--bg-elevated)); display: flex; align-items: center; justify-content: center; font-size: 46px; color: var(--muted); font-weight: 700; }
.product-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-card .body { padding: 16px; }
.product-card .brand { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.product-card .name { font-weight: 700; margin: 4px 0 6px; font-size: 15px; }
.product-card .price { font-weight: 700; }
.product-card .price .was { color: var(--muted); text-decoration: line-through; font-weight: 400; margin-left: 6px; font-size: 13px; }
.discount-badge { position: absolute; top: 12px; left: 12px; background: #e5484d; color: #fff; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.rating { color: var(--accent); font-size: 12px; }
.empty { color: var(--muted); padding: 30px 0; }

/* ---------- product detail ---------- */
.pdp { display: grid; grid-template-columns: 1fr 1fr; gap: 46px; padding: 30px 0 60px; }
.pdp-gallery-main { aspect-ratio: 1/1; background: linear-gradient(160deg, var(--bg-elevated-2), var(--bg-elevated)); border-radius: 18px; display: flex; align-items: center; justify-content: center; font-size: 90px; color: var(--muted); font-weight: 700; }
.breadcrumb { color: var(--muted); font-size: 13px; margin: 22px 0 16px; }
.breadcrumb a:hover { color: var(--accent); }
.pdp-brand { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .6px; }
.pdp h1 { font-size: 30px; margin: 6px 0 10px; }
.pdp-price { font-size: 26px; font-weight: 700; margin: 14px 0; }
.pdp-price .was { color: var(--muted); text-decoration: line-through; font-weight: 400; font-size: 18px; margin-left: 8px; }
.option-group { display: flex; gap: 10px; flex-wrap: wrap; margin: 8px 0 18px; }
.option-pill { border: 1px solid var(--border); border-radius: 999px; padding: 9px 18px; cursor: pointer; font-size: 14px; }
.option-pill.active { border-color: var(--accent); color: var(--accent); }
.stock-line.in { color: #35b568; font-size: 14px; font-weight: 600; }
.stock-line.out { color: #e5484d; font-size: 14px; font-weight: 600; }
.qty-stepper { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 999px; }
.qty-stepper button { background: none; border: 0; color: var(--text); width: 38px; height: 38px; font-size: 18px; cursor: pointer; }
.qty-stepper input { width: 42px; background: none; border: 0; color: var(--text); text-align: center; font-weight: 700; }
.pdp-actions { display: flex; gap: 12px; margin: 18px 0; }
.pdp-actions .btn.primary { flex: 1; }
.tags { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.tag { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px; font-size: 12px; color: var(--muted); }
.review-item { border-top: 1px solid var(--border); padding: 16px 0; }
.review-item .who { font-weight: 700; }

/* ---------- cart / checkout ---------- */
.checkout-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; padding: 30px 0 60px; align-items: start; }
.field-label { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin-bottom: 6px; margin-top: 18px; }
.field-label:first-child { margin-top: 0; }
.input, select.input, textarea.input {
  width: 100%; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; color: var(--text); font-size: 14px; font-family: inherit;
}
textarea.input { resize: vertical; min-height: 70px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.summary-card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 16px; padding: 24px; }
.pay-icons { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.pay-icons span { background: #fff; color: #111; font-size: 11px; font-weight: 700; padding: 5px 8px; border-radius: 5px; border: 1px solid #ddd; }
.summary-line { display: flex; justify-content: space-between; padding: 8px 0; font-size: 14px; color: var(--muted); }
.summary-line.total { color: var(--text); font-weight: 700; font-size: 16px; border-top: 1px solid var(--border); margin-top: 8px; padding-top: 14px; }
.pay-option { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin-bottom: 10px; cursor: pointer; }
.pay-option.disabled { opacity: .45; cursor: not-allowed; }
.notice { background: rgba(229,72,77,.12); border: 1px solid rgba(229,72,77,.4); color: #e5484d; padding: 10px 14px; border-radius: 10px; font-size: 13px; margin: 10px 0; }
.notice.good { background: rgba(53,181,104,.12); border-color: rgba(53,181,104,.4); color: #35b568; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 50px 0 24px; margin-top: 60px; color: var(--muted); font-size: 14px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 30px; margin-bottom: 30px; }
.footer-grid h4 { color: var(--text); font-size: 13px; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 14px; }
.footer-grid a { display: block; margin-bottom: 8px; }
.footer-grid a:hover { color: var(--accent); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--border); padding-top: 20px; flex-wrap: wrap; gap: 12px; }
.pay-icons-footer { display: flex; gap: 6px; flex-wrap: wrap; }

.wa-float { position: fixed; bottom: 22px; left: 22px; width: 52px; height: 52px; border-radius: 999px; background: #25d366; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 24px; z-index: 50; box-shadow: 0 6px 18px rgba(0,0,0,.3); }

/* ---------- generic content pages / auth ---------- */
.narrow { max-width: 640px; margin: 50px auto; }
.card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 16px; padding: 30px; }

/* =========================================================================================
   ADMIN
   ========================================================================================= */
body.admin-body { --bg: #0c0a12; --bg-solid:#0c0a12; --bg-elevated: #15121e; --bg-elevated-2: #1b1727; --text: #f1eefb; --muted: #a79fc4; --border: rgba(255,255,255,.09); --accent: #7c3aed; --accent-text: #fff; }
.admin-shell { display: flex; min-height: 100vh; }
.admin-sidebar { width: 230px; background: var(--bg-elevated); border-right: 1px solid var(--border); padding: 20px 14px; flex-shrink: 0; }
.admin-sidebar .brand { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 20px; padding: 6px 10px 2px; }
.admin-sidebar .sub { color: var(--muted); font-size: 12px; padding: 0 10px 18px; }
.admin-nav a { display: block; padding: 10px 12px; border-radius: 10px; color: var(--text); font-size: 14px; margin-bottom: 2px; opacity: .85; }
.admin-nav a:hover { background: var(--bg-elevated-2); opacity: 1; }
.admin-nav a.active { background: var(--accent); color: var(--accent-text); opacity: 1; }
.admin-nav .divider { height: 1px; background: var(--border); margin: 14px 6px; }
.admin-main { flex: 1; padding: 32px 40px; max-width: 1100px; }
.admin-topbar { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; }
.admin-topbar h1 { font-size: 26px; margin-bottom: 4px; }
.admin-topbar .sub { color: var(--muted); font-size: 14px; }

.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 30px; }
.stat-card { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 14px; padding: 20px; display: flex; justify-content: space-between; align-items: center; }
.stat-card .label { color: var(--muted); font-size: 14px; margin-bottom: 6px; }
.stat-card .value { font-size: 22px; font-weight: 700; }
.stat-card .amt { font-size: 20px; font-weight: 700; }

table.table { width: 100%; border-collapse: collapse; }
table.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--border); }
table.table td { padding: 12px; border-bottom: 1px solid var(--border); font-size: 14px; }
.table-wrap { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.table-wrap table.table th, .table-wrap table.table td { border-color: var(--border); }

.badge { display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.good { background: rgba(53,181,104,.15); color: #35b568; }
.badge.warn { background: rgba(224,177,32,.18); color: #e0b120; }
.badge.bad { background: rgba(229,72,77,.15); color: #e5484d; }
.badge.grey { background: rgba(255,255,255,.08); color: var(--muted); }
.badge.info { background: rgba(124,58,237,.18); color: #a685f5; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.form-grid input, .form-grid select, .form-grid textarea {
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; color: var(--text); font-family: inherit; font-size: 14px;
}
.form-grid textarea { min-height: 80px; resize: vertical; }
.row { display: flex; align-items: center; gap: 10px; }
.small { font-size: 13px; }
.muted { color: var(--muted); }

.panel { background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 16px; padding: 24px; margin-bottom: 24px; }
.panel h3 { margin-bottom: 6px; }
.panel .desc { color: var(--muted); font-size: 13px; margin-bottom: 18px; }

.swatch-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 14px 0 20px; }
.swatch-card { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.swatch-card.selected { border-color: var(--accent); background: rgba(124,58,237,.08); }
.swatch-dot { width: 18px; height: 18px; border-radius: 999px; flex-shrink: 0; }

.theme-preview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 14px 0 20px; }
.theme-preview { border: 2px solid var(--border); border-radius: 12px; padding: 16px; cursor: pointer; }
.theme-preview.selected { border-color: var(--accent); }
.theme-preview .mini { height: 60px; border-radius: 8px; margin-bottom: 12px; }
.toggle { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle .slider { position: absolute; inset: 0; background: var(--border); border-radius: 999px; transition: .2s; }
.toggle .slider:before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 999px; transition: .2s; }
.toggle input:checked + .slider { background: var(--accent); }
.toggle input:checked + .slider:before { transform: translateX(20px); }

.look-row { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr auto; gap: 10px; align-items: center; margin-bottom: 10px; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 10px; }
.icon-btn { background: none; border: 0; color: #e5484d; cursor: pointer; font-size: 16px; }

.login-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); }
.login-card { width: 380px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 18px; padding: 34px; }
.login-card h1 { font-size: 22px; text-align: center; margin-bottom: 22px; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .main-nav, .search-box { display: none; }
  .menu-btn { display: block; }
  .hero h1 { font-size: 36px; }
  .promo-grid, .cat-nav, .checkout-grid, .pdp, .products-page, .footer-grid, .form-grid, .stat-grid, .theme-preview-grid, .swatch-grid { grid-template-columns: 1fr; }
  .grid-products { grid-template-columns: repeat(2, 1fr); }
  .admin-shell { flex-direction: column; }
  .admin-sidebar { width: 100%; }
  .admin-main { padding: 22px; }
}
