:root {
    --color-bg-light: #f4f6f8;      
    --color-surface: #ffffff;       
    --color-text-dark: #1a1a1a;     
    --color-text-medium: #525252;   
    --color-graphite: #3d3d3d;      
    --color-border: #e0e0e0;        
    --color-accent: #007bff;
    --color-accent-dark: #0056b3;
}

/* === БАЗОВЫЕ СТИЛИ САЙТА И СБРОСЫ === */
*, *::before, *::after { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
}
html { 
    scroll-behavior: smooth; 
    height: 100%; 
}
body {
    background-color: var(--color-bg-light);
    color: var(--color-text-dark);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.mono { 
    font-family: 'JetBrains Mono', monospace; 
}

.container {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
}
.content-wrapper {
    flex: 1;
    text-align: center;
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
    transform: translateY(20px);
}
@keyframes fadeInUp { 
    to { 
        opacity: 1; 
        transform: translateY(0); 
    } 
}

/* =============== ХЕДЕР V2 =============== */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    background-color: transparent; 
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.header--scrolled {
    background-color: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
}
.header-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 0.8rem;
    color: var(--color-text-medium);
    opacity: 0;
    transform: translateY(-15px);
    transition: all 0.3s ease;
    pointer-events: none;
}
.header--scrolled .header-top-bar { 
    opacity: 1; 
    transform: translateY(0); 
    pointer-events: auto; 
}
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 60px;
    padding: 20px 0;
    transition: padding 0.3s ease;
}
.header--scrolled .header-container { 
    padding: 15px 0; 
}
.logo {
    font-family: 'Turbo', sans-serif;
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    letter-spacing: -0.02em;
    text-decoration: none;
    color: var(--color-graphite);
    font-weight: 400;
}
.nav .nav-list {
    display: flex;
    gap: 40px;
    list-style: none;
    font-size: 0.95rem;
    font-weight: 500;
}
.nav-list a {
    color: var(--color-text-medium);
    text-decoration: none;
    position: relative;
    transition: color 0.2s;
    white-space: nowrap;
}
.nav-list a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -6px;
    height: 2px;
    width: 0;
    background-color: var(--color-accent);
    border-radius: 2px;
    transition: width 0.3s ease-out;
}
.nav-list a:hover { 
    color: var(--color-graphite); 
}
.nav-list a:hover::after { 
    width: 100%; 
}

/* =============== ОБЩИЕ ЭЛЕМЕНТЫ ФОРМ И ТЕКСТА =============== */
h1 { 
    font-size: clamp(2rem, 5vw, 3rem); 
    font-weight: 600; 
    margin-bottom: 30px; 
    line-height: 1.1; 
    color: var(--color-graphite); 
    text-align: center; 
}
label { 
    display: block; 
    margin-bottom: 15px; 
    font-weight: 500; 
    color: var(--color-text-medium); 
}
label > span { 
    display: block; 
    margin-bottom: 5px; 
    font-size: 0.9em; 
    font-weight: normal; 
    color: var(--color-text-dark); 
}
select, input[type="text"], input[type="number"], textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    background-color: #fafafa;
    transition: border-color 0.2s, box-shadow 0.2s;
}
select:focus, input:focus, textarea:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}
textarea[name="comment"] { resize: vertical; min-height: 80px; }
.hidden-row { overflow: hidden; transition: all 0.2s ease-in-out; height: 0; opacity: 0; margin-bottom: 0 !important; padding: 0 !important; }

.result-box { margin-top: 40px; }
#description-output {
    background-color: #f1f5f9;
    border: 1px solid #cbd5e1;
    padding: 15px;
    font-family: "Courier New", monospace;
    font-size: 1.1em;
    color: #2d3748;
    white-space: pre-wrap;
    word-break: break-all;
    min-height: 60px;
    border-radius: 6px;
    text-align: left;
}

.spec-block {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px dashed #cbd5e1;
    display: flex;
    align-items: center;
    gap: 15px;
}
.spec-block label {
    display: flex;
    flex-direction: column;
    font-weight: bold;
    font-size: 0.9em;
    color: #4b5563;
}
.spec-block input[type="number"] {
    margin-top: 5px;
    padding: 8px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    max-width: 80px;
    font-size: 1em;
}
button#add-to-spec-btn {
    margin-top: 5px;
    padding: 10px 20px;
    background-color: var(--color-accent);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s, transform 0.1s;
    align-self: flex-start;
}
button#add-to-spec-btn:hover { background-color: var(--color-accent-dark); }
button#add-to-spec-btn:active { transform: scale(0.98); }

@media (max-width: 600px) {
    .spec-block { flex-direction: column; align-items: stretch; gap: 12px; }
    button#add-to-spec-btn { align-self: stretch; width: 100%; }
}

/* ######################################################################## */
/* ############### ЕДИНАЯ АДАПТИВНАЯ СЕТКА КОНФИГУРАТОРА ################## */
/* ######################################################################## */
.grid-config {
    display: grid;
    /* Порядок важен: Название | Блок 1 | Блок 2 */
    grid-template-columns: 1fr 420px 420px;
    gap: 24px;
    align-items: start;
}
.section h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--color-graphite);
    margin-top: 0;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--color-border);
}
.area-side1,
.area-side2 {
    position: relative;
    min-height: 300px;
}
.config-card {
    background: linear-gradient(135deg, #fff 0%, #f9fbff 100%);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.config-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.08);
}
.config-card h2 {
    margin-top: 0;
    color: var(--color-graphite);
    font-size: 1.1rem;
}

/* Адаптивность конфигуратора */
@media (max-width: 1399px) {
    .grid-config {
        grid-template-columns: 1fr 1fr;
    }
    .area-side2 {
        grid-column: 1 / -1; 
    }
}
@media (max-width: 900px) {
    .grid-config {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    .section {
        grid-column: 1 / -1 !important;
    }
}

/* =============== ФУТЕР =============== */
.footer { 
    border-top: 1px solid var(--color-border); 
    padding-top: 32px; 
    color: var(--color-text-medium); 
    font-size: 0.9rem;
    flex-shrink: 0;
}
.site-footer {
    margin-top: 40px;
    padding-top: 30px;
    padding-bottom: 30px;
    border-top: 1px solid var(--color-border);
    text-align: center;
}
.site-footer p {
    margin: 0 0 8px 0;
    line-height: 1.6;
}
.contact-line .mono + .mono::before {
    content: " | ";
    opacity: 0.6;
}
.features-grid {
    display: grid;
    gap: 48px;
    margin: 40px auto 60px;
    max-width: 1200px;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
}
.product-card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    overflow: hidden;
    padding: 24px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: grid;
    grid-template-columns: 250px 1fr; 
    gap: 32px;
    align-items: start;
}
.image-wrapper {
    width: 250px;
    height: 250px;
    flex-shrink: 0;
    background-color: #f5f5f5;
    border-radius: 12px; 
    border: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.card-image {
    display: block;
    width: auto;
    max-width: 250px;
    height: auto;
    max-height: 250px;
    object-fit: contain;
    margin-left: auto;
    margin-right: auto;
}
.content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    height: 100%;
    gap: 16px;
    padding-left: 0;
}
.content h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--color-graphite);
    margin: 0;
    align-self: flex-start;
    width: 100%;
    text-align: left;
}
.content ul {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}
.content li { width: 100%; }
.content strong { white-space: normal; word-break: break-word; }
.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.08);
}
@media (max-width: 899px) {
    .features-grid { gap: 40px; }
    .product-card {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 24px;
        padding: 24px;
    }
    .image-wrapper { width: 200px; height: 200px; justify-self: center; }
    .content { justify-content: flex-start; align-items: stretch; text-align: left; height: auto; }
    .content h3 { align-self: stretch; text-align: left; }
    .content ul { align-items: flex-start; padding-left: 20px; gap: 6px; }
}
.two-columns-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
    margin-top: 40px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}
.optics-section .features-grid,
.copper-column .features-grid {
    display: grid;
    gap: 40px;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    margin: 0;
}
@media (max-width: 1199px) {
    .optics-section .features-grid,
    .copper-column .features-grid {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 992px) {
    .two-columns-layout {
        grid-template-columns: 1fr;
    }
}
.visually-hidden { 
    position: absolute !important; 
    width: 1px; 
    height: 1px; 
    overflow: hidden; 
    clip: rect(1px, 1px, 1px, 1px); 
    white-space: nowrap; 
}