/* --- Стили для Кухни (Wheat Theme) --- */
:root {
    --accent-wheat: #D97706; /* Amber 600 */
    --accent-wheat-light: #FEF3C7;
    --gradient-wheat-card: linear-gradient(135deg, #FBBF24 0%, #D97706 100%);
    --fill-color: #FFFBEB; /* Цвет наполнителя */
}

.calc-header { margin-bottom: 32px; }
.subtitle { color: var(--text-secondary); margin-top: 8px; }

.calc-grid { display: grid; grid-template-columns: 1fr; gap: 24px; align-items: start; }
@media (min-width: 900px) { .calc-grid { grid-template-columns: 1fr 1fr; } }

/* --- FIX: STACKING CONTEXT --- */
.calc-inputs.card {
    position: relative;
    z-index: 50 !important;
    overflow: visible !important;
}
.calc-results {
    position: relative;
    z-index: 10;
}

/* Inputs */
.calc-inputs { gap: 16px; }
.input-group { margin-bottom: 16px; }
.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: 14px 16px; padding-right: 40px;
    font-size: 18px; font-weight: 500;
    border: 1px solid #E5E7EB; border-radius: 12px;
    outline: none; transition: border 0.2s, box-shadow 0.2s;
    font-family: var(--font-main);
}
.input-wrapper input:focus { border-color: var(--accent-wheat); box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.15); }
.suffix { position: absolute; right: 16px; color: var(--text-secondary); pointer-events: none; }

/* --- CUSTOM SELECT --- */
.calc-select-hidden { display: none; }
.custom-select { position: relative; user-select: none; width: 100%; }

.custom-select-trigger {
    position: relative; display: flex; align-items: center; justify-content: space-between;
    width: 100%; padding: 14px 16px; font-size: 16px; font-weight: 500;
    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-wheat); box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.15); }

.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-wheat); }

.custom-options {
    position: absolute; top: calc(100% + 8px); left: 0; right: 0;
    background: #fff; border: 1px solid #E5E7EB; border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2); z-index: 100; 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-group-label {
    padding: 8px 16px; font-size: 11px; font-weight: 700; color: var(--text-secondary);
    background: #F9FAFB; text-transform: uppercase; letter-spacing: 0.05em;
    pointer-events: none; position: sticky; top: 0; z-index: 2; border-bottom: 1px solid #E5E7EB;
}
.custom-option {
    padding: 12px 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-wheat-light); color: #92400E; }
