.romfix-native-calculator {
    --romfix-blue: #142a4e;
    --romfix-blue-hover: #124188;
    --romfix-green: #aec54d;
    --romfix-green-dark: #8aa63a;
    --romfix-green-light: #f0f8d9;
    --romfix-surface: #f8f8fd;
    --romfix-border: #dfe1e8;
    --romfix-muted: #676b75;
    color: var(--romfix-blue);
}

.romfix-native-calculator *,
.romfix-native-calculator *::before,
.romfix-native-calculator *::after {
    box-sizing: border-box;
}

[data-romfix-calculator-page] .calculator-switch {
    flex-wrap: wrap;
}

.romfix-native-calculator [hidden],
.calculator [data-calculator-intro][hidden],
.calculator [data-calculator-cta][hidden] {
    display: none !important;
}

.romfix-native-panel {
    display: none;
}

.romfix-native-panel.active {
    display: block;
}

.romfix-calc-form {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
    gap: 30px;
    max-width: 1100px;
    margin: 0 auto;
    padding: 30px;
    border: 1px solid #eff0f5;
    border-radius: 8px;
    background: var(--romfix-surface);
    box-shadow: 0 16px 45px rgba(20, 42, 78, 0.06);
}

.romfix-calc-form__fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
    gap: 20px;
}

.romfix-calc-field,
.romfix-calc-colors {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.romfix-calc-field--wide {
    grid-column: 1 / -1;
}

.romfix-calc-field label,
.romfix-calc-colors legend {
    display: block;
    margin: 0 0 7px;
    color: var(--romfix-blue);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
}

.romfix-calc-field label span,
.romfix-calc-colors legend span {
    color: #c43f3f;
}

.romfix-calc-field select,
.romfix-calc-field input {
    width: 100%;
    height: 48px;
    margin: 0;
    padding: 0 14px;
    border: 1px solid var(--romfix-border);
    border-radius: 5px;
    background: #fff;
    color: var(--romfix-blue);
    font: inherit;
    font-size: 15px;
    box-shadow: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.romfix-calc-field select:focus,
.romfix-calc-field input:focus {
    outline: none;
    border-color: var(--romfix-green);
    box-shadow: 0 0 0 3px rgba(174, 197, 77, 0.18);
}

.romfix-calc-field input[readonly] {
    border-color: #d8dbe2;
    background: #eceef2;
    color: #676b75;
    cursor: not-allowed;
}

.romfix-calc-field input[readonly]:focus {
    border-color: #d8dbe2;
    box-shadow: none;
}

.romfix-calc-field small {
    display: block;
    min-height: 16px;
    margin-top: 5px;
    color: var(--romfix-muted);
    font-size: 12px;
    line-height: 1.4;
}

.romfix-calc-input-unit {
    position: relative;
}

.romfix-calc-input-unit input {
    padding-right: 58px;
}

.romfix-calc-input-unit > span {
    position: absolute;
    top: 50%;
    right: 14px;
    color: var(--romfix-muted);
    font-size: 13px;
    font-weight: 700;
    pointer-events: none;
    transform: translateY(-50%);
}

.romfix-calc-colors__options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.romfix-calc-color {
    position: relative;
    display: flex !important;
    align-items: center;
    gap: 9px;
    min-height: 46px;
    margin: 0 !important;
    padding: 8px 11px;
    overflow: hidden;
    border: 2px solid var(--romfix-border);
    border-radius: 5px;
    background: #fff;
    color: var(--romfix-blue);
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.romfix-calc-color:hover {
    border-color: var(--romfix-green);
    background: var(--romfix-green-light);
    transform: translateY(-1px);
}

.romfix-calc-color:has(input:checked) {
    border-color: var(--romfix-green);
    background: var(--romfix-green-light);
    box-shadow: 0 0 0 1px var(--romfix-green);
}

.romfix-calc-color:has(input:focus-visible) {
    outline: 3px solid rgba(174, 197, 77, 0.28);
    outline-offset: 2px;
}

.romfix-calc-color input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.romfix-calc-color__swatch {
    flex: 0 0 26px;
    width: 26px;
    height: 26px;
    border: 1px solid rgba(20, 42, 78, 0.16);
    border-radius: 50%;
    background: var(--romfix-swatch, #ddd);
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35);
}

.romfix-calc-result {
    position: sticky;
    top: 130px;
    align-self: start;
    min-height: 320px;
    padding: 30px;
    border-radius: 7px;
    background: var(--romfix-blue);
    color: #fff;
}

.romfix-calc-result__eyebrow {
    display: block;
    margin-bottom: 9px;
    color: var(--romfix-green);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.romfix-calc-result h2 {
    margin: 0 0 12px;
    color: #fff;
    font-size: 25px;
    line-height: 1.18;
}

.romfix-calc-result p {
    color: #fff;
}

.romfix-calc-result__empty p,
.romfix-calc-result__note {
    margin: 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 14px;
    line-height: 1.55;
}

.romfix-calc-result__color {
    margin: 0 0 18px;
}

.romfix-calc-result__color strong {
    color: var(--romfix-green);
}

.romfix-calc-result__numbers {
    display: grid;
    gap: 10px;
    margin: 20px 0;
}

.romfix-calc-result__numbers > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin: 0;
    padding: 12px 14px;
    border-radius: 5px;
    background: #fff;
    color: var(--romfix-blue);
    overflow-wrap: anywhere;
}

.romfix-calc-result__numbers dt,
.romfix-calc-result__numbers dd {
    min-width: 0;
    margin: 0;
    color: inherit;
    font-size: 14px;
    line-height: 1.35;
}

.romfix-calc-result__numbers dt {
    max-width: 65%;
    font-weight: 700;
}

.romfix-calc-result__numbers dd {
    flex: 0 0 auto;
    text-align: right;
}

.romfix-calc-result__numbers dd strong {
    font-size: 20px;
}

.romfix-calc-result__note {
    margin: 0 0 17px;
}

.romfix-calc-cart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    margin-top: 5px;
    padding: 10px 25px;
    border: 0;
    border-radius: 5px;
    background: var(--romfix-green);
    color: #fff !important;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.25;
    text-align: center;
    text-decoration: none !important;
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.romfix-calc-cart:hover {
    background: var(--romfix-green-dark);
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.22);
    transform: translateY(-1px);
}

.romfix-calc-cart.is-disabled,
.romfix-calc-cart[aria-disabled="true"] {
    opacity: 0.48;
    cursor: not-allowed;
    pointer-events: none;
}

@media (max-width: 900px) {
    .romfix-calc-form {
        grid-template-columns: 1fr;
    }

    .romfix-calc-result {
        position: static;
        min-height: 0;
    }
}

@media (max-width: 600px) {
    .romfix-calc-form {
        gap: 22px;
        padding: 16px;
    }

    .romfix-calc-form__fields {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .romfix-calc-field--wide {
        grid-column: auto;
    }

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

    .romfix-calc-result {
        padding: 22px;
    }

    .romfix-calc-result h2 {
        font-size: 22px;
    }

    .romfix-calc-result__numbers > div {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .romfix-calc-result__numbers dt {
        max-width: none;
    }

    .romfix-calc-result__numbers dd {
        text-align: left;
    }

    .romfix-calc-cart {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .romfix-calc-color,
    .romfix-calc-cart,
    .romfix-calc-field select,
    .romfix-calc-field input {
        transition: none;
    }
}
