/* --- User Provided Styles START --- */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.leasing-option-container {
    padding: 60px 0 90px;
}

.leasing-option-title {
    font-weight: 700;
    font-size: 32px;
    line-height: 125%;
    color: var(--main-darck);
    padding-bottom: 40px;
}

#leasing-options {
    padding-bottom: 60px;
    display: flex; /* Kept to maintain layout */
    flex-wrap: wrap; /* Kept to maintain layout */
    margin-bottom: 0; /* Ensures consistent margin below the tabs container */
}

.leasing-options-item {
    font-weight: 400;
    font-size: 14px;
    line-height: 100%;
    text-align: center;
    padding: 14px 35px;
    color: var(--text-darck-opacity);
    border-bottom: 1px solid var(--text-darck-opacity);
    transition: all ease var(--transition-speed);
    cursor: pointer;
    white-space: nowrap;
}

.leasing-options-item:hover, .leasing-options-item.active {
    color: var(--main-red);
    border-bottom: 1px solid var(--main-red);
    transition: all ease var(--transition-speed);
}

.calc-container {
    display: flex;
    gap: 40px;
}
.range-container{
    width: calc(59% - 25px);
}
.range-container, .result-container {
    background-color: var(--text-white);
    border-radius: 6px;
    box-shadow: 0 7px 20px 0 var(--drop-shadow);
    padding: 32px;
    position: relative;
    overflow: hidden;
}

.result-container {
    width: calc(41% - 15px);
    border: 1px solid transparent;
    background: linear-gradient(#fff, #fff) padding-box,
    linear-gradient(330.67deg, rgba(255, 0, 0, 0.4) 2.67%, rgba(255, 0, 0, 0) 41.41%) border-box,
    linear-gradient(143.85deg, rgba(255, 0, 0, 0.2) 9.87%, rgba(255, 0, 0, 0) 29.02%) border-box;
    background-clip: padding-box, border-box, border-box;
}

.range-title {
    font-weight: 700;
    font-size: 32px;
    line-height: 125%;
    color: var(--main-darck);
    padding-bottom: 40px;
}

.range-block {
    padding-bottom: 34px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.range-block-title {
    font-weight: 400;
    font-size: 16px;
    line-height: 100%;
    color: var(--text-darck-opacity);
}

.range-block-value {
    font-weight: 500;
    font-size: 24px;
    line-height: 125%;
    text-align: right;
    color: var(--main-darck);
}

.range-block-labels {
    display: flex;
    justify-content: space-between;
    font-weight: 300;
    font-size: 14px;
    line-height: 100%;
    color: var(--text-darck-opacity);
}


/* Slider Styling (UPDATED for dynamic fill) */
.range-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 1px;
    outline: none;
    opacity: 1; /* Keep full opacity for visibility */
    -webkit-transition: background var(--transition-speed);
    transition: background var(--transition-speed);
    border-radius: 6px;
    cursor: pointer;

    /* Dynamic background for fill: Linear gradient from main-red to track color */
    background: linear-gradient(to right, var(--slider-fill-color) 0%, var(--slider-fill-color) var(--slider-percent), var(--slider-track-color) var(--slider-percent), var(--slider-track-color) 100%);
}

/* Webkit Thumb */
.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 9px;
    height: 9px;
    background: var(--text-white);
    cursor: pointer;
    border-radius: 50%;
    border: 1px solid #fff;
    box-shadow: 0 0 0 3px var(--main-red);
    transition: box-shadow var(--transition-speed);
}

.range-slider:active::-webkit-slider-thumb {
    box-shadow: 0 0 0 6px var(--main-red-hover);
}

/* Moz Thumb */
.range-slider::-moz-range-thumb {
    width: 9px;
    height: 9px;
    background: var(--text-white);
    cursor: pointer;
    border-radius: 50%;
    border: 1px solid #fff;
    box-shadow: 0 0 0 3px var(--main-red);
    transition: box-shadow var(--transition-speed);
}

.range-slider:active::-moz-range-thumb {
    box-shadow: 0 0 0 6px var(--main-red-hover);
}

/* Moz Track (to ensure consistent track style) */
.range-slider::-moz-range-track {
    background: transparent; /* Use the main element background for track */
}

.text-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 1;
}

.result-title {
    font-weight: 600;
    font-size: 24px;
    line-height: 125%;
    color: var(--main-darck);
    padding-bottom: 16px;
}

.result-monthly-payment {
    font-weight: 700;
    font-size: 32px;
    line-height: 125%;
    color: var(--main-red);
    padding-top: 31px;
}

.result-overpayment {
    font-weight: 500;
    font-size: 24px;
    line-height: 125%;
    color: var(--text-darck-opacity);
    padding-top: 20px;
}

.result-block-item {
    padding-top: 32px;
}

.request-form-button {
    font-weight: 500;
    font-size: 16px;
    line-height: 100%;
    border-radius: 6px;
    padding: 10px 20px;
    background: var(--main-red);
    color: var(--text-white);
    width: 100%;
    transition: all ease var(--transition-speed);
    margin: 40px 0 20px;
}

.request-form-button:hover {
    background: var(--main-red-hover);
    transition: all ease var(--transition-speed);
}

.result-text-note {
    font-weight: 300;
    font-size: 14px;
    line-height: 130%;
    color: var(--main-darck);
}

