/*
 Theme Name: GeneratePress Child
 Template: generatepress
*/

/* --- TYPOGRAPHY (GLOBAL OVERRIDE) --- */
body {
    font-family: 'IBM Plex Sans', sans-serif !important;
    font-size: 18px; /* BASE SIZE */
    line-height: 1.4; /* Base Line Height */
}

/* Base Headings */
h1, .h1-style { 
    font-size: 2.22em !important; /* ~40px */
}
h2, .h2-style { font-size: 1.78em !important; /* ~32px */ }
h3, .h3-style { font-size: 1.33em !important; /* ~24px */ }

/* Global Line Height Safety (All except H1) */
h2, h3, h4, h5, h6, p, li, span, div {
    line-height: 1.4 !important;
}

/* H1 Specific Line Height */
.entry-title {
    line-height: 1.2 !important;
}

/* Force Left Align & No Caps */
h1, h2, h3, h4, h5, h6, 
.entry-title,
th, td, 
.price-label,
.spec-label {
    text-transform: none !important;
    text-align: left !important;
}

/* Max Weight 600 */
h1, h2, h3, h4, h5, h6, .entry-title {
    font-weight: 600 !important;
}

/* --- STICKY HEADER --- */
.site-header {
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 9999;
    border-bottom: 1px solid var(--blue);
    background-color: var(--base);
}
.inside-header { padding: 0.55em 1.1em !important; /* Converted to em (approx 10px 20px) */ }

/* --- GLOBAL LAYOUT --- */
body.single-reactor, body.archive-reactor { background-color: var(--base) !important; }

.reactor-page-wrapper {
    background-color: var(--base);
    color: var(--white);
    min-height: 100vh;
    padding-bottom: 80px; /* Increased bottom padding for sticky button space */
    width: 100%;
}

.single-reactor .site.grid-container,
.single-reactor #content,
.archive-reactor .site.grid-container,
.archive-reactor #content {
    max-width: 100% !important;
    padding: 0 !important;
}

/* MAIN CONTAINER LOGIC - DESKTOP & TABLET DEFAULT (> 768px) */
.reactor-page-wrapper .grid-container {
    width: 100% !important; /* FORCE FULL WIDTH */
    max-width: 1366px !important; /* Reduced max-width as requested */
    margin-left: auto !important;
    margin-right: auto !important;
    /* FIX: 20px Padding for Desktop and Tablet */
    padding-left: 20px !important; 
    padding-right: 20px !important;
    box-sizing: border-box;
}

/* 1. Breadcrumbs */
.reactor-breadcrumbs {
    padding: 1.11em 0 0.55em; /* 20px 0 10px -> em */
    font-size: 0.77em; /* ~14px */
    color: var(--opac); 
}
.reactor-breadcrumbs a {
    color: var(--white);
    text-decoration: none;
}
.reactor-breadcrumbs a:hover { color: var(--blue); }
.reactor-breadcrumbs .separator { margin: 0 0.44em; color: var(--blue); }

/* 2. Titles */
h1.entry-title {
    color: var(--white);
    margin-bottom: 0.55em; /* 10px -> em */
}

.reactor-seo-title {
    color: var(--white);
    font-size: 1.2em !important; /* Matches Core Specs size */
    font-weight: 400 !important;
    margin-bottom: 2.22em; /* 40px -> em */
    padding-left: 0;
    width: 100%;
}

/* 3. Hero Grid Layout */
.reactor-hero-grid {
    display: grid;
    grid-template-columns: 55% 40%;
    gap: 5%;
    margin-bottom: 3.33em; /* 60px -> em */
    align-items: start;
}

/* --- GALLERY STYLES --- */
.reactor-gallery-area {
    display: flex;
    flex-direction: column;
    gap: 0.83em; /* 15px -> em */
    /* FIX: CSS Grid Blowout Prevention */
    min-width: 0; 
    width: 100%;
}

.main-image-viewport {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    /* FIX: Ensure viewport never exceeds parent */
    max-width: 100%; 
}

.main-image-viewport img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0;
}

/* Navigation Arrows */
.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: var(--white);
    font-size: 1.33em; /* 24px */
    padding: 0.83em; /* 15px */
    cursor: pointer;
    transition: all 0.3s;
    user-select: none;
    z-index: 10;
    opacity: 0; 
}
.main-image-viewport:hover .gallery-nav { opacity: 1; }
.gallery-nav:hover { background: var(--blue); }
.gallery-nav.prev { left: 0; }
.gallery-nav.next { right: 0; }

