/* === ИЗОЛЯЦИЯ КОМПОНЕНТА === */
.box-calculator-app { isolation: isolate; }
.box-calculator-app,
.box-calculator-app input,
.box-calculator-app select,
.box-calculator-app button,
.box-calculator-app textarea,
.box-calculator-app * {
    -webkit-appearance: none;
    appearance: none;
    background-image: none;
    text-shadow: none;
}
.box-calculator-app input,
.box-calculator-app select,
.box-calculator-app button {
    font-family: inherit;
    outline: none;
    box-shadow: none;
}

/* === ОБЩИЕ СТИЛИ === */
.box-calculator-app { background: #f3f6fa; font-family: 'Inter', 'Segoe UI', Roboto, system-ui, sans-serif; overflow-x: hidden; -webkit-tap-highlight-color: transparent; -webkit-font-smoothing: antialiased; font-size: 1.21rem; }
.box-calculator-app, .box-calculator-app * { margin: 0; padding: 0; box-sizing: border-box; }
.box-calculator-app .calc-container { max-width: 1400px; width: 100%; margin: 0 auto; background: rgba(255,255,255,0.8); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid rgba(0,0,0,0.04); box-shadow: 0 8px 32px rgba(0,0,0,0.04); border-radius: 20px; overflow: visible; }

/* ===== ВЕРХНИЙ РЯД: 5 равных полей + кнопка ===== */
.box-calculator-app .input-row { display: flex; flex-wrap: nowrap; align-items: flex-end; gap: 14px; padding: 22px 20px 14px 20px; background: transparent; border-bottom: 1px solid #eef1f5; }
.box-calculator-app .input-row > .input-col { flex: 1 1 0; min-width: 0; }
.box-calculator-app .input-row > .pro-btn { flex: 0 0 auto; }

.box-calculator-app .input-field label { display: block; font-size: 0.95rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: #5b6e8c; margin-bottom: 6px; text-align: center; }

.box-calculator-app .input-field select,
.box-calculator-app .input-field input[type="number"],
.box-calculator-app .input-field input[type="text"] {
    display: block;
    width: 100%;
    height: 44px;
    line-height: 1;
    padding: 0 12px;
    border: 1.5px solid #e1e7ef;
    border-radius: 12px;
    font-size: 1.09rem;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-weight: 400;
    color: #252a30;
    background: #ffffff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    margin-bottom: 6px;
    text-align: center;
    vertical-align: middle;
}
.box-calculator-app .input-field select:focus,
.box-calculator-app .input-field input[type="number"]:focus,
.box-calculator-app .input-field input[type="text"]:focus {
    outline: none;
    border-color: #80D6D0;
    box-shadow: 0 0 0 3px rgba(128,214,208,0.25);
}
.box-calculator-app .input-field select:disabled,
.box-calculator-app .input-field input[type="number"]:disabled,
.box-calculator-app .input-field input[type="text"]:disabled { background: #f5f7fa; color: #99a8bb; cursor: not-allowed; }

/* Кнопка "Еще фильтры" */
.box-calculator-app .pro-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; user-select: none; white-space: nowrap; gap: 2px; line-height: 1; align-self: flex-end; padding-bottom: 6px; }
.box-calculator-app .pro-btn .pro-icon { width: 37.5px; height: 37.5px; display: block; transition: transform 0.3s; color: #5CC2C0 !important; line-height: 1; }
.box-calculator-app .pro-btn:hover .pro-icon { transform: rotate(90deg); }
.box-calculator-app .pro-btn .pro-text { font-size: 0.68rem; font-weight: 600; color: #334155 !important; margin-top: 0; }

.box-calculator-app .action-row { display: flex; flex-wrap: nowrap; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 20px 16px 20px; background: transparent; border-bottom: 1px solid #eef1f5; }

.box-calculator-app .toggle-group { display: flex; align-items: flex-end; gap: 15.6px; }
.box-calculator-app .toggle-item { display: flex; flex-direction: column; align-items: center; cursor: pointer; user-select: none; }
.box-calculator-app .toggle-input { display: none; }
.box-calculator-app .toggle-slider { position: relative; width: 40px; height: 22px; background: #F97316; border-radius: 11px; transition: background 0.3s; }
.box-calculator-app .toggle-slider::before { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; background: white; top: 2px; left: 2px; transition: transform 0.3s; }
.box-calculator-app .toggle-input:checked + .toggle-slider { background: #76D0CB; }
.box-calculator-app .toggle-input:checked + .toggle-slider::before { transform: translateX(18px); }
.box-calculator-app .toggle-text { font-size: 0.77rem; font-weight: 600; color: #334155; margin-top: 4px; text-align: center; width: 100%; min-width: 0; white-space: nowrap; }

/* === Поля объёма (шире на 10%: 85px → 94px) === */
.box-calculator-app .volume-input-wrapper { display: flex; align-items: center; gap: 6px; }
.box-calculator-app .volume-selects, .box-calculator-app .volume-manual { display: flex; align-items: center; gap: 6px; }
.box-calculator-app .volume-selects select,
.box-calculator-app .volume-manual input {
    width: 94px;
    height: 32px;
    padding: 0 6px;
    font-size: 0.97rem;
    line-height: 1;
    border: 1.5px solid #e1e7ef;
    border-radius: 8px;
    background: #ffffff;
    color: #252a30;
    text-align: center;
}
.box-calculator-app .volume-selects select:disabled,
.box-calculator-app .volume-manual input:disabled { background: #f5f7fa; color: #99a8bb; }
.box-calculator-app .volume-selects .v2-select { width: 94px; flex: 0 0 94px; }
.box-calculator-app .volume-selects .v2-select-toggle {
    height: 32px !important;
    line-height: 1 !important;
    padding: 0 20px 0 6px !important;
    font-size: 0.9rem !important;
    margin-bottom: 0 !important;
    border-radius: 8px !important;
}
.box-calculator-app .volume-selects .v2-select-toggle::after { right: 5px; width: 11px; height: 8px; margin-top: -4px; }
.box-calculator-app .volume-selects .v2-select-menu { min-width: 105px; }
.box-calculator-app .volume-selects .v2-select-menu > button { font-size: 0.88rem; padding: 6px 8px; }

.box-calculator-app .refresh-btn { background: #69C9C6; color: white; width: 36px; height: 36px; border-radius: 50%; padding: 0; border: none; cursor: pointer; box-shadow: none; transition: transform 0.2s ease; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.box-calculator-app .refresh-btn:hover { transform: scale(1.1); }
.box-calculator-app .refresh-btn svg { width: 60%; height: 60%; fill: white; }

/* === МИН. ВЫСОТА РЕЗУЛЬТАТОВ === */
.box-calculator-app .results-area { padding: 14px 20px 26px 20px; background: transparent; overflow-x: auto; -webkit-overflow-scrolling: touch; min-height: 340px; }

.box-calculator-app .cards-container { display: flex; flex-direction: column; gap: 14px; }
.box-calculator-app .box-card { background: #ffffff; border-radius: 20px; padding: 8px 10px; box-shadow: 0 4px 18px rgba(0,0,0,0.05); border: 1px solid #eef2f6; }
.box-calculator-app .box-card-header { display: flex; flex-direction: column; gap: 2px; margin-bottom: 4px; }
.box-calculator-app .box-card-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; width: 100%; }
.box-calculator-app .box-card-title { font-weight: 800; font-size: 1.32rem; color: #000000; }
.box-calculator-app .box-card-type { font-size: 0.95rem; color: #475569; font-weight: 600; }
.box-calculator-app .box-card-volume { background: #e6f7f5; color: #0e5e5c; font-weight: 700; font-size: 1.06rem; padding: 4px 12px; border-radius: 20px; white-space: nowrap; }

.box-calculator-app .badge-sale { color: #EA580C; font-weight: 900; font-size: 1.4rem; -webkit-text-stroke: 0.4px #EA580C; }

.box-calculator-app .price-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px; padding: 2px 4px; border-bottom: 1px solid #f1f5f9; font-size: 0.95rem; }
.box-calculator-app .price-row:last-child { border-bottom: none; }
.box-calculator-app .price-label { font-weight: 600; color: #475569; min-width: 70px; font-size: 0.95rem; text-align: left; }
.box-calculator-app .price-value { font-weight: 700; font-family: 'JetBrains Mono', monospace; color: #000000; background: #f8fafc; padding: 1px 8px; border-radius: 14px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 0.95rem; text-align: center; }

.box-calculator-app .discount-badge { background: transparent; color: #70CEC9; font-weight: 400; font-size: 0.8rem; padding: 2px 6px; border-radius: 20px; margin-left: 4px; white-space: nowrap; display: inline-block; }
.box-calculator-app .sale-badge-inline { color: #EA580C; font-weight: 900; font-size: 16px; margin-left: 6px; display: inline; -webkit-text-stroke: 0.3px #EA580C; }
.box-calculator-app .manager-note { font-weight: 700; color: #0f172a; font-size: 0.95rem; white-space: nowrap; background: none; padding: 0; border-radius: 0; }
.box-calculator-app .volume-note { font-size: 1.06rem; color: #334155; font-weight: 700; white-space: normal; background: none; padding: 0; border-radius: 0; text-align: center; }
.box-calculator-app .no-results-message { background: #fffbeb; padding: 14px; border-radius: 12px; color: #92400e; font-size: 1.12rem; text-align: center; }
.box-calculator-app .footer-stats { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 16px; padding-top: 10px; border-top: 1px solid #eef1f5; }
.box-calculator-app .stats-text { font-size: 1.06rem; color: #64748b; font-weight: 500; }

/* === ПАГИНАЦИЯ (ширина +20%) === */
.box-calculator-app .pagination { display: flex; align-items: center; justify-content: center; gap: 2px; font-size: 1.45rem; flex-wrap: nowrap; white-space: nowrap; }
.box-calculator-app .pagination button { background: transparent; border: none; border-radius: 4px; padding: 4px 10px; font-size: inherit; font-weight: 500; color: #334155; cursor: pointer; transition: all 0.2s; }
.box-calculator-app .pagination button.nav-arrow { font-size: 1.89rem; font-weight: normal; }
.box-calculator-app .pagination button.active { background: #E6F5F5; font-weight: 700; }
.box-calculator-app .pagination button:disabled { opacity: 0.4; cursor: default; }
.box-calculator-app .pagination button:hover:not(:disabled):not(.active) { background: #f0f4f8; }
.box-calculator-app .pagination .pagination-ellipsis { padding: 6px 5px; }

.box-calculator-app .remove-box-btn { background: transparent; border: none; border-radius: 0; width: 33px; height: 33px; font-size: 24px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: #94a3b8; transition: color 0.2s; flex-shrink: 0; box-shadow: none; }
.box-calculator-app .remove-box-btn:hover { color: #ef4444; background: transparent; border: none; box-shadow: none; }
.box-calculator-app .unified-table .remove-box-btn { margin-left: 8px; }

.box-calculator-app .unified-table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 0.8rem; background: white; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 12px rgba(0,0,0,0.03); min-width: 600px; display: none; }
.box-calculator-app .unified-table thead { background: linear-gradient(135deg, #D3ECEC, #C8E5E5); }
.box-calculator-app .unified-table th { background: transparent; color: #0b2b3b; font-weight: 700; font-size: 0.85rem; padding: 3px 4px; text-align: center; border-bottom: none; }
.box-calculator-app .unified-table td { padding: 3px 4px; text-align: center; }
.box-calculator-app .unified-table th:first-child,
.box-calculator-app .unified-table td:first-child { width: 22.22%; }
.box-calculator-app .unified-table th:not(:first-child),
.box-calculator-app .unified-table td:not(:first-child) { width: 11.11%; }
.box-calculator-app .unified-table tbody tr:hover td { background-color: rgba(128,214,208,0.15); transition: background-color 0.2s ease; }
.box-calculator-app .unified-table td:first-child strong { color: #000000; font-weight: 800; }

.box-calculator-app .sale-indicator { display: flex; flex-direction: column; align-items: center; cursor: pointer; user-select: none; gap: 0; margin-left: 0; margin-right: 0; }
.box-calculator-app .sale-symbol { font-size: 1.56rem; font-weight: 900; color: #66757F; transition: color 0.2s; line-height: 1; -webkit-text-stroke: 0.5px currentColor; }
.box-calculator-app .sale-indicator.active .sale-symbol { color: #EA580C; -webkit-text-stroke: 0.5px #EA580C; }
.box-calculator-app .sale-label { font-size: 0.7rem; font-weight: 800; color: #334155; margin-top: 0; text-align: center; }
.box-calculator-app .sale-indicator.active .sale-label { color: #EA580C; font-weight: 900; }

.box-calculator-app .type-select-col { flex: 0 0 240px; width: 240px; min-width: 240px; max-width: 240px; }

.box-calculator-app .pro-toggle.hidden,
.box-calculator-app .hidden { display: none !important; }

/* === Кастомный дропдаун === */
.box-calculator-app .v2-select { position: relative; width: 100%; }
.box-calculator-app .v2-select-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100% !important;
    min-width: 100%;
    height: 44px;
    line-height: 1;
    padding: 0 34px !important;
    border: 1.5px solid #e1e7ef !important;
    border-radius: 12px !important;
    background: #fff !important;
    color: #252a30 !important;
    font-family: 'JetBrains Mono', 'Fira Code', monospace !important;
    font-size: 1.09rem !important;
    font-weight: 400;
    text-align: center !important;
    margin: 0 0 6px !important;
    cursor: pointer;
    transition: border-color .2s, box-shadow .2s;
}
.box-calculator-app .v2-select-toggle:hover { border-color: #80D6D0 !important; }
.box-calculator-app .v2-select-toggle:focus-visible,
.box-calculator-app .v2-select-toggle.v2-open { outline: none; border-color: #5CC2C0 !important; box-shadow: 0 0 0 3px rgba(128,214,208,0.25) !important; }
.box-calculator-app .v2-select-toggle::after { content: ""; position: absolute; right: 12px; top: 50%; width: 14px; height: 10px; margin-top: -5px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='10' viewBox='0 0 14 10'%3E%3Cpath d='M2 2l5 5 5-5' fill='none' stroke='%235b6e8c' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: center; pointer-events: none; transition: transform .2s; }
.box-calculator-app .v2-select-toggle.v2-open::after { transform: rotate(180deg); }
.box-calculator-app .v2-select-value { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; min-height: 1em; line-height: 1.1; }

.box-calculator-app .v2-select-menu {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    width: auto;
    z-index: 999;
    max-height: 280px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0;
    padding: 4px;
    border: 1.5px solid #e1e7ef;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(15,42,60,0.12);
}
.box-calculator-app .v2-select-menu[hidden] { display: none; }
.box-calculator-app .v2-select-menu > button { display: block; width: 100%; margin: 0; padding: 9px 10px; border: 0; border-radius: 8px; background: transparent; color: #252a30; font-family: 'JetBrains Mono', 'Fira Code', monospace; font-size: 15px; line-height: 1.2; text-align: center; cursor: pointer; }
.box-calculator-app .v2-select-menu > button:hover,
.box-calculator-app .v2-select-menu > button:focus-visible { outline: none; background: rgba(128,214,208,0.25); }
.box-calculator-app .v2-select-menu > button[data-active="1"] { background: #D1EAEA; font-weight: 700; color: #0b2b3b; }
.box-calculator-app .v2-select-disabled .v2-select-toggle { background: #f5f7fa !important; color: #99a8bb !important; cursor: not-allowed !important; border-color: #e1e7ef !important; pointer-events: none; }
.box-calculator-app .v2-select-disabled .v2-select-toggle:hover { border-color: #e1e7ef !important; }

/* === Мультиселект типов === */
.box-calculator-app .type-multiselect { position: relative; width: 100%; }
.box-calculator-app .type-multiselect .v2-select-toggle { margin: 0 !important; }
.box-calculator-app .type-menu { padding: 6px !important; }
.box-calculator-app .type-option { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; user-select: none; font-size: 15px; color: #252a30; font-family: 'Inter', 'Segoe UI', sans-serif; font-weight: 500; text-align: left; }
.box-calculator-app .type-option:hover { background: rgba(128,214,208,0.25); }
.box-calculator-app .type-option span { display: inline-block; }

/* ===== КАСТОМНЫЕ ЧЕКБОКСЫ ===== */
.box-calculator-app .type-option input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    min-width: 18px;
    border: 2px solid #cbd5e1;
    border-radius: 4px;
    background-color: #ffffff;
    background-image: none;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 12px 12px;
    cursor: pointer;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
    box-shadow: none;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}
.box-calculator-app .type-option input[type="checkbox"]:hover { border-color: #6AC9C6; }
.box-calculator-app .type-option input[type="checkbox"]:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(128,214,208,0.35);
}
.box-calculator-app .type-option input[type="checkbox"]:checked {
    background-color: #6AC9C6;
    border-color: #6AC9C6;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M2.5 7.4l3.1 3.1L11.6 4' fill='none' stroke='%23ffffff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* ===== МОБИЛЬНЫЕ ===== */
@media (max-width: 749px) {
    .box-calculator-app .input-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding: 18px 14px 14px 14px;
    }
    .box-calculator-app .input-row > .input-col:first-child { display: none; }
    .box-calculator-app .input-row > .pro-btn {
        grid-column: 1 / -1;
        flex-direction: row;
        gap: 6px;
        width: auto;
        height: auto;
        padding-bottom: 0;
        justify-content: center;
    }
    .box-calculator-app .input-row > .pro-btn .pro-text { font-size: 0.8rem; display: inline; }

    .box-calculator-app .input-field label { font-size: 0.78rem; }
    .box-calculator-app .input-field select,
    .box-calculator-app .input-field input[type="number"],
    .box-calculator-app .input-field input[type="text"] { font-size: 0.95rem; padding: 0 6px; }
    .box-calculator-app .v2-select-toggle { font-size: 0.95rem !important; padding: 0 22px 0 6px !important; }
    .box-calculator-app .v2-select-toggle::after { right: 8px; }

    .box-calculator-app .unified-table { display: none !important; }
    .box-calculator-app .cards-container { display: flex !important; }
    .box-calculator-app .results-area { padding: 14px 14px 22px 14px; min-height: 360px; }
    .box-calculator-app .action-row { flex-wrap: wrap; justify-content: center; gap: 10px; padding: 12px 14px; }
    .box-calculator-app .action-row .type-select-col { flex: 1 1 100%; max-width: none; min-width: 0; width: auto; }
    .box-calculator-app .volume-input-wrapper { width: auto; }
    .box-calculator-app .sale-indicator { margin-left: 10px; margin-right: 10px; gap: 0; }
    .box-calculator-app .sale-symbol { line-height: 0.9; font-weight: 900; }
    .box-calculator-app .sale-label { margin-top: -2px; }

    /* === Пагинация: +20% по ширине кнопок, без переносов === */
    .box-calculator-app .pagination { font-size: 1.05rem; gap: 1px; flex-wrap: nowrap; white-space: nowrap; max-width: 100%; }
    .box-calculator-app .pagination button { padding: 3px 5px; }
    .box-calculator-app .pagination button.nav-arrow { font-size: 1.21rem; padding: 3px 4px; }
    .box-calculator-app .pagination .pagination-ellipsis { padding: 3px 3px; }

    .box-calculator-app .box-card-volume { background: transparent; }
    .box-calculator-app .remove-box-btn { width: 33px; height: 33px; font-size: 24px; }
    .box-calculator-app .box-card { padding: 6px 8px; }
    .box-calculator-app .cards-container .discount-badge { margin-left: 0; margin-right: 6px; }
}
@media (min-width: 750px) {
    .box-calculator-app .cards-container { display: none !important; }
    .box-calculator-app .unified-table { display: table !important; }
    .box-calculator-app { background: transparent; }
    .box-calculator-app .calc-container { background: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; border: none; box-shadow: none; }
    .box-calculator-app .box-card { border: none; box-shadow: none; }
    .box-calculator-app .unified-table { background: rgba(255,255,255,0.5); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); border: none; box-shadow: none; }

    .box-calculator-app .input-row,
    .box-calculator-app .action-row {
        display: grid;
        grid-template-columns: repeat(5, 1fr) 90px;
        column-gap: 14px;
        align-items: flex-end;
    }
    .box-calculator-app .input-row { padding: 22px 20px 14px 20px; }
    .box-calculator-app .action-row { padding: 14px 20px 16px 20px; align-items: center; }

    .box-calculator-app .input-row > *,
    .box-calculator-app .action-row > * { min-width: 0; }

    .box-calculator-app .input-row > .pro-btn {
        width: 90px;
        justify-self: center;
    }

    .box-calculator-app .action-row > .toggle-group {
        grid-column: 1 / span 2;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        justify-items: center;
        align-items: flex-end;
        gap: 0;
        width: 100%;
    }

    .box-calculator-app .action-row > .volume-input-wrapper {
        grid-column: 3;
        justify-self: center;
    }

    .box-calculator-app .action-row > .type-select-col {
        grid-column: 4;
        width: auto;
        min-width: 0;
        max-width: none;
        flex: none;
    }

    .box-calculator-app .action-row > .sale-indicator {
        grid-column: 5;
        justify-self: center;
        align-self: center;
        margin: 0;
    }

    .box-calculator-app .action-row > .refresh-btn {
        grid-column: 6;
        justify-self: center;
        align-self: center;
    }
}
.box-calculator-app .footnote { margin-top: 0.8rem; font-size: 1.12rem; color: #555; display: flex; justify-content: center; gap: 0.5rem; }
.box-calculator-app .footnote-line { display: inline; }
.box-calculator-app .footnote .approx-symbol { color: #F97316; font-weight: bold; }