
/* =======================================================
   Products Page — STEAM-STYLE ROW LAYOUT  v3
   ✅ products.json logic: UNTOUCHED
   ✅ product-detail.js:   UNTOUCHED
   ✅ All 6 rows visible on load, scroll to browse
   ✅ Non-active rows: strong dark overlay + blur
   ✅ Left edge: high-tech vertical category label bar
   ✅ v3: Cards +33% taller, rows +33% taller
   ======================================================= */

/* ---------- Theme Variables ---------- */
:root {
    --steam-bg:         #0a0c10;
    --steam-row-bg:     #0f1218;
    --steam-card-bg:    #1a1d24;
    --steam-card-hover: #22262f;
    --steam-border:     rgba(255,255,255,0.07);
    --steam-accent:     #3b82f6;
    --steam-cyan:       #00f3ff;
    --steam-text:       #c6d4df;
    --steam-muted:      #8fa0b0;
    --scan-color:       #00f3ff;
    --font-primary:     'Orbitron', sans-serif;
    --font-secondary:   'Roboto', 'Segoe UI', sans-serif;

    /* Landscape-friendly rail cards for wide product renders */
    --card-w:           360px;
    --card-h:           310px;
    --row-h:            430px;

    --cat-bar-w:        64px;
    --overlay-opacity:  0.82;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0; padding: 0;
    min-height: 100vh;
    background-color: var(--steam-bg);
    color: var(--steam-text);
    font-family: var(--font-secondary);
}

body.is-products-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.products-main {
    flex: 1;
    width: 100%;
}

footer { flex-shrink: 0; z-index: 10; }

/* =======================================================
   PRODUCT GRID SECTION
   ======================================================= */
.product-grid-section {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* =======================================================
   STEAM ROW
   ======================================================= */
.steam-row {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    height: var(--row-h);
    border-bottom: 1px solid rgba(255,255,255,0.04);
    background: var(--steam-row-bg);
    overflow: hidden;
    transition: height 0.4s ease;
}

.steam-row.bg-active {
    height: calc(var(--row-h) + 52px);
}

/* Background image layer */
.steam-row::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: var(--row-bg-img, none);
    background-size: cover;
    background-position: center;
    filter: blur(18px) brightness(0.18) saturate(1.4);
    transform: scale(1.1);
    opacity: 0;
    transition: opacity 0.65s ease;
    z-index: 0;
    pointer-events: none;
}

.steam-row.bg-active::before { opacity: 1; }

/* =======================================================
   DIM OVERLAY
   ======================================================= */
.steam-row-overlay {
    position: absolute;
    inset: 0;
    background: rgba(5, 7, 12, var(--overlay-opacity));
    z-index: 5;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.steam-row:hover .steam-row-overlay,
.steam-row.bg-active .steam-row-overlay {
    opacity: 0;
}

/* =======================================================
   LEFT CATEGORY BAR
   ======================================================= */
.steam-cat-bar {
    position: relative;
    z-index: 6;
    flex-shrink: 0;
    width: var(--cat-bar-w);
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    border-right: 1px solid rgba(0, 243, 255, 0.12);
    gap: 0;
    overflow: hidden;
}

/* Glowing left-edge line */
.steam-cat-bar::before {
    content: '';
    position: absolute;
    left: 0; top: 0;
    width: 2px;
    height: 100%;
    background: linear-gradient(
            to bottom,
            transparent 0%,
            var(--steam-cyan) 20%,
            var(--steam-cyan) 80%,
            transparent 100%
    );
    box-shadow: 0 0 8px var(--steam-cyan), 0 0 16px rgba(0,243,255,0.3);
}

/* Dot-grid background */
.steam-cat-bar::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(0,243,255,0.08) 1px, transparent 1px);
    background-size: 8px 8px;
    pointer-events: none;
}

/* Vertical line segments */
.scb-line {
    flex: 1;
    width: 1px;
    background: linear-gradient(to bottom, transparent, rgba(0,243,255,0.25));
    position: relative;
    z-index: 1;
}
.scb-line:last-child {
    background: linear-gradient(to top, transparent, rgba(0,243,255,0.25));
}

