/*
Theme Name: LMX Deals (Blocksy Child)
Theme URI: https://lmxdeals.com
Author: LMX Deals
Author URI: https://lmxdeals.com
Template: blocksy
Description: Dark-themed Blocksy child theme for LMX Deals — flashlight affiliate site with product cards, coupon reveals, and scanner integration. Customizable homepage via Blocksy's Customizer.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.9.1
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: lmx-deals
Tags: dark, e-commerce, affiliate, flashlights, responsive, accessible
*/

/* =============================================
   LMX DEALS DESIGN SYSTEM — BLOCKSY CHILD
   ============================================= */

/* ── Override Blocksy CSS Variables ── */
:root {
  /* Core palette */
  --lmx-black: #0a0a0a;
  --lmx-dark: #111111;
  --lmx-dark-alt: #1a1a1a;
  --lmx-surface: #222222;
  --lmx-surface-hover: #2a2a2a;
  --lmx-border: #333333;
  --lmx-border-light: #444444;
  --lmx-muted: #999999;
  --lmx-text: #e0e0e0;
  --lmx-text-bright: #ffffff;
  --lmx-accent: #f0a500;
  --lmx-accent-hover: #ffb820;
  --lmx-accent-dim: rgba(240,165,0,0.12);
  --lmx-status-new: #22c55e;
  --lmx-status-deal: #f0a500;
  --lmx-status-expired: #ef4444;
  --lmx-status-pending: #8b8b8b;
  --lmx-font-display: 'Oswald', sans-serif;
  --lmx-font-body: 'Source Sans 3', 'Segoe UI', sans-serif;
  --lmx-font-mono: 'JetBrains Mono', monospace;
  --lmx-radius: 6px;
  --lmx-radius-lg: 12px;
  --lmx-ease: 0.25s cubic-bezier(0.4,0,0.2,1);
  --lmx-focus: 0 0 0 3px rgba(240,165,0,0.5);

  /* Blocksy overrides */
  --theme-palette-color-1: #f0a500;
  --theme-palette-color-2: #ffb820;
  --theme-palette-color-3: #e0e0e0;
  --theme-palette-color-4: #999999;
  --theme-palette-color-5: #222222;
  --theme-palette-color-6: #1a1a1a;
  --theme-palette-color-7: #111111;
  --theme-palette-color-8: #0a0a0a;
  --theme-text-initial-color: var(--lmx-text);
  --theme-headings-color: var(--lmx-text-bright);
  --theme-link-initial-color: var(--lmx-accent);
  --theme-link-hover-color: var(--lmx-accent-hover);
  --theme-button-background-initial-color: var(--lmx-accent);
  --theme-button-background-hover-color: var(--lmx-accent-hover);
  --theme-button-text-initial-color: #0a0a0a;
  --theme-button-text-hover-color: #0a0a0a;
  --theme-form-field-background-initial-color: var(--lmx-surface);
  --theme-form-field-border-initial-color: var(--lmx-border);
  --theme-border-color: var(--lmx-border);
}

/* ── Global Dark Mode ── */
body, .ct-container, [data-header] {
  background: var(--lmx-black);
  color: var(--lmx-text);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--lmx-font-display);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--lmx-text-bright);
}

/* ── Header Dark Styling ── */
[data-header] {
  background: rgba(10,10,10,0.92) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--lmx-border);
}
[data-header] .ct-container { background: transparent; }
header [data-id="menu"] a {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.875rem;
}

/* ── Footer Dark ── */
footer[data-footer], .site-footer {
  background: var(--lmx-dark) !important;
  color: var(--lmx-muted);
  border-top: 1px solid var(--lmx-border);
}

/* ── Buttons ── */
.btn, .wp-block-button__link, .ct-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-family: var(--lmx-font-display);
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: var(--lmx-radius);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--lmx-ease);
  border: 2px solid transparent;
  line-height: 1.3;
}
.btn-primary, .wp-block-button:not(.is-style-outline) .wp-block-button__link {
  background: var(--lmx-accent);
  color: var(--lmx-black);
}
.btn-primary:hover, .wp-block-button:not(.is-style-outline) .wp-block-button__link:hover {
  background: var(--lmx-accent-hover);
  color: var(--lmx-black);
  transform: translateY(-1px);
}
.btn-outline, .wp-block-button.is-style-outline .wp-block-button__link {
  background: transparent;
  color: var(--lmx-text-bright);
  border-color: var(--lmx-border-light);
}
.btn-outline:hover, .wp-block-button.is-style-outline .wp-block-button__link:hover {
  border-color: var(--lmx-accent);
  color: var(--lmx-accent);
}
.btn-sm { padding: 0.5rem 1rem; font-size: 0.8rem; }

