/* --- Roof Calculator (Universal) --- */
:root {
    --roof-orange: #F97316;
    --roof-orange-grad: linear-gradient(135deg, #F97316 0%, #EA580C 100%);
    --roof-slate: #64748B;
    --roof-slate-grad: linear-gradient(135deg, #64748B 0%, #475569 100%);
    --roof-ond: #991B1B;
    --roof-ond-grad: linear-gradient(135deg, #991B1B 0%, #7F1D1D 100%);
}

.calc-header { margin-bottom: 24px; }
.subtitle { color: var(--text-secondary); margin-top: 8px; font-size: 14px; }

/* Grid */
.calc-grid { display: grid; grid-template-columns: 1fr; gap: 32px; align-items: start; }
@media (min-width: 900px) { 
    .calc-grid { grid-template-columns: 1.1fr 0.9fr; gap: 40px; } 
}

/* Material Selector */
.material-selector { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 12px; 
}
@media (max-width: 600px) {
    .material-selector { display: flex; overflow-x: auto; padding-bottom: 4px; gap: 12px; }
    .mat-option { flex: 0 0 100px; }
}

.mat-option { cursor: pointer; position: relative; }
.mat-option input { position: absolute; opacity: 0; }
.mat-card {
    border: 1px solid #E5E7EB; border-radius: 12px; padding: 12px 4px;
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    background: #fff; transition: all 0.2s; height: 100%;
}
.mat-icon { width: 36px; height: 36px; border-radius: 8px; }
.mat-option span { font-size: 13px; font-weight: 600; color: var(--text-secondary); text-align: center; line-height: 1.2;}

.metal-icon { background: linear-gradient(135deg, #FDBA74, #EA580C); box-shadow: 0 2px 4px rgba(234, 88, 12, 0.3); }
.slate-icon { background: repeating-linear-gradient(45deg, #94A3B8, #94A3B8 5px, #CBD5E1 5px, #CBD5E1 10px); box-shadow: 0 2px 4px rgba(100, 116, 139, 0.3); }
.ond-icon { background: linear-gradient(135deg, #EF4444, #991B1B); box-shadow: 0 2px 4px rgba(153, 27, 27, 0.3); }

.mat-option input:checked + .mat-card { border-color: var(--roof-orange); background: #FFF7ED; box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.mat-option input[value="slate"]:checked + .mat-card { border-color: var(--roof-slate); background: #F1F5F9; }
.mat-option input[value="onduline"]:checked + .mat-card { border-color: var(--roof-ond); background: #FEF2F2; }

/* Inputs */
.input-group { margin-bottom: 20px; }
.input-group label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; color: var(--text-primary); }
.sub-label { font-size: 11px !important; margin-bottom: 4px !important; opacity: 0.8; }

.input-wrapper { position: relative; display: flex; align-items: center; }
.input-wrapper input { 
    width: 100%; padding: 14px; padding-right: 40px; 
    font-size: 16px; font-weight: 500; border: 1px solid #E5E7EB; 
    border-radius: 12px; outline: none; transition: 0.2s; 
    font-family: var(--font-main);
    background: #fff; 
}
.input-wrapper input:focus { border-color: var(--roof-orange); box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1); }
.suffix { position: absolute; right: 14px; color: var(--text-secondary); pointer-events: none; font-size: 13px;}

.row-2-col { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 500px) { .row-2-col { grid-template-columns: 1fr 1fr; gap: 16px; } }
.mt-2 { margin-top: 12px; }

/* Options */
.options-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.option-card { position: relative; cursor: pointer; }
.option-card input { position: absolute; opacity: 0; }
.option-content { 
    border: 1px solid #E5E7EB; border-radius: 12px; padding: 12px; 
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; background: #fff; transition: 0.2s; height: 100%; min-height: 80px;
}
.opt-icon-mini { margin-top: 6px; color: #9CA3AF; }
.opt-title { font-weight: 600; font-size: 14px; }
.option-card input:checked + .option-content { border-color: var(--roof-orange); background: #FFF7ED; color: #EA580C; }

/* Price Select */
.price-mode-switch select {
    width: 100%; height: 100%; border: 1px solid #E5E7EB; border-radius: 12px;
    padding: 0 12px; font-size: 14px; background: #fff; outline: none; 
    color: var(--text-secondary); min-height: 48px;
}

/* Result Card */
.card--result { color: #fff; border: none; padding: 20px; border-radius: 16px; }
.card--result h2 { color: rgba(255,255,255,0.95); font-size: 18px; margin-bottom: 16px; text-align: center;}

.card--orange { background: var(--roof-orange-grad); }
.card--slate { background: var(--roof-slate-grad); }
.card--ond { background: var(--roof-ond-grad); }

/* Visualization */
.roof-visual-box {
    background: #fff; border-radius: 12px; padding: 10px; margin-bottom: 20px;
    height: 300px; 
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15); overflow: hidden;
}
@media (min-width: 600px) { .roof-visual-box { height: 360px; padding: 20px; } }

.visual-legend { display: flex; gap: 12px; font-size: 11px; color: #4B5563; margin-top: 12px; flex-wrap: wrap; justify-content: center; }
.visual-legend span { display: flex; align-items: center; gap: 6px; background: rgba(255,255,255,0.5); padding: 4px 8px; border-radius: 4px; }

.dot-sheet { width: 10px; height: 10px; border: 1px solid rgba(0,0,0,0.2); }

.dot-overlap { 
    width: 14px; height: 14px; 
    background: repeating-linear-gradient(
      -45deg, 
      rgba(0,0,0,0.3), 
      rgba(0,0,0,0.3) 2px, 
      transparent 2px, 
      transparent 4px
    );
    border: 1px solid rgba(0,0,0,0.3);
}

.dot-waste { 
    width: 14px; height: 14px; 
    background: repeating-linear-gradient(45deg, #fff, #fff 2px, #FECACA 2px, #FECACA 4px);
    border: 1px dashed #EF4444; 
}

/* Summary */
.summary-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 20px; background: rgba(255,255,255,0.15); padding: 12px; border-radius: 12px; }
.sum-col { display: flex; flex-direction: column; align-items: center; text-align: center; }
.sum-col span { font-size: 10px; opacity: 0.9; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.sum-col strong { font-size: 14px; font-weight: 700; word-break: break-all; }
@media (min-width: 400px) { .sum-col strong { font-size: 16px; } }

.detail-row { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,0.2); padding-bottom: 6px; }
.detail-row:last-child { border: none; }


/* --- НОВЫЕ ИНФОРМАЦИОННЫЕ БЛОКИ --- */

.info-wrapper {
    padding: 60px 0 60px 0;
    margin-top: 60px;
    border-top: 1px solid rgba(0,0,0,0.06);
    margin-bottom: 20px;
}

.info-wrapper .container {
    max-width: 800px;
    margin: 0 auto;
}

/* Заголовки с иконками */
.icon-heading {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.3;
}

.header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
    flex-shrink: 0;
    margin-top: -4px;
}

.header-icon svg { width: 24px; height: 24px; stroke-width: 2px; }

/* Цвета иконок */
.blue-icon svg { color: #2563EB; }
.orange-icon svg { color: var(--roof-orange); }
.green-icon svg { color: #10B981; }
.red-icon svg { color: #EF4444; }

/* Маленькие подзаголовки */
.small-heading {
    margin-top: 40px;
    margin-bottom: 16px;
    font-size: 20px;
}
.small-heading .header-icon { width: 40px; height: 40px; }
.small-heading .header-icon svg { width: 20px; height: 20px; }

.intro-text {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.6;
}

/* --- Секция Формул --- */
.formulas-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 48px;
}

.formula-card {
    background: #fff;
    border: 1px solid rgba(0,0,0,0.04);
    box-shadow: var(--shadow-soft);
    border-radius: var(--radius-lg); 
    padding: 24px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
}
.formula-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }

/* Вертикальный хедер (бейдж сверху) */
.formula-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.formula-card h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

/* Бейджи */
.badge-blue {
    background: #2563EB; color: #fff;
    padding: 6px 12px; border-radius: 99px;
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.05em;
    display: inline-block;
}
.badge-green {
    background: #10B981; color: #fff;
    padding: 6px 12px; border-radius: 99px;
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.05em;
    display: inline-block;
}

.formula-card p {
    font-size: 14px; color: var(--text-secondary);
    margin: 0; line-height: 1.5; font-weight: 500;
}

.math-expression {
    background: #FFF7ED; /* Светло-оранжевый фон */
    border: 1px solid #FFEDD5;
    padding: 12px 16px;
    border-radius: 12px;
    font-weight: 700;
    color: #EA580C; /* Темно-оранжевый для текста */
    text-align: center;
    margin-bottom: 16px;
    font-size: 15px;
}

/* Разделитель */
.soft-divider {
    border: none; height: 1px;
    background: linear-gradient(90deg, transparent, #E5E7EB, transparent);
    margin: 48px 0;
}

/* Описание */
.calc-description p {
    font-size: 16px; line-height: 1.7;
    color: var(--text-secondary); margin-bottom: 24px;
}
.calc-description strong { color: var(--text-primary); }

/* FAQ (Стиль Roof) */
.faq-roof-style .faq-item {
    background: #fff; border: 1px solid #E5E7EB;
    border-radius: 12px; margin-bottom: 12px;
    overflow: hidden; transition: all 0.2s ease;
}

.faq-roof-style .faq-item[open] {
    border-color: var(--roof-orange); 
    box-shadow: 0 4px 20px rgba(249, 115, 22, 0.1);
}

.faq-roof-style summary.faq-question {
    padding: 16px 20px; cursor: pointer;
    font-weight: 600; color: var(--text-primary);
    list-style: none; position: relative;
    display: flex; justify-content: space-between;
    align-items: center; transition: background 0.2s;
}

.faq-roof-style summary.faq-question:hover { background-color: #F9FAFB; }

.faq-roof-style .faq-item[open] summary.faq-question {
    color: #C2410C;
    background: #FFF7ED; /* Светло-оранжевый */
}

.faq-question::after {
    content: '+'; font-size: 20px;
    color: var(--text-secondary); font-weight: 400; line-height: 1;
}
.faq-question .icon-plus { display: none; }

.faq-roof-style .faq-item[open] summary.faq-question::after {
    content: '−'; color: var(--roof-orange);
}

.faq-answer {
    padding: 20px; color: var(--text-secondary);
    line-height: 1.6; font-size: 15px;
}

/* --- МОБИЛЬНАЯ АДАПТАЦИЯ --- */
@media (max-width: 900px) {
    /* Сетка в 1 колонку */
    .formulas-grid { grid-template-columns: 1fr; gap: 16px; margin-bottom: 32px; }
    
    /* Уменьшаем шрифты */
    .icon-heading { font-size: 20px; gap: 12px; margin-bottom: 20px; }
    .header-icon { width: 40px; height: 40px; border-radius: 12px; }
    .header-icon svg { width: 20px; height: 20px; }
    
    /* Центрирование контента карточки */
    .formula-card { 
        padding: 24px; 
        text-align: center; 
        align-items: center; 
    }

    .formula-header {
        align-items: center;
        width: 100%;
    }

    /* Блок с формулой по центру */
    .math-expression {
        width: 100%;
        max-width: 300px;
        margin-left: auto;
        margin-right: auto;
    }

    .info-wrapper { margin-top: 40px; padding-top: 40px; }
}