/* Corner brackets */
.scb-bracket {
    position: relative;
    z-index: 1;
    width: 24px;
    height: 10px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scb-corner {
    display: block;
    width: 10px;
    height: 10px;
    border: 1px solid var(--steam-cyan);
    opacity: 0.6;
    transform: rotate(45deg);
    box-shadow: 0 0 4px rgba(0,243,255,0.5);
}

/* Text wrapper */
.scb-text-wrap {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 0;
}

/* Index number */
.scb-index {
    font-family: var(--font-primary);
    font-size: 0.5rem;
    letter-spacing: 2px;
    color: rgba(0, 243, 255, 0.45);
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

/* Category title */
.scb-title {
    font-family: var(--font-primary);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--steam-cyan);
    writing-mode: vertical-rl;
    text-orientation: mixed;
    text-shadow:
            0 0 6px rgba(0,243,255,0.8),
            0 0 14px rgba(0,243,255,0.4);
    transition: text-shadow 0.3s ease, color 0.3s ease;
}

.steam-row:hover .scb-title {
    color: #fff;
    text-shadow:
            0 0 10px rgba(0,243,255,1),
            0 0 24px rgba(0,243,255,0.6),
            0 0 40px rgba(0,243,255,0.3);
}

/* Pulsing dot */
.scb-dot {
    display: block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--steam-cyan);
    box-shadow: 0 0 6px var(--steam-cyan);
    animation: dot-pulse 2.4s ease-in-out infinite;
}

@keyframes dot-pulse {
    0%, 100% { opacity: 1;   transform: scale(1);   }
    50%       { opacity: 0.3; transform: scale(0.6); }
}

/* =======================================================
   ROW CONTENT
   ======================================================= */
.steam-row-content {
    position: relative;
    z-index: 2;
    flex: 1;
    display: flex;
    flex-direction: column;
    /* Prevent parent clipping of the horizontal rail */
    overflow: visible;
    justify-content:center;
    align-items:stretch;
}

/* =======================================================
   SCROLL TRACK
   ======================================================= */
.steam-scroll-track {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 36px;
    padding-right: clamp(48px, 6vw, 96px);
    overflow-x: auto;
    overflow-y: visible;
    scroll-behavior: smooth;
    -ms-overflow-style: none;
    scrollbar-width: none;
    /* Remove width cap boundary so full rail can scroll naturally */
    max-width: none;
    margin: 0;
    width:100%;
}
.steam-scroll-track::-webkit-scrollbar { display: none; }

/* =======================================================
   STEAM CARD  — +33% bigger
   ======================================================= */
.steam-card {
    position: relative;
    flex-shrink: 0;
    width: var(--card-w);
    height: var(--card-h);
    border-radius: 4px;
    overflow: visible;
    cursor: pointer;
    background: var(--steam-card-bg);
    border: 1px solid var(--steam-border);
    display: flex;
    flex-direction: column;
    transition:
            transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
            box-shadow 0.3s ease,
            border-color 0.2s ease;
    z-index: 1;
}

.steam-card:hover {
    transform: scale(1.07) translateY(-8px);
    box-shadow:
            0 24px 60px rgba(0,0,0,0.8),
            0 0 0 1px rgba(59,130,246,0.6),
            0 0 36px rgba(59,130,246,0.18);
    border-color: var(--steam-accent);
    z-index: 20;
}

.steam-card.is-selected {
    border-color: var(--steam-cyan);
    box-shadow:
            0 0 0 2px var(--steam-cyan),
            0 14px 40px rgba(0,243,255,0.25);
}

/* Card image area — dominant wide media region */
.steam-card-img {
    width: 100%;
    height: clamp(190px, 24vh, 225px);
    position: relative;
    background: #000;
    overflow: hidden;
    border-radius: 4px 4px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(8px, 1vw, 12px);
}

.steam-card-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    transition: transform 0.4s ease;
}

.steam-card:hover .steam-card-img img {
    transform: scale(1.06);
}

/* Blueprint overlay */
.steam-card-img .card-blueprint {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    object-fit: contain;
    object-position: center;
    z-index: 2;
    background: #000;
    clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
    transition: clip-path 0.45s ease;
    padding: inherit;
}

.steam-card:hover .steam-card-img .card-blueprint {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
}