/* =============================================
   PRODUCT CARD COMPONENT
   ============================================= */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}
@media(min-width: 1024px) { .product-grid { grid-template-columns: repeat(4, 1fr); } }

.product-card {
  background: var(--lmx-surface);
  border: 1px solid var(--lmx-border);
  border-radius: var(--lmx-radius-lg);
  overflow: hidden;
  position: relative;
  transition: all var(--lmx-ease);
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  border-color: var(--lmx-border-light);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}

/* Status badge */
.product-status {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 2;
  padding: 0.2rem 0.6rem;
  font-family: var(--lmx-font-display);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 4px;
  line-height: 1.4;
}
.product-status--new { background: var(--lmx-status-new); color: #fff; }
.product-status--deal { background: var(--lmx-status-deal); color: var(--lmx-black); }
.product-status--expired { background: var(--lmx-status-expired); color: #fff; }
.product-status--pending { background: var(--lmx-status-pending); color: #fff; }

/* Card image */
.product-card-image {
  aspect-ratio: 4/3;
  background: #fff !important;
  overflow: hidden;
  position: relative;
}
.product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: contain !important;
  transition: transform 0.4s ease;
}
.product-card:hover .product-card-image img { transform: scale(1.05); }

/* Card body */
.product-card-body {
  padding: 1rem 1.25rem 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.product-brand {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--lmx-muted);
  margin-bottom: 0.25rem;
}
.brand-olight { color: var(--lmx-accent); }
.brand-sofirn { color: #00b4d8; }
.brand-wurkkos { color: #c084fc; }
.brand-acebeam { color: #fb923c; }
.brand-wuben { color: #34d399; }

.product-card-title {
  font-size: 1rem;
  line-height: 1.3;
  margin-bottom: 0.5rem;
  text-transform: none;
  font-family: var(--lmx-font-body);
  font-weight: 700;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-card-title a { color: var(--lmx-text-bright); }
.product-card-title a:hover { color: var(--lmx-accent); }

/* Specs */
.product-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}
.product-spec {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.5rem;
  background: var(--lmx-dark-alt);
  border: 1px solid var(--lmx-border);
  border-radius: 4px;
  font-size: 0.75rem;
  color: var(--lmx-muted);
  white-space: nowrap;
}
.product-spec svg { width: 12px; height: 12px; flex-shrink: 0; }

/* Pricing */
.product-pricing {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  margin-top: auto;
}
.product-price {
  font-family: var(--lmx-font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--lmx-text-bright);
}
.product-price-original {
  font-size: 0.9rem;
  color: var(--lmx-muted);
  text-decoration: line-through;
}
.product-discount {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--lmx-status-deal);
  background: var(--lmx-accent-dim);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
}

/* Coupon chip */
.coupon-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.7rem;
  background: var(--lmx-accent-dim);
  border: 1px dashed var(--lmx-accent);
  border-radius: 4px;
  font-family: var(--lmx-font-mono);
  font-size: 0.75rem;
  color: var(--lmx-accent);
  cursor: pointer;
  transition: all var(--lmx-ease);
  margin-bottom: 0.75rem;
  white-space: nowrap;
}
.coupon-chip:hover { background: rgba(240,165,0,0.2); }
.coupon-chip--revealed { border-style: solid; background: rgba(34,197,94,0.1); border-color: #22c55e; color: #22c55e; }
.coupon-chip svg { flex-shrink: 0; }
.coupon-chip-label { font-family: var(--lmx-font-body); font-weight: 600; }

.btn-buy {
  width: 100%;
  justify-content: center;
  margin-top: auto;
}

/* Placeholder */
.placeholder-img {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--lmx-border-light);
}
.placeholder-img svg { width: 48px; height: 48px; opacity: 0.3; }

/* =============================================
   SINGLE PRODUCT PAGE
   ============================================= */
.single-product-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  padding: 2rem 0 4rem;
}
@media (max-width: 768px) {
  .single-product-layout { grid-template-columns: 1fr; gap: 1.5rem; }
}
.single-product-image {
  background: var(--lmx-dark-alt);
  border-radius: var(--lmx-radius-lg);
  overflow: hidden;
  aspect-ratio: 1;
}
.single-product-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.single-product-specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 1.5rem 0;
}
.spec-item {
  padding: 0.75rem;
  background: var(--lmx-dark-alt);
  border: 1px solid var(--lmx-border);
  border-radius: var(--lmx-radius);
}
.spec-item-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--lmx-muted);
  margin-bottom: 0.25rem;
}
.spec-item-value {
  font-weight: 700;
  color: var(--lmx-text-bright);
}