.fade-in {
    animation: fadeIn var(--transition-speed) ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modal Styles - keeping previous functional styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 50;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-speed) ease-in-out, visibility var(--transition-speed) ease-in-out;
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: var(--main-darck-hover);
    color: var(--text-white);
    padding: 40px;
    border-radius: 6px;
    max-width: 50%;
    width: 100%;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    position: relative;
    transform: scale(0.95);
    transition: transform var(--transition-speed) ease-in-out;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-overlay.open .modal-content {
    transform: scale(1);
}

/* Modal Tabs (Always hidden, replaced by select for consistency) */
#modal-leasing-options {
    display: none !important;
}

/* Reusable Select Styling */
.custom-select-wrapper select {
    font-size: 16px;
    color: var(--main-red);
    border: none;
    border-bottom: 2px solid var(--main-red);
    border-radius: 0;
    padding: 5px 0;
    padding-right: 25px;
    appearance: none;
    background-image: var(--arrow-down);
    background-repeat: no-repeat;
    background-position: right 0 center;
    background-color: transparent;
    cursor: pointer;
    width: 100%;
    outline: none;
    font-weight: 500;

    /* default */
    --arrow-down: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23FF0000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    --arrow-up: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 6.5L6 1.5L11 6.5' stroke='%23FF0000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* Specific style for modal select */
#modal-leasing-select {
    background-color: transparent !important; /* Ensure background is transparent inside the dark modal */
    border-color: #ff0000 !important; /* Ensure the line is red */
    color: #ff0000 !important; /* Ensure text is red */
    width: 100%;
    margin-bottom: 20px;
}

/* Mobile specific styles (Updated: max-width: 1024px instead of 1025px) */
.mobile-select-wrapper {
    display: none;
    padding-bottom: 30px;
}

#modal-monthly-payment {
    color: var(--main-red);
}

@media (max-width: 1025px) {
    /* Hiding desktop tabs and showing mobile select for main calculator */
    #leasing-options {
        display: none !important;
    }

    .mobile-select-wrapper {
        display: block !important;
        width: calc(40% - 10px);
    }

    /* Apply select styling to main calculator mobile select */
    .mobile-select-wrapper select {
        font-size: 16px;
        color: var(--main-red);
        border: none;
        border-bottom: 2px solid var(--main-red);
        border-radius: 0;
        padding: 5px 0;
        padding-right: 25px;
        appearance: none;
        background-image: var(--arrow-down);
        background-repeat: no-repeat;
        background-position: right 0 center;
        background-color: transparent;
        cursor: pointer;
        width: 100%;
        outline: none;
        font-weight: 500;

        /* default */
        --arrow-down: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23FF0000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
        --arrow-up: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 6.5L6 1.5L11 6.5' stroke='%23FF0000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");

    }

    .mobile-select-wrapper select option {
        color: var(--main-darck);
    }

    .leasing-option-container {
        padding: 40px 0 60px;
    }

    .leasing-option-title {
        font-size: 28px;
        padding-bottom: 30px;
    }

    #leasing-options {
        padding-bottom: 30px;
    }

    .calc-container {
        gap: 20px;
        flex-direction: row; /* Keeping row, but allowing wrap */
        flex-wrap: wrap;
    }

    .range-container, .result-container {
        padding: 20px;
    }

    .range-container {
        width: calc(60% - 10px);
    }

    .result-container {
        width: calc(40% - 10px);
        order: 2;
        border: none;
    }

    /* For smaller phones, force full width */
    @media (max-width: 600px) {
        .range-container, .result-container {
            width: 100%;
        }

        .modal-content {
            max-width: 95%;
            padding: 20px;
        }
    }

    .range-block {
        padding-bottom: 25px;
        gap: 16px;
    }

    .range-title {
        font-size: 28px;
    }

    .range-block-title {
        font-size: 14px;
    }

    .range-block-value {
        font-size: 20px;
    }

    .range-block-labels {
        font-size: 12px;
    }

    .text-overlay {
        width: max-content;
    }

    .result-title {
        font-size: 20px;
    }

    .result-block-item {
        padding-top: 12px;
    }

    .result-monthly-payment {
        font-size: 28px;
        padding-top: 20px;
    }

    .result-overpayment {
        font-size: 20px;
    }

    .result-text-note {
        font-size: 12px;
    }
}

/* --- User Provided Styles END --- */

@media (max-width: 767px) {
    .leasing-option-container {
        padding: 40px 0;
    }

    .leasing-option-title, .mobile-select-wrapper {
        padding-bottom: 32px;
        width: 100%;
    }

    .range-container, .result-container {
        box-shadow: 0px 7px 20px 0px var(--drop-shadow);
    }

    .result-container {
        border: 1px solid transparent;
        border-image: linear-gradient(330.67deg, rgba(255, 0, 0, 0.4) 2.67%, rgba(255, 0, 0, 0) 41.41%),
        linear-gradient(143.85deg, rgba(255, 0, 0, 0.2) 9.87%, rgba(255, 0, 0, 0) 29.02%);
        border-image-slice: 1;
    }

    .text-overlay svg {
        width: 221px;
        height: 350px;
    }

    .range-title {
        padding-bottom: 35px;
    }

    .range-block-title {
        font-size: 12px;
    }

    .range-block-value {
        font-size: 18px;
        white-space: nowrap;
    }

    .range-block-labels {
        font-size: 10px;
    }

    .range-block {
        padding-bottom: 25px;
        gap: 12px;
    }

    .result-title {
        font-size: 18px;
    }

    .result-monthly-payment {
        padding-top: 24px;
    }

    .request-form-button {
        margin: 32px 0 20px;
    }

    .result-text-note {
        font-size: 10px;
    }

}