/* Laser scan line */
.steam-card-laser {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 2px;
    background: var(--scan-color);
    box-shadow: 0 0 8px var(--scan-color), 0 0 18px var(--scan-color);
    z-index: 10;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    animation: card-scan-move 2.5s ease-in-out infinite;
    animation-play-state: paused;
}

.steam-card:hover .steam-card-laser {
    opacity: 1;
    animation-play-state: running;
}

@keyframes card-scan-move {
    0%   { top: 0%;  opacity: 0; }
    5%   { opacity: 1; }
    95%  { opacity: 1; }
    100% { top: 98%; opacity: 0; }
}

/* Bottom gradient */
.steam-card-img::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 45%;
    background: linear-gradient(to top, rgba(26,29,36,0.98) 0%, transparent 100%);
    z-index: 3;
    pointer-events: none;
}

/* Card info panel — compact text area below wide media */
.steam-card-info {
    padding: 10px 12px 12px;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: var(--steam-card-bg);
    border-radius: 0 0 4px 4px;
    transition: background 0.2s;
}

.steam-card:hover .steam-card-info { background: var(--steam-card-hover); }

.steam-card-name {
    font-family: var(--font-primary);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #dce8f0;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s;
}

.steam-card:hover .steam-card-name { color: #fff; }

.steam-card-category {
    font-size: 0.6rem;
    color: var(--steam-accent);
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.85;
}

.steam-card-cta {
    display: inline-block;
    font-family: var(--font-primary);
    font-size: 0.55rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--steam-muted);
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.2s, transform 0.2s, color 0.2s;
}

.steam-card:hover .steam-card-cta {
    opacity: 1;
    transform: translateY(0);
    color: var(--steam-cyan);
}

/* =======================================================
   SELECTED BAR
   ======================================================= */
.steam-selected-bar {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 36px 14px 36px;
    height: 0;
    overflow: hidden;
    opacity: 0;
    transition: height 0.4s ease, opacity 0.3s ease;
}

.steam-row.bg-active .steam-selected-bar {
    height: 52px;
    opacity: 1;
}

.steam-selected-name {
    font-family: var(--font-primary);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #f0f6ff;
}

.steam-selected-sep {
    width: 1px;
    height: 16px;
    background: rgba(255,255,255,0.2);
}

.steam-selected-cat {
    font-size: 0.62rem;
    color: var(--steam-cyan);
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0.8;
}

.steam-selected-view {
    margin-left: auto;
    font-family: var(--font-primary);
    font-size: 0.58rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #fff;
    background: var(--steam-accent);
    border: none;
    padding: 9px 20px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, transform 0.15s;
    display: inline-block;
    border-radius: 2px;
}

.steam-selected-view:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

/* Empty state */
.steam-scroll-track:empty::after {
    content: 'Loading...';
    font-family: var(--font-primary);
    font-size: 0.55rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 20px;
}

/* =======================================================
   PRODUCT DETAIL PAGE STYLES
   ======================================================= */
.category-header {
    padding: 40px 40px 30px;
    background: linear-gradient(135deg, rgba(17,24,39,0.98), rgba(10,14,24,0.95));
    border-bottom: 1px solid rgba(59,130,246,0.15);
    text-align: left;
}

.category-header h1 {
    font-family: var(--font-primary);
    font-size: clamp(1.4rem, 3vw, 2rem);
    color: #f9fafb;
    margin: 0 0 10px;
    text-transform: uppercase;
    letter-spacing: 3px;
    border-left: 4px solid var(--steam-accent);
    padding-left: 16px;
}

.category-header p {
    color: var(--steam-muted);
    font-size: 0.95rem;
    margin: 0 0 0 20px;
}

.category-card {
    display: flex;
    flex-direction: row;
    background: rgba(15,18,26,0.97);
    border: 1px solid rgba(59,130,246,0.15);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0,0,0,0.6);
    margin-bottom: 40px;
    min-height: 500px;
    position: relative;
    transition: border-color 0.3s ease;
}

.category-card:hover { border-color: rgba(59,130,246,0.4); }

.category-card .media {
    flex: 0 0 50%;
    position: relative;
    overflow: hidden;
    background: #000;
}

.category-card .media video,
.category-card .media img {
    width: 100%; height: 100%;
    object-fit: contain;
    display: block;
    background: #000;
}

.scanner-container {
    position: relative;
    width: 100%; height: 100%;
    background: #000;
}