/* Buy button */
.btn-buy-main {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  font-size: 1rem;
  margin-top: 1rem;
}

/* Coupon box */
.coupon-box {
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: var(--lmx-accent-dim);
  border: 1px dashed var(--lmx-accent);
  border-radius: var(--lmx-radius-lg);
}
.coupon-box-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  color: var(--lmx-accent);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}
.coupon-code-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.coupon-code {
  font-family: var(--lmx-font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  padding: 0.5rem 1rem;
  background: var(--lmx-surface);
  border: 1px solid var(--lmx-border);
  border-radius: var(--lmx-radius);
  letter-spacing: 0.15em;
  color: var(--lmx-text-bright);
}
.coupon-hint {
  font-size: 0.8rem;
  color: var(--lmx-muted);
  margin-top: 0.5rem;
  margin-bottom: 0;
}
.coupon-reveal-btn {
  white-space: nowrap;
}

/* =============================================
   ARCHIVE / FILTER LAYOUT
   ============================================= */
.archive-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--lmx-border);
  margin-bottom: 1.5rem;
}
.archive-toolbar-left { display: flex; align-items: baseline; gap: 1rem; }
.archive-title { font-size: 1.5rem; margin: 0; }
.result-count { font-size: 0.85rem; color: var(--lmx-muted); }
.archive-toolbar-right { display: flex; align-items: center; gap: 0.75rem; }

.sort-select, .filter-toggle-btn {
  padding: 0.5rem 1rem;
  background: var(--lmx-surface);
  border: 1px solid var(--lmx-border);
  border-radius: var(--lmx-radius);
  color: var(--lmx-text);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--lmx-ease);
}
.sort-select:hover, .filter-toggle-btn:hover { border-color: var(--lmx-accent); }
.sort-select option { background: var(--lmx-surface); }

.filter-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}
.filter-count-badge {
  background: var(--lmx-accent);
  color: var(--lmx-black);
  font-size: 0.7rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Filter drawer */
.filter-drawer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
  border-bottom: 1px solid transparent;
}
.filter-drawer.is-open {
  max-height: 800px;
  border-bottom-color: var(--lmx-border);
  padding-bottom: 1.5rem;
}
.filter-groups {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
  padding-top: 1.5rem;
}
.filter-group h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--lmx-muted);
  margin-bottom: 0.75rem;
}
.filter-checks { display: flex; flex-direction: column; gap: 0.4rem; }
.filter-checks label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--lmx-text);
  transition: color var(--lmx-ease);
}
.filter-checks label:hover { color: var(--lmx-text-bright); }
.filter-checks input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--lmx-accent);
}

/* Active filter pills */
.active-filters {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.75rem 0;
}
.active-filters-list { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.6rem;
  background: var(--lmx-accent-dim);
  border: 1px solid var(--lmx-accent);
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--lmx-accent);
  cursor: pointer;
  transition: all var(--lmx-ease);
}
.filter-pill:hover { background: rgba(240,165,0,0.2); }
.active-filters-clear {
  font-size: 0.75rem;
  color: var(--lmx-muted);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
}

/* Breadcrumbs */
.breadcrumbs {
  padding: 1rem 0;
  font-size: 0.8rem;
  color: var(--lmx-muted);
}
.breadcrumbs a { color: var(--lmx-muted); }
.breadcrumbs a:hover { color: var(--lmx-accent); }
.breadcrumbs .separator { margin: 0 0.4rem; }