/* Thumbnails */
.gallery-thumbs {
    display: flex;
    gap: 0.55em; /* 10px */
    overflow-x: auto;
    padding-bottom: 0.28em; /* 5px */
    scrollbar-width: none; 
}
.gallery-thumbs::-webkit-scrollbar { display: none; }

.thumb-item {
    width: 5.55em; /* 100px approx */
    height: 5.55em;
    aspect-ratio: 1 / 1;
    flex-shrink: 0;
    border: 1px solid var(--opac);
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.3s ease;
    background: #000;
}
.thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.thumb-item:hover { opacity: 1; }
.thumb-item.active {
    opacity: 1;
}





/* --- SPECS & INFO STYLES --- */
.dark-specs-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.66em; /* 30px -> em */
}

.dark-specs-table th {
    padding: 0 0 0.83em 0; /* 15px -> em */
}
.dark-specs-table th h3 {
    color: var(--white);
    margin: 0;
    font-size: 1.33em;
}

.dark-specs-table td {
    padding: 0.44em 0; /* 8px -> em */
    font-size: 0.89em; /* ~16px on Desktop */
    background-image: linear-gradient(to right, var(--blue) 50%, rgba(255, 255, 255, 0) 0%);
    background-position: bottom;
    background-size: 6px 1px;
    background-repeat: repeat-x;
}
.dark-specs-table tr:last-child td { background-image: none; }

.spec-label { color: var(--white); width: 50%; font-weight: 600 !important; }
.spec-value { color: var(--white); font-weight: 500; text-align: right !important; }

/* Price & CTA Box */
.reactor-action-box {
    padding: 1.38em 0; /* 25px -> em */
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 0.83em; /* 15px -> em */
}

.price-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.price-label {
    font-size: 0.89em;
    color: var(--white);
    margin-bottom: 0.28em; /* 5px -> em */
}
.price-value {
    font-size: 1.33em;
    font-weight: 600;
    color: var(--white);
}

/* Default Button Style */
.industrial-btn {
    background-color: var(--accent);
    color: var(--white);
    border: 1px solid var(--accent);
    padding: 0.83em 1.66em;
    font-size: 1em; /* Fixed 16px as requested */
    font-weight: 600;
    text-transform: uppercase !important;
    transition: all 0.3s ease;
    width: auto;
    max-width: 300px;
    text-align: center !important;
}
.industrial-btn:hover {
    background-color: var(--blue);
    color: var(--white);
    border-color: var(--white);
}

/* Content & Description Header */
.description-header {
    color: var(--white);
    margin: 0 0 1em 0;
    font-size: 1.33em; /* Matches Core Specs H3 */
    font-weight: 600; /* Match TH weight */
}

.entry-content p {
    margin-bottom: 1.5em;
    font-size: 1em;
}

.neon-divider { display: none; }

/* --- MODAL --- */
.modal-backdrop {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}
.modal-window {
    background: var(--base);
    border: 1px solid var(--blue);
    padding: 2.22em; /* 40px -> em */
    width: 90%;
    max-width: 500px;
    position: relative;
    color: var(--white);
    text-align: left;
}
.modal-close {
    position: absolute;
    top: 0.83em; right: 1.11em; /* 15px 20px -> em */
    font-size: 1.66em; /* 30px */
    cursor: pointer;
    color: var(--opac);
}
.modal-title { margin-bottom: 1.38em; text-align: center !important; }

#quoteModal .forminator-label { color: var(--white) !important; }
#quoteModal .forminator-input { 
    background: rgba(255,255,255,0.1) !important; 
    color: var(--white) !important;
    border: 1px solid var(--blue) !important;
}
#quoteModal .forminator-textarea {
    background: rgba(255,255,255,0.1) !important; 
    color: var(--white) !important;
    border: 1px solid var(--blue) !important;
}
#quoteModal .forminator-button-submit {
    background-color: var(--blue) !important;
    width: 100%;
}

/* --- ARCHIVE PAGE STYLES --- */

/* Main Archive Grid (Filters + Content) */
.reactor-archive-main {
    display: grid;
    grid-template-columns: 280px 1fr; /* 280px for Filter Sidebar, rest for content */
    gap: 3.33em; /* 60px gap */
    margin-top: 2.22em; /* 40px top margin */
}

