/* ============================================================
   AFX Products list (dark brand theme — full-bleed, image-led)
   ============================================================ */

.afx-products {
    --afx-bg:           rgb(34, 38, 37);
    --afx-bg-deep:      rgb(20, 22, 22);
    --afx-surface:      rgb(28, 32, 31);
    --afx-surface-2:    rgb(40, 44, 43);
    --afx-fg:           #ffffff;
    --afx-muted:        #b0b0b0;
    --afx-dim:          #6a6a6a;
    --afx-border:       rgb(48, 52, 51);
    --afx-border-strong:rgb(72, 76, 75);
    --afx-accent:       #2FE6FF;
    --afx-accent-fg:    rgb(20, 22, 22);
    --afx-radius:       2px;
    --afx-header-offset: 80px;  /* theme header overlays content — push first row below it */

    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--afx-fg);
    background: var(--afx-bg);

    /* Break out of any theme container — go full viewport width */
    position: relative;
    width: 100vw;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    padding: 0;
}
.afx-products *,
.afx-products *::before,
.afx-products *::after { box-sizing: border-box; }

/* Suppress the theme's page title chrome + any banner / divider strips above our content */
body.afx-products-page .entry-header,
body.afx-products-page .page-header,
body.afx-products-page .ast-page-header,
body.afx-products-page .ast-archive-description,
body.afx-products-page .entry-banner-wrap,
body.afx-products-page .site-content-banner,
body.afx-products-page .ast-banner-wrap,
body.afx-products-page .entry-title { display: none !important; }
body.afx-products-page .entry-content,
body.afx-products-page .ast-container,
body.afx-products-page #content,
body.afx-products-page .site-content,
body.afx-products-page .site-content > .container,
body.afx-products-page #primary,
body.afx-products-page #primary > article,
body.afx-products-page .ast-no-sidebar .entry-content { max-width: none !important; padding: 0 !important; margin: 0 !important; background: rgb(34, 38, 37) !important; }
body.afx-products-page { background: rgb(34, 38, 37) !important; }

/* Make the theme header match the dark page bg so there's no visible grey strip
   between the staging banner and the catalogue */
body.afx-products-page #masthead,
body.afx-products-page .site-header,
body.afx-products-page header.site-header,
body.afx-products-page .ast-above-header,
body.afx-products-page .ast-above-header-bar,
body.afx-products-page .main-header-bar,
body.afx-products-page .ast-primary-header,
body.afx-products-page .ast-primary-header-bar,
body.afx-products-page .ast-header-break-point .main-header-bar,
body.afx-products-page .ast-below-header,
body.afx-products-page .ast-below-header-bar { background-color: rgb(34, 38, 37) !important; background: rgb(34, 38, 37) !important; }

/* Astra's "Boxed Container" layout (ast-separate-container) paints a grey
   background on .ast-article-single, .site-content etc. via --ast-global-color-5.
   Override on the products page so the layout reads as one continuous dark surface. */
body.afx-products-page.ast-separate-container,
body.afx-products-page .ast-separate-container,
body.afx-products-page .ast-separate-container .ast-article-single,
body.afx-products-page .ast-separate-container .site-content,
body.afx-products-page .ast-separate-container .site-main,
body.afx-products-page .ast-separate-container .entry-content,
body.afx-products-page .ast-article-single { background-color: rgb(34, 38, 37) !important; background-image: none !important; }

/* ---------- Hero band (compact) ---------- */
.afx-list-headerband {
    background: var(--afx-bg);
    border-bottom: 1px solid var(--afx-border);
    padding: calc(var(--afx-header-offset) + 12px) 0 28px;
    position: relative;
    overflow: hidden;
}
.afx-list-headerband-inner {
    width: 100%;
    max-width: 1680px;
    margin: 0 auto;
    padding: 0 64px;
    position: relative;
}
.afx-list-pretitle {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 18px;
    font-style: italic;
    color: var(--afx-fg);
    margin: 0 0 10px;
}
.afx-list-title {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 48px;
    line-height: 1;
    font-weight: 400;
    margin: 0 0 10px;
    color: var(--afx-fg);
    letter-spacing: -0.5px;
}
.afx-list-subtitle {
    font-size: 13px;
    color: var(--afx-muted);
    margin: 0;
    letter-spacing: 0.5px;
}

/* ---------- Search (in filter sidebar) ---------- */
.afx-search {
    font: inherit;
    font-size: 13px;
    padding: 12px 14px;
    border: 1px solid var(--afx-border-strong);
    border-radius: var(--afx-radius);
    background: var(--afx-surface);
    color: var(--afx-fg);
    width: 100%;
    margin-bottom: 16px;
}
.afx-search::placeholder { color: var(--afx-dim); }
.afx-search:focus { outline: 1px solid var(--afx-accent); border-color: var(--afx-accent); }