.scanner-img {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: contain;
    padding: 20px;
    box-sizing: border-box;
}

.layer-real  { z-index: 1; background: #000; }

.layer-blueprint {
    z-index: 2;
    background: #000;
    clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
    animation: scan-reveal 4s ease-in-out infinite alternate;
}

.laser-line {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 3px;
    background: var(--scan-color);
    box-shadow: 0 0 10px var(--scan-color), 0 0 20px var(--scan-color), 0 0 40px var(--scan-color);
    z-index: 10;
    animation: scan-move 4s ease-in-out infinite alternate;
}

.tech-grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
            linear-gradient(rgba(0,243,255,0.03) 1px, transparent 1px),
            linear-gradient(90deg, rgba(0,243,255,0.03) 1px, transparent 1px);
    background-size: 30px 30px;
    z-index: 5;
    pointer-events: none;
}

@keyframes scan-reveal {
    0%   { clip-path: polygon(0 0, 100% 0, 100% 0,    0 0); }
    100% { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%); }
}

@keyframes scan-move {
    0%   { top: 0%;               opacity: 0; }
    5%   { opacity: 1; }
    95%  { opacity: 1; }
    100% { top: calc(100% - 3px); opacity: 0; }
}

.category-card .body {
    flex: 1;
    padding: 48px 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: rgba(10,14,26,0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.category-card h3 {
    font-family: var(--font-primary);
    font-size: clamp(1.2rem, 2vw, 1.8rem);
    color: #fff;
    margin: 0 0 18px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--steam-accent);
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.category-card p {
    font-size: 0.9rem;
    line-height: 1.75;
    color: var(--steam-muted);
    margin-bottom: 28px;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.specs-preview {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.09);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding: 24px 22px;
    border-radius: 6px;
    margin-bottom: 28px;
    position: relative;
}

.specs-preview::before {
    content: "Key Specifications";
    display: block;
    font-family: var(--font-primary);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--steam-accent);
    margin-bottom: 14px;
}

.specs-preview div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    font-size: 0.85rem;
    color: #e0e8f0;
}

.specs-preview div:last-child { border-bottom: none; }

.specs-preview strong {
    color: var(--steam-muted);
    font-weight: 600;
    font-size: 0.82rem;
}

.category-actions .btn,
.btn {
    display: inline-block;
    background: var(--steam-accent);
    color: #fff;
    border: none;
    padding: 14px 32px;
    font-family: var(--font-primary);
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-decoration: none;
    cursor: pointer;
    border-radius: 3px;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}

.category-actions .btn:hover,
.btn:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37,99,235,0.4);
}

.container {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 var(--section-pad-x);
}

/* =======================================================
   RESPONSIVE
   ======================================================= */
@media (max-width: 1100px) {
    :root {
        --card-w: 320px;
        --card-h: 290px;
        --row-h:  390px;
    }
    .steam-scroll-track { padding: 16px 24px; }
}

@media (max-width: 768px) {
    :root {
        --card-w: 280px;
        --card-h: 270px;
        --row-h:  360px;
        --cat-bar-w: 48px;
    }
    .scb-title { font-size: 0.5rem; letter-spacing: 2px; }
    .steam-scroll-track { padding: 12px 16px; gap: 10px; }
    .steam-selected-bar { padding: 0 16px 12px; flex-wrap: wrap; gap: 10px; }
    .category-card { flex-direction: column; }
    .category-card .media { height: 320px; flex: none; }
    .category-card .body  { padding: 28px 24px; }
    .container { padding: 0 16px; }
}

@media (max-width: 480px) {
    :root {
        --card-w: 240px;
        --card-h: 250px;
        --row-h:  330px;
        --cat-bar-w: 40px;
    }
    .scb-title { font-size: 0.42rem; }
    .scb-index { display: none; }
    .category-card .body { padding: 20px 18px; }
}

/* ================================
   URGENT HORIZONTAL SCROLL HOTFIX
   ================================ */

.steam-row {
    overflow: visible !important;
}

.steam-row-content {
    overflow: visible !important;
    min-width: 0 !important;
}

.steam-scroll-track {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch;
}

.steam-scroll-track > * {
    flex: 0 0 auto !important;
}

.steam-card {
    flex: 0 0 var(--card-w) !important;
}