/* Filter Sidebar Styles (For Filter Everything compatibility) */
.archive-sidebar {
    padding-top: 0.55em; /* Match grid top alignment */
}

.archive-sidebar h3 {
    color: var(--white);
    margin-top: 0;
    margin-bottom: 1em;
}

/* Grid of Product Cards */
.reactor-archive-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 columns on desktop */
    gap: 2.22em; /* 40px gap between cards */
}

/* Individual Product Card */
.reactor-preview-card {
    background-color: #1a1a1a; /* Slightly lighter than base for contrast */
    border: 1px solid var(--opac);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
}

.reactor-preview-card:hover {
    border-color: var(--blue);
    /* box-shadow: 0 0 10px rgba(var(--blue), 0.5); */ /* Cannot use CSS variables with RGB opacity easily, so using hardcoded blue shadow */
    box-shadow: 0 0 10px rgba(0, 191, 255, 0.3); 
    transform: translateY(-2px);
}

.reactor-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.card-image-wrapper {
    width: 100%;
    aspect-ratio: 1 / 1; /* Square image */
    overflow: hidden;
    background: #000;
}
.card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.reactor-preview-card:hover .card-image-wrapper img {
    transform: scale(1.05);
}

.card-content {
    padding: 1.11em; /* 20px padding */
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-title {
    font-size: 1.33em; /* 24px */
    color: var(--white);
    margin: 0 0 0.5em 0;
    line-height: 1.2 !important;
}

.card-specs {
    list-style: none;
    padding: 0;
    margin: 0 0 1em 0;
    flex-grow: 1;
}
.card-specs li {
    font-size: 0.89em; /* 16px */
    color: var(--opac);
    margin-bottom: 0.2em;
    display: flex;
    justify-content: space-between;
    padding: 0.1em 0;
    /* Placeholder for dotted line using rgba(var(--blue)) */
    border-bottom: 1px dotted rgba(0, 191, 255, 0.3);
}

.card-specs li strong {
    color: var(--white);
    font-weight: 500;
}

.card-specs li:last-child {
    border-bottom: none;
}

.card-cta-wrapper {
    margin-top: auto; /* Push to bottom */
}

.card-cta-wrapper .industrial-btn {
    width: 100%;
    max-width: none;
    padding: 0.66em 1em;
    font-size: 1em;
}

/* --- ADAPTATION FOR LAPTOPS, TABLETS (< 1366px) --- */
@media (max-width: 1366px) {
    .reactor-page-wrapper .grid-container {
        margin-left: 0 !important;
        margin-right: 0 !important;
        /* Matches Desktop/Tablet Requirement (20px) */
        padding-left: 20px !important; 
        padding-right: 20px !important;
    }
}

/* --- TABLET SPECIFIC (Max 1024px) --- */
@media (max-width: 1024px) {
    /* Force Table Font to 14px on Tablet and Mobile */
    .dark-specs-table td {
        font-size: 14px;
    }
    
    /* Archive Tablet Layout (2 columns and stacked sidebar) */
    .reactor-archive-main {
        grid-template-columns: 1fr; /* Stack sidebar on top */
        gap: 2.22em;
    }

    .reactor-archive-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columns for cards */
        gap: 1.66em; /* Reduced gap */
    }
}