/* Filter toggle for mobile (sits above the grid) */
.afx-toggle-filters {
    display: none;
    font: inherit;
    font-size: 12px;
    padding: 10px 16px;
    border: 1px solid var(--afx-border-strong);
    border-radius: var(--afx-radius);
    background: transparent;
    color: var(--afx-fg);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

/* ---------- Layout ---------- */
.afx-layout {
    width: 100%;
    max-width: 1680px;
    margin: 0 auto;
    padding: 48px 64px 96px;
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 64px;
    align-items: start;
}

/* ---------- Filter rail (refined, text-led) ---------- */
.afx-filters {
    position: sticky;
    top: 24px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    /* breathing room between content and scrollbar */
    padding-right: 18px;
}
.afx-filters::-webkit-scrollbar { width: 4px; }
.afx-filters::-webkit-scrollbar-thumb { background: var(--afx-border-strong); border-radius: 2px; }

.afx-filters-inner { display: flex; flex-direction: column; }
.afx-filters-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding-bottom: 14px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--afx-border);
}
.afx-filters-title {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 22px;
    font-weight: 400;
    margin: 0;
    color: var(--afx-fg);
}
.afx-clear {
    background: transparent;
    border: none;
    font: inherit;
    font-size: 11px;
    color: var(--afx-accent);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.afx-clear:hover { color: var(--afx-fg); }

/* ---------- Filter skeleton (visible while catalog is fetching) ---------- */
.afx-filter-skeleton {
    display: flex;
    flex-direction: column;
}
.afx-skeleton-row {
    height: 44px;
    border-bottom: 1px solid var(--afx-border);
    position: relative;
    overflow: hidden;
}
.afx-skeleton-row::before {
    content: '';
    position: absolute;
    inset: 14px 50% 14px 0;
    background: var(--afx-surface-2);
    border-radius: 2px;
    opacity: 0.5;
    animation: afx-skel-pulse 1.4s ease-in-out infinite;
}
.afx-skeleton-row:nth-child(2)::before { inset: 14px 35% 14px 0; animation-delay: 0.1s; }
.afx-skeleton-row:nth-child(3)::before { inset: 14px 60% 14px 0; animation-delay: 0.2s; }
.afx-skeleton-row:nth-child(4)::before { inset: 14px 45% 14px 0; animation-delay: 0.3s; }
.afx-skeleton-row:nth-child(5)::before { inset: 14px 55% 14px 0; animation-delay: 0.4s; }
.afx-skeleton-row:nth-child(6)::before { inset: 14px 40% 14px 0; animation-delay: 0.5s; }
@keyframes afx-skel-pulse {
    0%, 100% { opacity: 0.25; }
    50% { opacity: 0.6; }
}

.afx-filter-group {
    border: none;
    overflow: hidden;
    background: transparent;
    border-bottom: 1px solid var(--afx-border);
}
.afx-filter-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    cursor: pointer;
    user-select: none;
    color: var(--afx-fg);
    font-weight: 500;
    font-size: 11px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    list-style: none;
}
.afx-filter-summary::-webkit-details-marker { display: none; }
.afx-filter-summary::after {
    content: '+';
    font-size: 18px;
    color: var(--afx-muted);
    transition: transform 0.2s;
    font-weight: 300;
    line-height: 1;
}
.afx-filter-group[open] .afx-filter-summary::after { transform: rotate(45deg); }
.afx-filter-options {
    padding: 0 0 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 320px;
    overflow-y: auto;
}
.afx-filter-option {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    cursor: pointer;
    color: var(--afx-muted);
    transition: color 0.12s;
}
.afx-filter-option:hover { color: var(--afx-fg); }
.afx-filter-option.is-zero { opacity: 0.35; }
.afx-filter-option.is-zero:hover { opacity: 0.55; }
.afx-filter-option input {
    appearance: none;
    width: 14px;
    height: 14px;
    border: 1px solid var(--afx-border-strong);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
}
.afx-filter-option input:checked {
    background: var(--afx-accent);
    border-color: var(--afx-accent);
}
.afx-filter-option input:checked::after {
    content: '';
    position: absolute;
    top: 1px; left: 4px;
    width: 4px; height: 8px;
    border: solid var(--afx-accent-fg);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.afx-filter-option input:checked ~ .afx-filter-label { color: var(--afx-fg); font-weight: 500; }
.afx-filter-option .afx-filter-label { flex: 1; }
.afx-filter-option .afx-filter-count {
    color: var(--afx-dim);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

/* ---------- Product grid ---------- */
.afx-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 48px 32px;
}
.afx-card {
    display: flex;
    flex-direction: column;
    background: transparent;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    position: relative;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.afx-card-image {
    position: relative;
    aspect-ratio: 1;
    background: var(--afx-surface);
    overflow: hidden;
    border: 1px solid var(--afx-border);
    transition: border-color 0.25s;
}
.afx-card:hover .afx-card-image { border-color: var(--afx-accent); }
.afx-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.afx-card:hover .afx-card-image img { transform: scale(1.04); }

/* Secondary image — sits stacked on the primary, fades in on hover. */
.afx-card-image .afx-card-img-secondary {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.45s ease, transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}
.afx-card:hover .afx-card-image .afx-card-img-secondary { opacity: 1; }
.afx-card-image-placeholder {
    color: var(--afx-dim);
    font-size: 11px;
    padding: 24px;
    text-align: center;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

/* Hover overlay: subtle CTA — z-index 3 so it sits ABOVE the secondary image (z:1) and badge (z:2) */
.afx-card-image::after {
    content: 'View Product →';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 14px 16px;
    background: var(--afx-accent);
    color: var(--afx-accent-fg);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-align: center;
    transform: translateY(100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 3;
}
.afx-card:hover .afx-card-image::after { transform: translateY(0); }

.afx-card-body {
    padding: 18px 4px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.afx-card-brand {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    color: var(--afx-accent);
    font-weight: 600;
}
.afx-card-name {
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.3;
    letter-spacing: 0.3px;
    color: var(--afx-fg);
    margin: 0;
    transition: color 0.2s;
}
.afx-card:hover .afx-card-name { color: var(--afx-accent); }
.afx-card-meta {
    font-size: 11px;
    color: var(--afx-muted);
    padding-top: 4px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

/* Lumens range slider (custom — replaces a normal checkbox group) */
.afx-filter-lumens .afx-filter-options { padding: 16px 4px 8px; }
.afx-lumens-track {
    position: relative;
    height: 22px;
    margin-bottom: 16px;
}
.afx-lumens-track::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--afx-border);
    transform: translateY(-50%);
    border-radius: 2px;
}
.afx-lumens-fill {
    position: absolute;
    top: 50%;
    height: 2px;
    background: var(--afx-accent);
    transform: translateY(-50%);
    pointer-events: none;
    box-shadow: 0 0 8px rgba(47, 230, 255, 0.4);
}
.afx-lumens-track input[type="range"] {
    appearance: none;
    -webkit-appearance: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 22px;
    background: transparent;
    pointer-events: none;
    margin: 0;
    padding: 0;
}
.afx-lumens-track input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--afx-accent);
    border: 2px solid var(--afx-bg-deep);
    pointer-events: auto;
    cursor: grab;
    box-shadow: 0 0 0 1px var(--afx-accent), 0 0 8px rgba(47, 230, 255, 0.5);
}
.afx-lumens-track input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--afx-accent);
    border: 2px solid var(--afx-bg-deep);
    pointer-events: auto;
    cursor: grab;
    box-shadow: 0 0 0 1px var(--afx-accent), 0 0 8px rgba(47, 230, 255, 0.5);
}
.afx-lumens-track input[type="range"]:active::-webkit-slider-thumb { cursor: grabbing; }
.afx-lumens-values {
    text-align: center;
    color: var(--afx-fg);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.5px;
}
.afx-lumens-unit { color: var(--afx-dim); }

