/* --- Стили Inflation (Red Theme) --- */
:root {
    --accent-red: #EF4444;
    --accent-red-dark: #B91C1C;
    --accent-red-light: #FEF2F2;
    --accent-red-border: #FCA5A5;
    
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --shadow-soft: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius-lg: 16px;
    --font-main: 'Inter', sans-serif;
}

/* Base Layout */
.calc-header { margin-bottom: 32px; }
.subtitle { color: var(--text-secondary); margin-top: 8px; }

/* FIX: Z-Index и Overflow для выпадающего списка */
.calc-grid { 
    display: grid; 
    grid-template-columns: 1fr; 
    gap: 24px; 
    align-items: start; 
}
@media (min-width: 900px) { .calc-grid { grid-template-columns: 1.2fr 0.8fr; } }

/* КРИТИЧЕСКИ ВАЖНО: Разрешаем выпадающему списку выходить за пределы карточки */
.calc-inputs.card { 
    position: relative; 
    z-index: 50 !important; 
    overflow: visible !important; 
}
.calc-results { 
    position: relative; 
    z-index: 10; 
}

/* Inputs */
.calc-inputs { gap: 24px; }
.input-group { margin-bottom: 24px; }
.input-group label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; color: var(--text-primary); }
.input-wrapper { position: relative; display: flex; align-items: center; }

.input-wrapper input {
    width: 100%; padding: 16px; padding-right: 40px;
    font-size: 18px; font-weight: 500;
    border: 1px solid #E5E7EB; border-radius: 12px;
    outline: none; transition: border 0.2s; background: #fff;
    font-family: var(--font-main);
}
.input-wrapper input:focus { border-color: var(--accent-red); box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1); }
.currency { position: absolute; right: 16px; color: var(--text-secondary); pointer-events: none; }
.divider { border: 0; border-top: 1px solid #E5E7EB; margin: 24px 0; }

/* Custom Select (Как в Kitchen) */
.calc-select-hidden { display: none; }
.custom-select { position: relative; width: 100%; }

.custom-select-trigger {
    position: relative; display: flex; align-items: center; justify-content: space-between;
    width: 100%; padding: 16px; 
    font-size: 16px; font-weight: 500; font-family: var(--font-main);
    color: var(--text-primary); background: #fff;
    border: 1px solid #E5E7EB; border-radius: 12px; cursor: pointer;
    transition: all 0.2s; box-sizing: border-box;
}
.custom-select-trigger:hover { border-color: #D1D5DB; }
.custom-select.open .custom-select-trigger { border-color: var(--accent-red); box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1); }

.custom-arrow {
    width: 10px; height: 10px; border-right: 2px solid #9CA3AF; border-bottom: 2px solid #9CA3AF;
    transform: rotate(45deg); transition: transform 0.2s; margin-left: 12px; margin-bottom: 2px;
}
.custom-select.open .custom-arrow { transform: rotate(-135deg); margin-bottom: -2px; border-color: var(--accent-red); }

/* Список поверх всего */
.custom-options {
    position: absolute; top: calc(100% + 8px); left: 0; right: 0;
    background: #fff; border: 1px solid #E5E7EB; border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2); 
    z-index: 9999; /* Максимальный слой */
    opacity: 0; visibility: hidden;
    transform: translateY(-10px); transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    max-height: 300px; overflow-y: auto;
}
.custom-select.open .custom-options { opacity: 1; visibility: visible; transform: translateY(0); }

.custom-option {
    padding: 14px 16px; font-size: 15px; cursor: pointer; transition: background 0.1s;
    border-bottom: 1px solid #F3F4F6; color: var(--text-primary);
}
.custom-option:last-child { border-bottom: none; }
.custom-option:hover { background: var(--accent-red-light); color: var(--accent-red-dark); }
.custom-option.selected { background: var(--accent-red-light); color: var(--accent-red-dark); font-weight: 600; }

/* Range Slider */
.range-wrapper { display: flex; align-items: center; gap: 16px; }
.range-wrapper input[type=range] { flex: 1; accent-color: var(--accent-red); }
.range-value { font-weight: 700; color: var(--accent-red); width: 60px; text-align: right; }

/* --- RESULT CARD (Clean Style) --- */
.card--result {
    background: #fff;
    border: 1px solid var(--accent-red-border);
    border-top: 4px solid var(--accent-red);
    box-shadow: var(--shadow-soft);
}
.card--result h2 { 
    color: var(--text-primary); margin-bottom: 24px; text-align: center; font-size: 18px; opacity: 0.8;
}
@media (min-width: 900px) { .sticky-card { position: sticky; top: 24px; } }

.fuel-price-big { 
    font-size: 48px; font-weight: 800; line-height: 1; 
    margin-bottom: 32px; display: flex; justify-content: center; align-items: baseline; gap: 8px;
    color: var(--text-primary);
}
.fuel-price-big small { font-size: 24px; opacity: 0.6; font-weight: 600; }

/* --- NEW VISUALIZATION: POWER PILLARS --- */
.bars-wrapper {
    display: flex; justify-content: center; align-items: flex-end; gap: 24px;
    height: 180px; margin-bottom: 32px; padding-bottom: 10px;
    border-bottom: 1px solid #E5E7EB;
}

.bar-col {
    display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
    width: 80px; height: 100%;
}

/* Сами столбики */
.bar-fill {
    width: 100%;
    border-radius: 8px 8px 0 0;
    transition: height 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.3s;
    min-height: 4px;
    position: relative;
}

/* Стиль левого (Было) */
.fill-start {
    background: #E5E7EB; /* Серый */
    height: 100%; /* Всегда полный */
}

/* Стиль правого (Стало) */
.fill-end {
    background: var(--accent-red); /* Красный */
    height: 50%; /* JS меняет это */
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4); /* Свечение */
}

