/* =====================================================
   СТРАНИЦА КЕЙСА (gaz.html)
===================================================== */

.case-page {
    background: radial-gradient(circle at 50% 0%, rgba(25, 82, 170, 0.15), transparent 60%);
    min-height: 100vh;
    padding-bottom: 100px;
    padding-top: 40px; 
}

/* =====================================================
   HERO СЕКЦИЯ (2 КОЛОНКИ)
===================================================== */

.case-hero {
    width: min(1600px, calc(100% - 80px));
    margin: 0 auto 80px; 
    display: grid;
    grid-template-columns: minmax(auto, 750px) 1fr; 
    gap: 60px;
    align-items: center;
}

.case-hero-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* Кнопка "Вернуться на главную" (Стекло) */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 40px;
    padding: 10px 18px;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 8px;
    color: #aeb8c8;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    text-decoration: none;
}

.back-link:hover {
    background: rgba(50,132,255,.1);
    border-color: #3284ff;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(50,132,255,.15);
}

.back-link span {
    font-size: 16px;
    line-height: 1;
}

/* Логотип внутри Hero */
.hero-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 35px; 
    margin-bottom: 30px;
}

.case-hero h1 {
    font-size: clamp(40px, 5vw, 64px);
    line-height: 1.1;
    letter-spacing: -2px;
    margin: 0;
    color: #ffffff;
}

.case-hero .hero-description {
    font-size: 18px;
    color: #aeb8c8;
    max-width: 700px;
    margin: 25px 0 30px 0;
}

/* Сетка для цифр справа (2x4) */
.case-hero-stats {
    display: grid;
    grid-template-columns: 1fr 1fr; /* 2 колонки */
    gap: 12px;
    width: 100%;
    max-width: 500px; /* Ограничиваем ширину */
}

.stat-card {
    background: rgba(255,255,255,.02);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 14px;
    padding: 18px 15px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: border-color 0.3s;
}

.stat-card:hover {
    border-color: rgba(50,132,255,.3);
}

.stat-card strong {
    display: block;
    font-size: 24px;
    font-weight: 800;
    color: #3284ff;
    margin-bottom: 4px;
}

.stat-card span {
    font-size: 14px;
    font-weight: 500;
    color: #aeb8c8;
    line-height: 1.4;
}

.stat-card small {
    font-size: 11px;
    font-weight: 500;
    color: #65758d;
    display: block;
    margin-top: 4px;
}

/* =====================================================
   КОНФИГУРАТОР (3 КОЛОНКИ)
===================================================== */

.case-demo-wrapper {
    width: min(1760px, calc(100% - 80px));
    margin: 0 auto 100px;
}

/* Сетка: Левая панель (320px) - Центр (1fr) - Правая панель (320px) */
.configurator-layout {
    display: grid;
    grid-template-columns: 320px 1fr 320px;
    gap: 20px;
    height: 70vh;
    min-height: 600px;
}

/* Боковые панели (стеклянные карточки) */
.config-sidebar {
    background: rgba(255,255,255,.02);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 14px;
    padding: 25px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.config-sidebar::-webkit-scrollbar { width: 4px; }
.config-sidebar::-webkit-scrollbar-thumb { background: rgba(50,132,255,.3); border-radius: 4px; }

.config-sidebar h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,.08);
    padding-bottom: 15px;
}

/* Блоки выбора (Цвет, Назначение) */
.config-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.config-group label {
    font-size: 12px;
    color: #78869a;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.config-select {
    width: 100%;
    padding: 12px 15px;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    outline: none;
    cursor: pointer;
    appearance: none;
    transition: border-color 0.2s;
}

.config-select:focus { border-color: #3284ff; }
.config-select option { background: #0b111a; color: #fff; }

/* Центральная колонка с 3D */
.config-center {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
}

.case-iframe-container {
    width: 100%;
    height: 100%;
    position: relative;
    background: #080d15;
    border: 1px solid rgba(48,125,240,.45);
    border-radius: 22px;
    box-shadow: 0 25px 70px rgba(0,0,0,.35);
    overflow: hidden;
}

.config-center iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Правая колонка - Список опций */
.receipt-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.receipt-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: #aeb8c8;
    line-height: 1.4;
    animation: fadeIn 0.3s ease;
}

.receipt-item.base-item { color: #fff; font-weight: 600; }
.receipt-item .price { color: #3284ff; white-space: nowrap; }
.receipt-item .name { flex: 1; }

/* Итоговая сумма */
.receipt-total {
    margin-top: auto;
    padding-top: 20px;
    border-top: 2px solid rgba(50,132,255,.4);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.receipt-total span {
    font-size: 12px;
    color: #78869a;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.receipt-total strong {
    font-size: 32px;
    color: #3284ff;
    font-weight: 800;
    letter-spacing: -1px;
}

/* Кнопки опций в левой колонке */
.ui-options-list { display: flex; flex-direction: column; gap: 8px; }

.ui-option-btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 8px;
    padding: 12px;
    color: #aeb8c8;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
}

.ui-option-btn:hover { background: rgba(255,255,255,.05); }
.ui-option-btn strong { color: #fff; }

.ui-option-btn.checked {
    border-color: #3284ff;
    background: rgba(50,132,255,.1);
    color: #fff;
}

.ui-option-btn.checked strong { color: #3284ff; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =====================================================
   БЛОК "ЗАДАЧА И РЕШЕНИЕ"
===================================================== */

.case-details {
    width: min(1600px, calc(100% - 80px));
    margin: 0 auto 100px;
}

.case-details-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.detail-block {
    background: rgba(255,255,255,.02);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 14px;
    padding: 30px;
}

.detail-block h3 {
    font-size: 20px;
    color: #ffffff;
    margin-top: 0;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    padding-bottom: 10px;
}

.detail-block p {
    color: #aeb8c8;
    line-height: 1.6;
    font-size: 15px;
    margin: 0;
}

.detail-block strong { color: #3284ff; }

/* Финальный CTA */
.case-cta {
    width: min(1600px, calc(100% - 80px));
    margin: 0 auto;
}

/* =====================================================
   АДАПТИВ
===================================================== */

@media (max-width: 1200px) {
    .configurator-layout { grid-template-columns: 280px 1fr 280px; }
}

@media (max-width: 1100px) {
    .case-hero {
        grid-template-columns: 1fr;
        margin-top: 20px;
    }
    .case-hero-stats { grid-template-columns: repeat(4, 1fr); max-width: 100%; }
    
    /* Убираем фиксированную высоту на планшетах */
    .viewer {
        height: auto;
        min-height: auto;
    }
    .viewer-body { flex: none; }
    .viewer-frame {
        height: 450px;
        flex: none;
    }
    .viewer-open { border-radius: 0 0 22px 22px; }
}

@media (max-width: 900px) {
    .case-details-grid { grid-template-columns: 1fr; }
    
    .configurator-layout {
        grid-template-columns: 1fr;
        height: auto;
        min-height: auto;
    }
    
    .config-center {
        height: 50vh;
        min-height: 400px;
        order: -1;
        margin-bottom: 20px;
    }
    
    .config-sidebar { max-height: 500px; }
}

@media (max-width: 700px) {
    .case-iframe-container { min-height: 300px; }
    .case-hero-stats { grid-template-columns: 1fr 1fr; }
    .viewer-frame { height: 350px; }
}