/* --- MOBILE SPECIFIC (Up to 768px) --- */
@media (max-width: 768px) {
    /* FIX: HIDE HORIZONTAL SCROLLBAR ON MOBILE */
    body { 
        font-size: 14px; 
        overflow-x: hidden; 
    }

    /* FIX: HEADER LOGO/MENU ONE LINE & SPACING */
    .site-header .inside-header {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
        /* У GeneratePress уже могут быть паддинги, но мы их переопределяем для чистоты */
        padding-left: 16px !important; 
        padding-right: 16px !important;
        box-sizing: border-box !important;
    }

    /* Logo Logic: Don't shrink to dot, keep reasonable size */
    .site-branding, .site-logo {
        flex: 1 1 auto !important; /* Allow growing, set base to auto */
        max-width: 75% !important; /* Leave room for burger */
        min-width: 120px !important; /* Ensure it's never 'micro' */
        /* margin-right: auto !important; - Удаляем, чтобы работал space-between */
        
        /* FIX: Align logo to the left edge of the content area */
        margin-left: 0 !important; 
        padding-left: 0 !important;
    }
    
    .site-logo img, .header-image {
        height: auto !important;
        max-height: 50px !important; /* Reasonable mobile height */
        width: auto !important;
        max-width: 100% !important;
        object-fit: contain;
    }

    /* Burger Menu Logic: Push right, don't stretch */
    .mobile-menu-control-wrapper,
    .menu-toggle,
    .main-navigation .menu-toggle {
        flex: 0 0 auto !important; /* Don't grow or shrink */
        width: auto !important;
        /* margin-left: auto !important; - Удаляем, работает через justify-content: space-between */
    }
    
    /* FIX: 16px Padding for Mobile */
    .reactor-page-wrapper .grid-container {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    h1, .entry-title { 
        font-size: 2em !important; 
    }
    
    .reactor-seo-title {
        font-size: 1.1em !important; 
        margin-bottom: 1.5em; 
    }

    .reactor-hero-grid {
        grid-template-columns: 1fr;
        gap: 1.66em; 
        margin-bottom: 1em; 
    }
    
    .main-image-viewport {
        aspect-ratio: 1 / 1; 
        height: auto;
    }
    .main-image-viewport:hover .gallery-nav { opacity: 1; }

    /* TABLE GAP REDUCTION & COMPACTNESS */
    .dark-specs-table {
        margin-bottom: 0.5em !important; 
        table-layout: fixed; /* Force fixed table layout */
    }
    
    .dark-specs-table td {
        font-size: 13px !important; /* Slightly smaller text */
        line-height: 1.3 !important; /* Tighter line height */
        padding-top: 0.3em !important; 
        padding-bottom: 0.3em !important;
        
        /* FIX: Убираем горизонтальные паддинги, чтобы дать место тексту */
        padding-left: 0px !important; 
        padding-right: 0px !important;

        word-break: break-word !important; /* ALLOW BREAKING */
        white-space: normal !important; /* Allow wrapping */
        vertical-align: top !important; /* Align top for multi-line */
    }

    .spec-label {
        width: 45% !important; /* Give value column slightly more space */
        padding-right: 0.5em !important;
    }
    
    .spec-value {
        width: 55% !important;
    }

    /* PRICE & ACTION BOX OVERRIDE FOR MOBILE */
    .reactor-info-area .reactor-action-box {
        padding-top: 0 !important;
        padding-bottom: 0 !important; /* Reset padding, space handled by wrapper */
    }

    /* FIX: VISIBLE HORIZONTAL PRICE WITH TOP BORDER */
    .price-wrapper {
        display: flex !important; /* Force flex */
        flex-direction: row !important;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        /* Increased margin top and moved border to top */
        margin-top: 1.5em; 
        border-top: 1px dotted var(--blue);
        border-bottom: none; /* Removed bottom border */
        padding-top: 1em; /* Padding for spacing from border */
        padding-bottom: 0.5em;
        color: var(--white); /* Ensure visibility */
    }

    .price-label {
        margin-bottom: 0;
        font-weight: 600;
        font-size: 14px !important; 
        color: var(--white);
    }

    .price-value {
        font-size: 1.2em; 
        color: var(--white);
    }

    /* STICKY BUTTON CONTAINER (Bottom Bar) */
    .sticky-btn-container {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background-color: var(--base); /* Dark Background */
        border-top: 1px solid var(--blue);
        padding: 16px; /* Padding inside the bar */
        z-index: 99999;
        box-sizing: border-box;
    }

    /* Button inside Sticky Container */
    .sticky-btn-container .industrial-btn {
        width: 100%; /* Full width inside padding */
        max-width: none;
        margin: 0;
        /* Keep original button look (blue) */
    }
    
    /* Archive Mobile Layout */
    .reactor-archive-grid {
        grid-template-columns: 1fr; /* 1 column on mobile */
        gap: 1.66em;
    }
}





/* --- FULL SPECS TABLE --- */

.reactor-specs-wrapper {
    border: 1px solid var(--blue);
    background-color: var(--base);
    width: 100%;
    margin-bottom: 3em;
    position: relative;
    overflow: hidden; 
    z-index: 1;
}

.reactor-specs-scroll {
    overflow-x: auto;
    width: 100%;
    scrollbar-width: thin;
    scrollbar-color: var(--blue) var(--base);
    margin: 0;
    padding: 0;
}

.full-specs-table {
    width: 100%;
    border-collapse: separate; 
    border-spacing: 0;
    min-width: 900px; 
    font-size: 0.89em;
    color: var(--white);
    table-layout: fixed;
    margin: 0 !important;
}

/* Сброс стилей ячеек */
.full-specs-table th, 
.full-specs-table td {
    padding: 0.8em 1em;
    text-align: center;
    vertical-align: middle;
    position: relative;
    border: none;
}

/* === STICKY COLUMN (ЛЕВАЯ КОЛОНКА) === */
.full-specs-table th:first-child,
.full-specs-table td:first-child {
    width: 180px; 
    min-width: 180px;
    text-align: left;
    font-weight: 600;
    
    position: sticky;
    left: 0;
    z-index: 20;
    
    background-color: transparent !important; 
    background-image: none !important;
}

/* === СЛОЙ ФОНА (::before) === */
.full-specs-table th:first-child::before,
.full-specs-table td:first-child::before {
    content: "";
    position: absolute;
    top: 0; bottom: 0; 
    left: -1px; width: calc(100% + 2px); 
    
    background-color: var(--base);
    
    /* Пунктирная линия по умолчанию */
    background-image: linear-gradient(to right, var(--blue) 50%, rgba(255,255,255,0) 0%);
    background-position: bottom;
    background-size: 6px 1px;
    background-repeat: repeat-x;
    
    z-index: -1;
}

/* FIX: Убираем дублирующую границу и фон у заголовка первой колонки */
.full-specs-table thead th:first-child::before {
    background-image: none;
    border-bottom: none; /* БЫЛО: 1px solid... СТАЛО: none. Граница берется от родителя */
}

/* Убираем линию у последней ячейки первой колонки */
.full-specs-table tbody tr:last-child td:first-child::before {
    background-image: none;
}

/* Сплошная вертикальная линия справа от первой колонки */
.full-specs-table th:first-child::after,
.full-specs-table td:first-child::after {
    content: "";
    position: absolute;
    top: 0; right: 0; width: 1px; height: 100%;
    background: var(--blue);
    z-index: 21;
}

/* === ОСТАЛЬНАЯ СЕТКА (GRID) === */

/* Шапка - сплошная линия */
.full-specs-table thead th {
    border-bottom: 1px solid var(--blue);
    font-weight: 600;
    font-size: 1em;
}

/* Горизонтальный пунктир (Тело таблицы) */
.full-specs-table tbody td {
    background-image: linear-gradient(to right, var(--blue) 50%, rgba(255,255,255,0) 0%);
    background-position: bottom;
    background-size: 6px 1px;
    background-repeat: repeat-x;
}
.full-specs-table tbody tr:last-child td {
    background-image: none;
}

/* Вертикальный пунктир */
.full-specs-table th:not(:first-child):not(:last-child)::after,
.full-specs-table td:not(:first-child):not(:last-child)::after {
    content: "";
    position: absolute;
    top: 0; right: 0; width: 1px; height: 100%;
    background-image: linear-gradient(to bottom, var(--blue) 50%, rgba(255,255,255,0) 0%);
    background-size: 1px 6px;
    background-repeat: repeat-y;
    z-index: 1;
}

/* === СПИСКИ === */
ul.spec-detail-list {
    list-style: none; margin: 0; padding: 0;
    text-align: left; line-height: 1.5;
}
ul.spec-detail-list li {
    margin-bottom: 0.5em; position: relative; padding-left: 12px;
}
ul.spec-detail-list li:last-child { margin-bottom: 0; }
ul.spec-detail-list li::before {
    content: ""; position: absolute; left: 0; top: 8px;
    width: 4px; height: 4px; background-color: var(--blue);
}
ul.spec-detail-list strong { color: var(--white); font-weight: 600; }

/* Выравнивание */
.full-specs-table td.align-left { text-align: left; }
.full-specs-table td.align-top { vertical-align: top; }

/* Адаптивность */
@media (max-width: 1024px) {
    .full-specs-table { font-size: 14px; }
    .full-specs-table th:first-child,
    .full-specs-table td:first-child {
        width: 140px; min-width: 140px; padding: 0.5em;
    }
}