/* Текст над/под столбиками */
.bar-val {
    margin-bottom: 8px; font-weight: 800; font-size: 14px; color: var(--text-primary);
}
.bar-label {
    margin-top: 12px; font-size: 12px; text-transform: uppercase; 
    color: var(--text-secondary); font-weight: 700; letter-spacing: 0.5px;
}

/* Блок статистики */
.split-cost-box { 
    background: var(--accent-red-light); 
    border-radius: 12px; padding: 16px; 
    border: 1px solid var(--accent-red-border);
}
.split-row { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 14px; color: var(--text-primary); }
.split-row:last-child { margin-bottom: 0; }
.split-row strong { font-size: 16px; }

.summary-divider { height: 1px; background: #E5E7EB; margin: 24px 0; }

.tip-box { 
    font-size: 14px; line-height: 1.5; color: var(--text-secondary);
}
.tip-box strong { color: var(--text-primary); }

/* --- НИЖНИЙ БЛОК (SEO) --- */
.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; }
.blue-icon svg { color: #3B82F6; }
.orange-icon svg { color: #F97316; }
.red-icon svg { color: #EF4444; }

.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; display: flex; flex-direction: column; }
.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; }
.formula-card p { font-size: 14px; color: var(--text-secondary); margin: 0; line-height: 1.5; font-weight: 500; }
.badge-blue { background: #3B82F6; color: #fff; padding: 6px 12px; border-radius: 99px; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.badge-red { background: #EF4444; color: #fff; padding: 6px 12px; border-radius: 99px; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.math-expression { background: #F9FAFB; border: 1px solid #E5E7EB; padding: 12px 16px; border-radius: 12px; font-weight: 700; color: var(--accent-red-dark); text-align: center; margin-bottom: 16px; font-size: 15px; }

/* Table */
.table-wrapper { overflow-x: auto; margin-bottom: 24px; border-radius: 12px; border: 1px solid #E5E7EB; }
.comparison-table { width: 100%; border-collapse: collapse; min-width: 500px; }
.comparison-table th { background: #F9FAFB; padding: 12px 16px; text-align: left; font-size: 13px; text-transform: uppercase; color: var(--text-secondary); font-weight: 700; border-bottom: 1px solid #E5E7EB; }
.comparison-table td { padding: 16px; font-size: 14px; color: var(--text-primary); border-bottom: 1px solid #F3F4F6; }
.comparison-table tr:last-child td { border-bottom: none; }
.comparison-table tr:hover td { background: #FEF2F2; }

/* Links */
.info-wrapper a {
    color: var(--accent-red-dark); text-decoration: underline; text-decoration-color: rgba(185, 28, 28, 0.3); font-weight: 600; transition: all 0.2s ease;
}
.info-wrapper a:hover { color: var(--accent-red); background: rgba(239, 68, 68, 0.05); border-radius: 4px; }

.soft-divider { border: none; height: 1px; background: linear-gradient(90deg, transparent, #E5E7EB, transparent); margin: 48px 0; }

/* FAQ */
.faq-fuel-style .faq-item { background: #fff; border: 1px solid #E5E7EB; border-radius: 12px; margin-bottom: 12px; overflow: hidden; transition: all 0.2s ease; }
.faq-fuel-style .faq-item[open] { border-color: var(--accent-red); box-shadow: 0 4px 20px rgba(239, 68, 68, 0.1); }
.faq-fuel-style summary.faq-question { padding: 16px 20px; cursor: pointer; font-weight: 600; color: var(--text-primary); list-style: none; display: flex; justify-content: space-between; align-items: center; }
.faq-fuel-style .faq-item[open] summary.faq-question { color: var(--accent-red-dark); background: var(--accent-red-light); }
.faq-question::after { content: '+'; font-size: 20px; color: var(--text-secondary); font-weight: 400; line-height: 1; }
.faq-fuel-style .faq-item[open] summary.faq-question::after { content: '−'; color: var(--accent-red-dark); }
.faq-answer { padding: 20px; color: var(--text-secondary); line-height: 1.6; font-size: 15px; }

/* Mobile */
@media (max-width: 900px) {
    .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; }
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }