/* style_calc.css — современные стили для инструментов */
.calc-modern {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: #1a1a2e;
    background: #f8f9fc;
    padding: 24px;
    border-radius: 16px;
    margin: 20px auto;
    max-width: 1200px;
    box-sizing: border-box;
    text-align: left;
}

.calc-modern *,
.calc-modern *::before,
.calc-modern *::after {
    box-sizing: border-box;
}

.calc-header {
    text-align: center;
    margin-bottom: 28px;
}

.calc-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #0c446b;
    margin: 0 0 8px;
    letter-spacing: -0.5px;
}

.calc-header p {
    color: #6b7a8a;
    margin: 0;
    font-size: 15px;
}

.calc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: start;
}

@media (max-width: 800px) {
    .calc-grid {
        grid-template-columns: 1fr;
    }
}

.calc-panel {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.calc-section {
    margin-bottom: 24px;
}

.calc-section:last-child {
    margin-bottom: 0;
}

.calc-section h2 {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #8a9bae;
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eef2f6;
}

.calc-field {
    margin-bottom: 14px;
}

.calc-field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #3a5a7a;
    margin-bottom: 5px;
}

.calc-field input[type="number"],
.calc-field select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dce4ec;
    border-radius: 8px;
    font-size: 14px;
    color: #1a1a2e;
    background: #fff;
    outline: none;
    transition: border-color 0.15s;
}

.calc-field input[type="number"]:focus,
.calc-field select:focus {
    border-color: #0c446b;
    box-shadow: 0 0 0 3px rgba(12,68,107,0.08);
}

.calc-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

.calc-radio-group {
    display: flex;
    gap: 16px;
}

.calc-radio-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 400;
    cursor: pointer;
}

.calc-btn-primary {
    width: 100%;
    padding: 12px;
    background: #0c446b;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.calc-btn-primary:hover {
    background: #0a3554;
}

.calc-result-panel {
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.calc-placeholder {
    text-align: center;
    color: #a0b0c0;
    font-size: 14px;
}

.calc-result-block {
    text-align: center;
    margin-bottom: 24px;
}

.calc-result-main {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 6px;
}

.calc-big-number {
    font-size: 48px;
    font-weight: 800;
    color: #0c446b;
    letter-spacing: -2px;
}

.calc-unit {
    font-size: 16px;
    color: #6b7a8a;
}

.calc-result-detail {
    font-size: 12px;
    color: #8a9bae;
    margin-top: 4px;
}

.calc-macros {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
}

.calc-macro-item {
    background: #f4f7fb;
    border-radius: 10px;
    padding: 14px;
    text-align: center;
}

.calc-macro-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #8a9bae;
    margin-bottom: 4px;
}

.calc-macro-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #1a1a2e;
}

.calc-macro-sub {
    display: block;
    font-size: 11px;
    color: #a0b0c0;
    margin-top: 2px;
}

.calc-bmi-block {
    background: #f0f5fa;
    border-radius: 10px;
    padding: 16px;
    text-align: center;
}

.calc-bmi-header {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #8a9bae;
    margin-bottom: 4px;
}

.calc-bmi-value {
    font-size: 24px;
    font-weight: 700;
    color: #0c446b;
}

.calc-bmi-text {
    font-size: 13px;
    font-weight: 500;
    color: #6b7a8a;
    margin-left: 6px;
}

/* ============================================================
   ВРЕМЕННАЯ ДОБАВОЧКА: переназначение цветов под оранжевую палитру
   Вставить в конец style_calc.css. Удалить, когда определимся.
   ============================================================ */

/* Фон и текст */
.calc-modern {
    background: #fdf8f2;
    color: #2a2018;
}

/* Заголовки */
.calc-header h1 {
    color: #8a4b1f;
}
.calc-header p {
    color: #8a7a6a;
}

/* Карточки */
.calc-panel {
    background: #ffffff;
    border-color: #f0e2d0;
    box-shadow: 0 1px 3px rgba(138,75,31,0.06);
}

/* Секции */
.calc-section h2 {
    color: #b08a6a;
    border-bottom-color: #f5ebdf;
}

/* Подписи полей */
.calc-field label {
    color: #6a4a2a;
}

/* Инпуты */
.calc-field input[type="number"],
.calc-field select {
    color: #2a2018;
    border-color: #e8d8c4;
}
.calc-field input[type="number"]:focus,
.calc-field select:focus {
    border-color: #d97a2b;
    box-shadow: 0 0 0 3px rgba(217,122,43,0.12);
}

/* Кнопка */
.calc-btn-primary {
    background: #d97a2b;
}
.calc-btn-primary:hover {
    background: #b8641f;
}

/* Результат */
.calc-big-number {
    color: #8a4b1f;
}
.calc-unit {
    color: #8a7a6a;
}
.calc-result-detail {
    color: #b08a6a;
}

/* Макросы */
.calc-macro-item {
    background: #fdf2e6;
}
.calc-macro-label {
    color: #b08a6a;
}
.calc-macro-value {
    color: #2a2018;
}
.calc-macro-sub {
    color: #b8a08a;
}

/* ИМТ */
.calc-bmi-block {
    background: #fdf2e6;
}
.calc-bmi-header {
    color: #b08a6a;
}
.calc-bmi-value {
    color: #8a4b1f;
}
.calc-bmi-text {
    color: #8a7a6a;
}

/* Плейсхолдер */
.calc-placeholder {
    color: #c0a890;
}

/* ============================================================
   ВРЕМЕННАЯ ДОБАВОЧКА 2: ярче текст и кнопка, ближе к меню сайта
   Вставить после предыдущей добавочки. Удалить, когда определимся.
   ============================================================ */

/* Заголовки — яркий оранжево-коричневый */
.calc-header h1 {
    color: #c0561a;
}

/* Подписи полей — теплее и ярче */
.calc-field label {
    color: #a0521e;
}

/* Секции — ярче */
.calc-section h2 {
    color: #c06a2a;
}

/* Крупные цифры результата — яркий оранжевый */
.calc-big-number {
    color: #c0561a;
}

/* ИМТ — яркий оранжевый */
.calc-bmi-value {
    color: #c0561a;
}

/* Макросы — значения чуть теплее */
.calc-macro-value {
    color: #8a3d10;
}

/* Кнопка — яркий оранжевый, как полоса меню */
.calc-btn-primary {
    background: #e8862f;
}
.calc-btn-primary:hover {
    background: #c96f1e;
}

/* Фокус инпута — ярче */
.calc-field input[type="number"]:focus,
.calc-field select:focus {
    border-color: #e8862f;
    box-shadow: 0 0 0 3px rgba(232,134,47,0.18);
}

.calc-bmi-hint {
    font-size: 12px;
    color: #8a7a6a;
    margin-top: 6px;
    line-height: 1.4;
}
.calc-error {
    text-align: center;
    padding: 20px;
}
.calc-error-title {
    font-size: 15px;
    font-weight: 700;
    color: #c0561a;
    margin-bottom: 6px;
}
.calc-error-text {
    font-size: 13px;
    color: #8a7a6a;
    line-height: 1.5;
}

/* ============================================================
   СТИЛИ ДЛЯ ТАБЛИЦЫ КАЛОРИЙНОСТИ
   ============================================================ */

.cal-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 20px;
}
.cal-search-wrap {
    flex: 1 1 240px;
    min-width: 0;
}
.cal-search {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e8d8c4;
    border-radius: 8px;
    font-size: 14px;
    color: #2a2018;
    background: #fff;
    outline: none;
}
.cal-search:focus {
    border-color: #e8862f;
    box-shadow: 0 0 0 3px rgba(232,134,47,0.12);
}
.cal-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.cal-select {
    padding: 10px 12px;
    border: 1px solid #e8d8c4;
    border-radius: 8px;
    font-size: 13px;
    color: #2a2018;
    background: #fff;
    outline: none;
    cursor: pointer;
}
.cal-select:focus {
    border-color: #e8862f;
}
.cal-toggles {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 13px;
    color: #6a4a2a;
}
.cal-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}
.cal-toggle input {
    accent-color: #e8862f;
    cursor: pointer;
}

.cal-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 20px;
    align-items: start;
}
@media (max-width: 900px) {
    .cal-layout { grid-template-columns: 1fr; }
}

.cal-table-wrap {
    max-height: 70vh;
    overflow-y: auto;
    border: 1px solid #f0e2d0;
    border-radius: 12px;
    background: #fff;
}
/* Подсветка — на td, а не на tr */
.cal-table tbody td.cal-row-high { background: #fdf0f0; }
.cal-table tbody td.cal-row-low  { background: #f0f8f0; }
.cal-table tbody td.cal-row-mid  { background: #fff; }

/* Корзина: sticky, чтобы не уезжала */
.cal-cart {
    background: #fff;
    border: 1px solid #f0e2d0;
    border-radius: 12px;
    padding: 16px;
    position: sticky;
    top: 16px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
}
.cal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.cal-table thead th {
    background: #fdf2e6;
    color: #8a4b1f;
    font-weight: 600;
    text-align: left;
    padding: 10px 12px;
    border-bottom: 2px solid #f0e2d0;
    white-space: nowrap;
}
.cal-table thead th.cal-num {
    text-align: right;
}
.cal-table tbody td {
    padding: 8px 12px;
    border-bottom: 1px solid #f5ebdf;
    color: #2a2018;
}
.cal-table tbody tr:last-child td {
    border-bottom: none;
}
.cal-table tbody tr:hover {
    background: #fdf8f2;
}
.cal-name {
    font-weight: 500;
    min-width: 180px;
}
.cal-num {
    text-align: right;
    white-space: nowrap;
}
.cal-add-cell {
    width: 40px;
    text-align: center;
}
.cal-add-btn {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: 1px solid #e8d8c4;
    background: #fff;
    color: #e8862f;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
    transition: 0.15s;
}
.cal-add-btn:hover {
    background: #e8862f;
    color: #fff;
    border-color: #e8862f;
}

.cal-row-high { background: #fdf0f0; }
.cal-row-low  { background: #f0f8f0; }
.cal-row-mid  { background: #fff; }

.cal-empty {
    text-align: center;
    padding: 30px;
    color: #b08a6a;
    font-size: 14px;
}

.cal-cart {
    background: #fff;
    border: 1px solid #f0e2d0;
    border-radius: 12px;
    padding: 16px;
    position: sticky;
    top: 16px;
}
.cal-cart-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #b08a6a;
    margin-bottom: 12px;
}
.cal-cart-empty {
    color: #c0a890;
    font-size: 13px;
    text-align: center;
    padding: 16px 0;
}
.cal-cart-item {
    padding: 8px 0;
    border-bottom: 1px solid #f5ebdf;
}
.cal-cart-item:last-child {
    border-bottom: none;
}
.cal-cart-item-name {
    font-size: 13px;
    font-weight: 500;
    color: #2a2018;
    margin-bottom: 4px;
}
.cal-cart-item-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.cal-cart-weight {
    width: 60px;
    padding: 4px 6px;
    border: 1px solid #e8d8c4;
    border-radius: 6px;
    font-size: 12px;
    color: #2a2018;
    text-align: right;
    outline: none;
}
.cal-cart-weight:focus {
    border-color: #e8862f;
}
.cal-cart-unit {
    font-size: 12px;
    color: #8a7a6a;
}
.cal-cart-kcal {
    font-size: 12px;
    font-weight: 600;
    color: #c0561a;
    margin-left: auto;
}
.cal-cart-remove {
    width: 20px;
    height: 20px;
    border: none;
    background: transparent;
    color: #c0561a;
    font-size: 16px;
    cursor: pointer;
    line-height: 1;
    opacity: 0.6;
    transition: 0.15s;
}
.cal-cart-remove:hover {
    opacity: 1;
}
.cal-cart-total {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 2px solid #f0e2d0;
}
.cal-cart-total-row {
    font-size: 14px;
    color: #2a2018;
    margin-bottom: 6px;
}
.cal-cart-total-row strong {
    color: #c0561a;
    font-size: 18px;
}
.cal-cart-macros {
    font-size: 12px;
    color: #8a7a6a;
    display: flex;
    gap: 12px;
}
.cal-cart-macros b {
    color: #6a4a2a;
}
.cal-cart-clear {
    width: 100%;
    margin-top: 10px;
    padding: 8px;
    border: 1px solid #e8d8c4;
    border-radius: 8px;
    background: #fff;
    color: #8a7a6a;
    font-size: 13px;
    cursor: pointer;
    transition: 0.15s;
}
.cal-cart-clear:hover {
    background: #fdf2e6;
    color: #c0561a;
    border-color: #e8862f;
}

/* ============================================================
   СПРАВОЧНИК БАД (supplements.php)
   ============================================================ */

/* --- Тулбар --- */
.supp-toolbar {
    display: grid !important;
    grid-template-columns: 1fr 200px auto !important;
    gap: 10px !important;
    align-items: center !important;
    margin-bottom: 15px !important;
    width: 100% !important;
    box-sizing: border-box !important;
}
@media (max-width: 700px) {
    .supp-toolbar {
        grid-template-columns: 1fr !important;
    }
}

.supp-search {
    width: 100% !important;
    height: 34px !important;
    padding: 0 12px !important;
    border: 1px solid #e8d8c4 !important;
    border-radius: 4px !important;
    font-size: 13px !important;
    outline: none !important;
    box-sizing: border-box !important;
    background: #fff !important;
}
.supp-search:focus {
    border-color: #e8862f !important;
}

.supp-select {
    width: 100% !important;
    height: 34px !important;
    padding: 0 10px !important;
    border: 1px solid #e8d8c4 !important;
    border-radius: 4px !important;
    font-size: 13px !important;
    background: #fff !important;
    outline: none !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
}

/* --- Кнопки вида --- */
.supp-view-group {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    height: 34px !important;
}
.supp-view-label {
    font-size: 13px !important;
    color: #8a7a6a !important;
    margin-right: 4px !important;
    white-space: nowrap !important;
}
.supp-view-btn {
    width: 30px !important;
    height: 30px !important;
    padding: 0 !important;
    border: 1px solid #d0c0b0 !important;
    border-radius: 3px !important;
    background: #fff !important;
    color: #8a7a6a !important;
    font-size: 13px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    transition: 0.15s !important;
    line-height: 30px !important;
    text-align: center !important;
    box-sizing: border-box !important;
}
.supp-view-btn:hover {
    border-color: #e8862f !important;
    color: #c0561a !important;
}
.supp-view-btn.active {
    background: #FFEECF !important;
    border-color: #FFD283 !important;
    color: #c0561a !important;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1) !important;
}

/* --- Таблица --- */
.supp-table-wrap {
    width: 100% !important;
    overflow-x: auto !important;
}
.supp-table {
    width: 100% !important;
    min-width: 760px !important;
    border-collapse: collapse !important;
    font-size: 11px !important;
    line-height: 1.3 !important;
    background: #fff !important;
    border: 1px solid #FFD283 !important;
}

/* Шапка */
.supp-table thead th {
    background: #FFEECF !important;
    border: 1px solid #FFD283 !important;
    color: #4242D6 !important;
    font-weight: bold !important;
    text-align: center !important;
    vertical-align: middle !important;
    padding: 6px 8px !important;
    white-space: nowrap !important;
}

/* Ячейки */
.supp-table tbody td {
    border: 1px solid #FFD283 !important;
    padding: 6px 8px !important;
    vertical-align: top !important;
    color: #222 !important;
}

/* Сортировка */
.supp-th-sort {
    cursor: pointer !important;
    user-select: none !important;
}
.supp-th-sort:hover {
    background: #FFD283 !important; /* Подсветка при наведении */
}
.supp-sort-arrow {
    display: inline-block !important;
    font-size: 14px !important;
    margin-left: 4px !important;
    color: #c0561a !important;
    line-height: 1 !important;
    vertical-align: middle !important;
}

/* Раскраска */
.supp-row-even { background: #fefef5 !important; }
.supp-row-odd  { background: #f5f5e8 !important; }

.supp-cat-vitamin   { background: #fff5e0 !important; }
.supp-cat-mineral   { background: #eef4fb !important; }
.supp-cat-herb      { background: #eef9ee !important; }
.supp-cat-probiotic { background: #f3eefb !important; }
.supp-cat-other     { background: #f4f4f4 !important; }

.supp-empty {
    text-align: center !important;
    padding: 20px !important;
    color: #b08a6a !important;
    font-size: 14px !important;
}
