/* ================================================
   battery-calc.css — стили калькулятора збірок
   Використовує спільні CSS-змінні з redesign.css (--bg, --surface,
   --surface-2, --line, --text, --muted, --accent); --accent-dim
   похідна тільки для цього калькулятора.
   ================================================ */
:root { --accent-dim: color-mix(in srgb, var(--accent) 65%, black); }

/* ─── PAGE LAYOUT ─── */

.calc-page-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 40px 80px;
}

.calc-page-title {
    text-align: center;
    margin-bottom: 48px;
}

.calc-page-title h1 {
    font-size: clamp(28px, 4vw, 48px);
    font-weight: 900;
    letter-spacing: -1px;
    margin-bottom: 8px;
}

.calc-page-title h1 span {
    color: var(--accent);
}

.calc-page-title p {
    color: var(--muted);
    font-size: 16px;
}

/* ─── CARD ─── */

.calc-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 32px;
    margin-top: 16px;
}

.calc-card-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text);
}

/* ─── PRESETS ─── */

.calc-presets-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.calc-preset-btn {
    padding: 14px 12px;
    border-radius: 10px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.calc-preset-btn small {
    display: block;
    font-size: 11px;
    color: var(--muted);
    margin-top: 3px;
    font-weight: 400;
}

.calc-preset-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.calc-preset-btn.active {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(0, 212, 255, 0.07);
}

/* ─── INPUTS ─── */

.calc-inputs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.calc-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.calc-input-group.full {
    grid-column: 1 / -1;
}

.calc-input-label {
    font-size: 13px;
    color: var(--muted);
    font-weight: 500;
}

.calc-input {
    width: 100%;
    padding: 14px 18px;
    border-radius: 10px;
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--line);
    transition: border-color 0.2s ease;
    font-family: inherit;
    outline: none;
}

.calc-input:focus {
    border-color: var(--accent);
}

/* ─── RESULT ─── */

.calc-result-main {
    font-size: 28px;
    font-weight: 900;
    color: var(--text);
    margin-bottom: 6px;
}

.calc-result-main span {
    color: var(--accent);
}

.calc-result-alt {
    font-size: 14px;
    color: var(--muted);
}

.calc-empty-hint {
    color: var(--muted);
    font-size: 14px;
    text-align: center;
    padding: 8px 0;
}

/* ─── SPLIT GRID ─── */

.calc-split-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 16px;
}

/* ─── CELL SCHEME ─── */

.calc-cell-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    min-height: 60px;
}

.calc-cell-row {
    display: flex;
}

.calc-cell {
    width: 16px;
    height: 16px;
    margin: 2px;
    background: var(--accent);
    border-radius: 3px;
    opacity: 0.85;
}

/* ─── SPECS TABLE ─── */

.calc-spec-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
}

.calc-spec-row:last-child {
    border-bottom: none;
}

.calc-spec-label {
    color: var(--muted);
}

.calc-spec-val {
    font-weight: 700;
    color: var(--text);
}

/* ─── LOAD BAR ─── */

.calc-load-bar-wrap {
    background: var(--surface-2);
    border-radius: 999px;
    height: 10px;
    overflow: hidden;
    margin-bottom: 12px;
}

.calc-load-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--accent);
    border-radius: 999px;
    transition: width 0.4s ease, background 0.4s ease;
}

.calc-load-status {
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
}