/* Configurable badge — top-left corner overlay */
.afx-card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    padding: 4px 10px;
    background: var(--afx-bg-deep);
    color: var(--afx-accent);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-radius: 999px;
    border: 1px solid var(--afx-accent);
}
/* Neon-style "Up to X lm/W" badge — red accent to differentiate from the cyan "Configurable" */
.afx-card-badge.afx-card-badge-lm {
    color: #ff5b5b;
    border-color: #ff5b5b;
    background: var(--afx-bg-deep);
}

/* ---------- States ---------- */
.afx-empty,
.afx-error {
    grid-column: 1 / -1;
    text-align: center;
    padding: 96px 16px;
    color: var(--afx-muted);
    font-family: 'DM Serif Display', Georgia, serif;
    font-style: italic;
    font-size: 20px;
}
.afx-sentinel { height: 1px; margin-top: 64px; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .afx-list-title { font-size: 56px; }
    .afx-list-headerband-inner,
    .afx-toolbar-inner,
    .afx-layout { padding-left: 40px; padding-right: 40px; }
    .afx-layout { grid-template-columns: 200px 1fr; gap: 40px; }
}
@media (max-width: 768px) {
    .afx-list-title { font-size: 42px; }
    .afx-list-headerband { padding: calc(var(--afx-header-offset) + 16px) 0 40px; }
    .afx-list-headerband-inner,
    .afx-toolbar-inner,
    .afx-layout { padding-left: 24px; padding-right: 24px; }
    .afx-layout { grid-template-columns: 1fr; gap: 24px; }
    .afx-filters { position: static; max-height: none; }
    .afx-filters[hidden] { display: none; }
    .afx-toggle-filters { display: inline-block; }
    .afx-search { min-width: 0; flex: 1; }
    .afx-toolbar-inner { gap: 12px; }
    .afx-grid { grid-template-columns: repeat(2, 1fr); gap: 24px 16px; }
    .afx-card-name { font-size: 17px; }
}
@media (max-width: 480px) {
    .afx-list-title { font-size: 32px; }
    .afx-grid { grid-template-columns: 1fr; }
    .afx-card-name { font-size: 22px; }
}
