/***
=============================================
Rate Calculator Section Modular CSS
=============================================
***/

/* Base Section */
.dg-rate-calc-section {
    position: relative;
    display: block;
    padding: 50px 0 50px 0px;
    background: url(../../images/rate-calculator/rates-card.png);
    margin-top: 50px;

    scroll-margin-top: 130px;
}

.dg-rate-calc-section .container {
    position: relative;
    overflow: visible;
}

/* Section Title */
.dg-rate-calc-section .section-title {
    margin-bottom: 60px;
}

/* Form Container */
.dg-rate-calc-form-container {
    position: relative;
    display: block;
    z-index: 5;
}

/* Input Groups */
.dg-rate-calc-group {
    position: relative;
    display: block;
}

.dg-rate-calc-subtitle {
    font-family: var(--tanspot-font-two, "Rubik", sans-serif);
    font-size: 20px;
    font-weight: 700;
    color: var(--tanspot-black, #01284F);
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dg-rate-calc-label {
    display: block;
    font-family: var(--tanspot-font, "Poppins", sans-serif);
    font-size: 14px;
    font-weight: 500;
    color: var(--tanspot-black, #01284F);
    margin-bottom: 8px;
}

/* Custom Input Wrapper */
.dg-rate-calc-input-box {
    position: relative;
    display: block;
    margin-bottom: 12px;
}

.dg-rate-calc-input-box input[type="text"],
.dg-rate-calc-input-box input[type="email"],
.dg-rate-calc-input-box input[type="tel"],
.dg-rate-calc-input-box input[type="number"],
.dg-rate-calc-input-box select {
    font-family: var(--tanspot-font, "Poppins", sans-serif);
    font-size: 15px;
    font-weight: 400;
    color: var(--tanspot-gray, #585b6b);
    height: 50px;
    width: 100%;
    background-color: #ffffff;
    border: 1px solid #e1e9f5;
    border-radius: 8px;
    padding-left: 20px;
    padding-right: 50px;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0px 4px 15px rgba(1, 40, 79, 0.02);
}

/* Focus state */
.dg-rate-calc-input-box input:focus,
.dg-rate-calc-input-box select:focus {
    border-color: rgba(251, 92, 8, 0.4);
    box-shadow: 0px 4px 20px rgba(251, 92, 8, 0.06);
}

/* Scoped jQuery Nice Select styling */
.dg-rate-calc-input-box .nice-select {
    font-family: var(--tanspot-font, "Poppins", sans-serif);
    font-size: 15px;
    font-weight: 400;
    color: var(--tanspot-gray, #585b6b);
    height: 50px;
    width: 100%;
    background-color: #ffffff;
    border: 1px solid #e1e9f5;
    border-radius: 8px;
    padding-left: 20px;
    padding-right: 50px;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0px 4px 15px rgba(1, 40, 79, 0.02);
    float: none;
}

.dg-rate-calc-input-box .nice-select:focus,
.dg-rate-calc-input-box .nice-select.open {
    border-color: rgba(251, 92, 8, 0.4);
    box-shadow: 0px 4px 20px rgba(251, 92, 8, 0.06);
}

.dg-rate-calc-input-box .nice-select:after {
    border-bottom: 2px solid var(--tanspot-base, #FB5C08);
    border-right: 2px solid var(--tanspot-base, #FB5C08);
    height: 8px;
    width: 8px;
    right: 20px;
    top: 50%;
    margin-top: -5px;
    transition: transform 0.15s ease-in-out;
}

.dg-rate-calc-input-box .nice-select.open:after {
    transform: rotate(-135deg);
}

.dg-rate-calc-input-box .nice-select .list {
    border-radius: 8px;
    box-shadow: 0px 10px 30px rgba(1, 40, 79, 0.1);
    border: 1px solid #e1e9f5;
    width: 100%;
    margin-top: 5px;
    z-index: 99;
}

.dg-rate-calc-input-box .nice-select .option {
    line-height: 44px;
    min-height: 44px;
    padding-left: 20px;
    font-size: 14px;
    color: white !important;
    transition: all 0.2s ease;
}

.dg-rate-calc-input-box .nice-select .option:hover,
.dg-rate-calc-input-box .nice-select .option.focus {
    background-color: var(--tanspot-black);
}

.dg-rate-calc-input-box .nice-select .option.selected {
    font-weight: 600;
    background-color: var(--tanspot-black);
}

/* Icon Inside Input */
.dg-rate-calc-icon {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    font-size: 17px;
    color: var(--tanspot-base, #FB5C08);
    pointer-events: none;
    transition: color 0.3s ease;
    z-index: 2;
}

/* Checkboxes Styling */
.dg-rate-calc-options {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 45px;
}

.dg-rate-calc-checkbox-container {
    display: inline-flex;
    align-items: center;
    position: relative;
    cursor: pointer;
    font-family: var(--tanspot-font, "Poppins", sans-serif);
    font-size: 15px;
    font-weight: 500;
    color: #5d6c7f;
    user-select: none;
    padding-left: 30px;
}

.dg-rate-calc-checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.dg-rate-calc-checkmark {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    height: 18px;
    width: 18px;
    background-color: #ffffff;
    border: 1.5px solid #c7d6e8;
    border-radius: 3px;
    transition: all 0.2s ease;
}

/* On hover, add a light orange border */
.dg-rate-calc-checkbox-container:hover input~.dg-rate-calc-checkmark {
    border-color: var(--tanspot-base, #FB5C08);
}

/* Checked state */
.dg-rate-calc-checkbox-container input:checked~.dg-rate-calc-checkmark {
    background-color: var(--tanspot-base, #FB5C08);
    border-color: var(--tanspot-base, #FB5C08);
}

/* Create the checkmark indicator */
.dg-rate-calc-checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

/* Show checkmark when checked */
.dg-rate-calc-checkbox-container input:checked~.dg-rate-calc-checkmark:after {
    display: block;
}

/* Checkmark style */
.dg-rate-calc-checkbox-container .dg-rate-calc-checkmark:after {
    left: 5px;
    top: 1px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Submit Button styling */
.dg-rate-calc-submit-box {
    position: relative;
    display: block;
}

.dg-rate-calc-btn {
    font-family: var(--tanspot-font-two, "Rubik", sans-serif);
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    background: var(--tanspot-base, #FB5C08);
    border: none;
    border-radius: 8px;
    padding: 18px 45px;
    cursor: pointer;
    box-shadow: 0px 10px 30px rgba(251, 92, 8, 0.25);
    transition: all 0.3s ease;
}

.dg-rate-calc-btn:hover {
    background-color: var(--tanspot-black, #01284F);
    box-shadow: 0px 10px 30px rgba(1, 40, 79, 0.2);
    transform: translateY(-2px);
}

/* Image wrapper and Delivery Man placement */
.dg-rate-calc-image-wrapper {
    position: absolute;
    bottom: -50px;
    right: 0;
    width: 100%;
    z-index: 10;
    pointer-events: none;
    display: flex;
    justify-content: flex-end;
}

.dg-rate-calc-img {
    max-height: 520px;
    object-fit: contain;
    transform: scale(1.05);
    transform-origin: bottom right;
}

/* Responsive Overrides */
@media (max-width: 1199px) {
    .dg-rate-calc-section {
        padding: 80px 0 80px;
    }

    .dg-rate-calc-img {
        max-height: 440px;
        transform: scale(1);
    }

    .dg-rate-calc-image-wrapper {
        bottom: -80px;
    }
}

@media (max-width: 991px) {
    .dg-rate-calc-section {
        padding: 60px 0 60px;
        overflow: hidden;
    }

    .dg-rate-calc-section .container {
        overflow: hidden;
    }

    .dg-rate-calc-image-wrapper {
        position: relative;
        bottom: 0;
        margin-top: 40px;
        justify-content: center;
    }

    .dg-rate-calc-img {
        max-height: 350px;
    }

    .dg-rate-calc-options {
        gap: 15px 25px;
    }
}

@media (max-width: 575px) {
    .dg-rate-calc-subtitle {
        font-size: 18px;
    }

    .dg-rate-calc-input-box input[type="text"],
    .dg-rate-calc-input-box input[type="email"],
    .dg-rate-calc-input-box input[type="tel"],
    .dg-rate-calc-input-box input[type="number"],
    .dg-rate-calc-input-box select {
        height: 56px;
    }

    .dg-rate-calc-options {
        flex-direction: column;
        gap: 12px;
    }

    .dg-rate-calc-btn {
        width: 100%;
        text-align: center;
    }
}

/* Fix for HTML5 validation error "An invalid form control is not focusable" with Nice Select */
.dg-rate-calc-input-box select.dg-rate-calc-select {
    display: block !important;
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Custom Add and Remove buttons for B2B Dimension Rows */
#dg-btn-add-row {
    background-color: var(--tanspot-base, #FB5C08);
    color: #ffffff;
    border: none;
    height: 50px;
    width: 50px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0px 4px 10px rgba(251, 92, 8, 0.25);
    transition: all 0.3s ease;
    cursor: pointer;
}

#dg-btn-add-row:hover {
    background-color: var(--tanspot-black, #01284F);
    box-shadow: 0px 4px 15px rgba(1, 40, 79, 0.3);
    transform: translateY(-1px);
}

.dg-btn-remove-row {
    background-color: #dc3545;
    color: #ffffff;
    border: none;
    height: 50px;
    width: 50px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0px 4px 10px rgba(220, 53, 69, 0.25);
    transition: all 0.3s ease;
    cursor: pointer;
}

.dg-btn-remove-row:hover {
    background-color: #bd2130;
    box-shadow: 0px 4px 15px rgba(189, 33, 48, 0.3);
    transform: translateY(-1px);
}