.calc-load-status.ok    { color: #22c55e; }
.calc-load-status.limit { color: #f59e0b; }
.calc-load-status.bad   { color: #ef4444; }

/* ─── GALLERY ─── */

.calc-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.calc-gallery-grid img {
    width: 100%;
    border-radius: 12px;
    border: 1px solid var(--line);
    object-fit: cover;
    aspect-ratio: 1;
    transition: transform 0.3s ease, border-color 0.3s ease;
    display: block;
}

.calc-gallery-grid img:hover {
    transform: scale(1.02);
    border-color: var(--accent);
}

/* ─── PRICE ─── */

.calc-price-total {
    font-size: 42px;
    font-weight: 900;
    color: var(--accent);
    margin: 8px 0 4px;
    line-height: 1;
}

.calc-price-detail {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 24px;
}

/* ─── MAIN 2-COL GRID ─── */

.calc-main-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 16px;
    margin-top: 16px;
    align-items: start;
}

.calc-col {
    display: flex;
    flex-direction: column;
}

/* ─── SPECS 2x2 GRID ─── */

.calc-specs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.calc-specs-tile {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 4px;
}

.calc-specs-tile__val {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}

.calc-specs-tile__label {
    font-size: 12px;
    color: var(--muted);
}

/* ─── SCHEME LABEL ─── */

.calc-scheme-label {
    font-size: 14px;
    color: var(--muted);
    text-align: center;
    margin-bottom: 12px;
}

.calc-scheme-label b {
    color: var(--accent);
}

/* ─── RESPONSIVE ─── */

@media (max-width: 768px) {
    .calc-page-wrap {
        padding: 90px 16px 60px;
    }

    .calc-presets-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .calc-main-grid {
        grid-template-columns: 1fr;
    }

    .calc-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .calc-card {
        padding: 20px;
    }

    .calc-price-total {
        font-size: 32px;
    }

    .calc-inputs-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 420px) {
    .calc-inputs-grid {
        grid-template-columns: 1fr;
    }

    .calc-input-group.full {
        grid-column: 1;
    }
}

/* ─── OPTIONAL LABEL ─── */

.calc-optional {
    display: inline-block;
    margin-left: 8px;
    font-size: 11px;
    color: var(--muted);
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 1px 6px;
    font-weight: 400;
    vertical-align: middle;
}

/* ─── BAR PERCENT ─── */

.calc-bar-percent {
    float: right;
    font-size: 14px;
    font-weight: 700;
    color: var(--accent);
}

/* ─── PLACEHOLDER GRID ─── */

.calc-cell-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 0;
}
.qty-btn:first-child { border-radius: 8px 0 0 8px !important; }
.qty-btn:last-child  { border-radius: 0 8px 8px 0 !important; }
/* ─── SOLUTIONS CARDS ─── */

.calc-solutions-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.calc-solution-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.calc-solution-card:hover {
    transform: translateY(-6px);
    border-color: var(--accent);
    box-shadow: 0 16px 40px rgba(0,0,0,0.4);
}

.calc-solution-img {
    height: 200px;
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.calc-solution-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 16px;
    transition: transform 0.3s ease;
}

.calc-solution-card:hover .calc-solution-img img {
    transform: scale(1.05);
}

.calc-solution-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.calc-solution-badge {
    display: inline-block;
    background: rgba(0, 212, 255, 0.1);
    color: var(--accent);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 6px;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 10px;
    width: fit-content;
}

.calc-solution-badge--special {
    background: rgba(255, 165, 0, 0.1);
    color: #f59e0b;
    border-color: rgba(255, 165, 0, 0.3);
}

.calc-solution-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.calc-solution-desc {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.5;
    margin-bottom: 16px;
    flex: 1;
}

.calc-solution-specs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.calc-solution-specs span {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 12px;
    color: var(--muted);
    font-weight: 600;
}

.calc-solution-btn {
    width: 100%;
    padding: 12px;
    background: var(--accent);
    color: var(--bg);
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease;
    font-family: inherit;
    margin-top: auto;
}

.calc-solution-btn:hover {
    background: var(--accent-dim);
}
/* ─── CELL CARDS ─── */

.calc-cells-grid {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 16px;
}

.calc-cell-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.calc-cell-card__img-wrap {
    background: var(--surface-2);
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.calc-cell-card__img-wrap img {
    max-height: 100%;
    max-width: 60%;
    width: auto;
    height: auto;
    object-fit: contain;
    padding: 24px;
    transition: transform 0.3s ease;
}

.calc-cell-card__brand {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #1b5e20;
    color: white;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
}

.calc-cell-card__brand--molicel {
    background: #5d4037;
}

.calc-cell-card__body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.calc-cell-card__title {
    font-size: 22px;
    font-weight: 900;
    color: var(--text);
    margin-bottom: 4px;
}

.calc-cell-card__sub {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 20px;
}

.calc-cell-card__specs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 16px;
}

.calc-cell-card__spec {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: var(--surface-2);
    border-radius: 8px;
    padding: 8px 10px;
}

.calc-cell-card__spec-label {
    font-size: 11px;
    color: var(--muted);
}

.calc-cell-card__spec-val {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

.calc-cell-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 16px;
}

.calc-cell-card__tag {
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--muted);
}

.calc-cell-card__tag--green {
    background: rgba(34,197,94,0.1);
    border-color: rgba(34,197,94,0.3);
    color: #22c55e;
}

.calc-cell-card__tag--orange {
    background: rgba(245,158,11,0.1);
    border-color: rgba(245,158,11,0.3);
    color: #f59e0b;
}

.calc-cell-card__desc {
    font-size: 14px;
    color: var(--muted);
    line-height: 1.6;
}

/* ─── COMPARE ─── */

.calc-cell-compare {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 28px;
    margin-top: 16px;
}

.calc-cell-compare__title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    text-align: center;
}

.calc-cell-compare__grid {
    display: grid;
    grid-template-columns: 1fr 40px 1fr;
    gap: 24px;
    align-items: start;
    max-width: 700px;
    margin: 0 auto;
}
.calc-cell-compare__divider {
    font-size: 20px;
    font-weight: 900;
    color: var(--muted);
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 28px;
}
.calc-cell-compare__item:last-child {
    text-align: left;
}
.calc-cell-compare__label {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
}

.calc-cell-compare__list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.calc-cell-compare__list li {
    font-size: 14px;
    color: var(--muted);
    padding-left: 16px;
    position: relative;
    line-height: 1.4;
}

.calc-cell-compare__list li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent);
}

/* ─── TRUST ROW ─── */

.calc-trust-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 16px;
}

.calc-trust-item {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.calc-trust-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.calc-trust-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.calc-trust-text strong {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

.calc-trust-text span {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.4;
}

@media (max-width: 768px) {
    .calc-cells-grid        { flex-direction: column; }
    .calc-cell-compare__grid { grid-template-columns: 1fr; }
    .calc-cell-compare__divider { padding-top: 0; }
    .calc-trust-row         { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
    .calc-solutions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .calc-solutions-grid {
        grid-template-columns: 1fr;
    }

    .calc-cell-card__body {
        padding: 18px;
    }

    .calc-cell-compare {
        padding: 18px;
    }

    .calc-cell-card__img-wrap {
        height: 220px;
    }
}
/* ─── PRESETS GRID — 3 columns on desktop for 6 items ─── */