.custom-option.selected { background: var(--accent-wheat-light); color: #92400E; font-weight: 600; }

/* Mode Switcher */
.mode-switcher {
    display: flex; background: #F3F4F6; padding: 4px;
    border-radius: 12px; margin-bottom: 24px; gap: 4px;
}
.mode-btn {
    flex: 1; padding: 10px 4px; border: none; background: transparent;
    color: var(--text-secondary); font-size: 13px; font-weight: 600;
    border-radius: 8px; cursor: pointer; transition: all 0.2s; text-align: center;
}
.mode-btn.active { background: #fff; color: var(--text-primary); box-shadow: 0 2px 8px rgba(0,0,0,0.05); }

/* Unit Selector */
.unit-selector { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.unit-option { cursor: pointer; }
.unit-option input { display: none; }
.unit-card {
    border: 1px solid #E5E7EB; border-radius: 12px; padding: 10px 4px;
    display: flex; flex-direction: column; align-items: center; text-align: center;
    transition: all 0.2s; background: #fff; height: 100%; color: var(--text-secondary);
}
.u-icon { font-size: 24px; margin-bottom: 4px; }
.unit-card span { font-size: 12px; font-weight: 600; }
.unit-card small { font-size: 10px; opacity: 0.8; }

.unit-option input:checked + .unit-card {
    border-color: var(--accent-wheat); background: var(--accent-wheat-light);
    color: #92400E; box-shadow: 0 4px 12px rgba(217, 119, 6, 0.15);
}

/* --- Результаты (Wheat Card) --- */
.card--wheat { 
    background: var(--gradient-wheat-card); 
    color: #fff; 
    border: none; 
    position: relative; overflow: hidden;
}
.card--wheat h2 { color: rgba(255,255,255,0.95); margin-bottom: 16px; font-size: 16px; }
@media (min-width: 900px) { .sticky-card { position: sticky; top: 24px; } }

/* ИСПРАВЛЕНО: Центрирование контента */
.result-compact-row {
    display: flex; 
    align-items: center; 
    justify-content: center; /* Центрируем группу */
    gap: 40px; /* Отступ между цифрами и стаканом */
    margin-bottom: 16px;
    margin-top: 12px;
}

.kitchen-result-big {
    font-size: 48px; font-weight: 800; line-height: 1; 
    display: flex; flex-direction: column; align-items: flex-start;
}
.kitchen-result-big small { font-size: 16px; font-weight: 600; opacity: 0.9; margin-top: 4px; }

/* Мерный стакан */
.measuring-cup-box {
    display: flex; align-items: flex-end; 
}

.cup-glass {
    width: 80px; /* Чуть шире (было 70) */
    height: 120px;
    border: 3px solid rgba(255,255,255,0.6); border-top: none;
    border-radius: 4px 4px 16px 16px;
    position: relative;
    background: rgba(255,255,255,0.1);
    display: flex; align-items: flex-end;
    overflow: hidden; 
}

.cup-fill {
    width: 100%; height: 0%; 
    background: var(--fill-color);
    transition: height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border-top: 1px solid rgba(255,255,255,0.9);
    opacity: 0.95;
    position: absolute; bottom: 0; left: 0;
}

/* Метки шкалы */
.cup-lines {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 2; pointer-events: none;
}

.cup-lines span {
    position: absolute;
    right: 0;
    width: 25%; 
    border-bottom: 1px solid rgba(0,0,0,0.3);
    font-size: 8px;
    color: rgba(0,0,0,0.6); 
    font-weight: 700;
    line-height: 1;
    text-align: right;
    padding-right: 2px;
}

/* Расстановка меток (Максимум 250мл = 85% высоты) */
.cup-lines span:nth-child(1) { bottom: 85%; border-bottom: none; }
.cup-lines span:nth-child(2) { bottom: 68%; }
.cup-lines span:nth-child(3) { bottom: 51%; }
.cup-lines span:nth-child(4) { bottom: 34%; }
.cup-lines span:nth-child(5) { bottom: 17%; }

/* Компактный блок с весом */
.cup-label-compact {
    display: flex; gap: 8px; align-items: baseline; justify-content: center; /* Центрируем подписи */
    margin-top: 8px;
}
.cup-label-compact span { font-size: 13px; opacity: 0.9; }
#visual-weight { font-size: 20px; font-weight: 700; }

.summary-divider { height: 1px; background: rgba(255,255,255,0.2); margin: 20px 0; }

.tip-box {
    font-size: 13px; line-height: 1.5; color: #ffffff !important;
    background: rgba(0, 0, 0, 0.2); padding: 12px 16px; border-radius: 12px;
}
.tip-box p { margin: 0; color: #ffffff !important; }

/* --- НОВЫЕ ИНФОРМАЦИОННЫЕ БЛОКИ (Адаптация под Wheat/Kitchen) --- */

.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: #D97706; }
.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: 0 4px 20px rgba(0,0,0,0.03);
    border-radius: 24px; 
    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: 0 12px 32px rgba(0,0,0,0.08); }

/* Вертикальный хедер (бейдж сверху) */
.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;
}

.formula-card small {
    display: block; margin-top: 12px; font-size: 12px; color: var(--text-secondary); opacity: 0.7;
}

.math-expression {
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    padding: 12px 16px;
    border-radius: 12px;
    font-weight: 700;
    color: var(--accent-wheat); /* Wheat Accent */
    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 (Новый стиль под Wheat) */
.faq-section .faq-item {
    background: #fff; border: 1px solid #E5E7EB;
    border-radius: 12px; margin-bottom: 12px;
    overflow: hidden; transition: all 0.2s ease;
}

.faq-section .faq-item[open] {
    border-color: var(--accent-wheat); 
    box-shadow: 0 4px 20px rgba(217, 119, 6, 0.15); /* Accent Shadow */
}

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;
}

summary.faq-question:hover { background-color: #F9FAFB; }

.faq-section .faq-item[open] summary.faq-question {
    color: var(--accent-wheat);
    background: var(--accent-wheat-light);
}

.faq-question::after {
    content: '+'; font-size: 20px;
    color: var(--text-secondary); font-weight: 400; line-height: 1;
}
.faq-question .icon-plus { display: none; }

.faq-section .faq-item[open] summary.faq-question::after {
    content: '−'; color: var(--accent-wheat);
}

.faq-answer {
    padding: 20px; color: var(--text-secondary);
    line-height: 1.6; font-size: 15px;
}

/* --- МОБИЛЬНАЯ АДАПТАЦИЯ --- */
@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; }
}