/* Pagination */
.lmx-pagination {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  padding: 2rem 0;
}
.lmx-pagination button {
  padding: 0.5rem 0.9rem;
  background: var(--lmx-surface);
  border: 1px solid var(--lmx-border);
  border-radius: var(--lmx-radius);
  color: var(--lmx-text);
  cursor: pointer;
  transition: all var(--lmx-ease);
}
.lmx-pagination button:hover { border-color: var(--lmx-accent); color: var(--lmx-accent); }
.lmx-pagination button.active { background: var(--lmx-accent); color: var(--lmx-black); border-color: var(--lmx-accent); }
.lmx-pagination button:disabled { opacity: 0.4; cursor: not-allowed; }

/* =============================================
   HERO SECTION (for homepage)
   ============================================= */
.lmx-hero {
  padding: 6rem 0 4rem;
  text-align: center;
  background: radial-gradient(ellipse at top, rgba(240,165,0,0.08), transparent 70%);
}
.lmx-hero .hero-tagline {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--lmx-accent);
  padding: 0.4rem 1rem;
  border: 1px solid var(--lmx-accent);
  border-radius: 20px;
  margin-bottom: 1.5rem;
}
.lmx-hero h1 { margin-bottom: 1rem; }
.lmx-hero .accent { color: var(--lmx-accent); }
.lmx-hero p { color: var(--lmx-muted); max-width: 600px; margin: 0 auto 2rem; font-size: 1.1rem; }
.lmx-hero .hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* =============================================
   BRAND ROW SECTION [lmx_brand_row]
   ============================================= */
.lmx-brand-row {
  padding: 3rem 0;
  border-bottom: 1px solid var(--lmx-border);
}
.lmx-brand-row--dark {
  background: var(--lmx-dark-alt);
}
.lmx-brand-row__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.lmx-brand-row__eyebrow {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--lmx-accent);
  margin-bottom: 0.25rem;
}
.lmx-brand-row__title {
  font-family: var(--lmx-font-display) !important;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--lmx-text-bright) !important;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 0;
}
.lmx-brand-row__header .btn {
  flex-shrink: 0;
  white-space: nowrap;
}
.lmx-brand-row__grid {
  gap: 1.25rem !important;
}
/* Responsive: stack on smaller screens */
@media (max-width: 1024px) {
  .lmx-brand-row__grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)) !important;
  }
}
@media (max-width: 600px) {
  .lmx-brand-row__grid {
    grid-template-columns: 1fr 1fr !important;
  }
  .lmx-brand-row__header {
    flex-direction: column;
    align-items: flex-start;
  }
  .lmx-brand-row__title {
    font-size: 1.25rem;
  }
}

/* =============================================
   PRODUCTS SECTION
   ============================================= */
.products-section {
  padding: 4rem 0;
}
.products-section .section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}
.products-section .section-header a {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* No products */
.no-products {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--lmx-muted);
  grid-column: 1 / -1;
}
.no-products svg { margin: 0 auto 1rem; opacity: 0.3; }
.no-products p { margin-bottom: 1rem; }

/* =============================================
   BLOCKSY-SPECIFIC OVERRIDES
   ============================================= */
/* Ensure Blocksy containers use our dark bg */
.ct-container, .ct-container-narrow { color: var(--lmx-text); }
.entry-content { color: var(--lmx-text); }
.entry-content h1, .entry-content h2, .entry-content h3,
.entry-content h4, .entry-content h5, .entry-content h6 {
  color: var(--lmx-text-bright);
}

/* Blocksy archive entries — use product card styling */
.entry-card { background: var(--lmx-surface); border: 1px solid var(--lmx-border); border-radius: var(--lmx-radius-lg); }

/* Widget areas */
.ct-sidebar { color: var(--lmx-text); }
.ct-widget { background: var(--lmx-surface); border: 1px solid var(--lmx-border); border-radius: var(--lmx-radius); padding: 1.25rem; }

/* WP Block styles in dark mode */
.wp-block-group, .wp-block-cover { color: var(--lmx-text); }
.wp-block-separator { border-color: var(--lmx-border); }
.wp-block-quote { border-left-color: var(--lmx-accent); color: var(--lmx-text); }

/* Loading spinner */
.lmx-loading { display:flex; justify-content:center; padding:3rem; grid-column:1/-1; }
.lmx-spinner { width:40px; height:40px; border:3px solid var(--lmx-border); border-top-color:var(--lmx-accent); border-radius:50%; animation:lmx-spin 0.8s linear infinite; }
@keyframes lmx-spin { to { transform:rotate(360deg); } }
