// SWIPER BLOCK CSS. 
// Pagination CSS.
.sp-real-swiper-pagination {
    // override default css.
    position: relative !important;
    width: 100% !important;
    inset: 0 !important;
    transform: unset !important;
    transition: var(--sp-real-transition) !important;

    .swiper-pagination-bullet {
        margin: 0 !important;
    }

    span {
        &:focus {
            outline: none;
        }
    }

    // all bullet.
    .swiper-pagination-bullet {
        opacity: 1;
        transition:
            background 0.3s ease,
            width 0.3s ease,
            height 0.3s ease;
        border-radius: 4px;
        background-color: #d9d9d9;

        &.swiper-pagination-bullet-active {
            background-color: var(--sp-real-primary-color);
        }
    }

    // strokes.
    &.strokes .swiper-pagination-bullet {
        transition: width 0.3s ease;
    }

    // Scrollbar.
    &.swiper-scrollbar {
        box-sizing: border-box;
    }

    // Variant: dots — circular bullets (inactive/active tint from dynamic CSS).
    &.dots .swiper-pagination-bullet,
    &.dynamic .swiper-pagination-bullet {
        border-radius: 50%;
    }

    // fraction.
    &.fraction {
        margin-left: auto !important;
        margin-right: auto !important;
        border-radius: 8px;
    }

    // number.
    &.number .swiper-pagination-bullet {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

// navigation arrow css.
.sp-real-swiper-nav-arrows {
    position: absolute;
    width: 100%;

    .sp-real-swiper-navigation {
        cursor: pointer;
        transition: all 0.4s ease-in-out;
        z-index: 999;
        background-color: #fff;

        &:focus {
            outline: none;
        }
    }

    .sp-real-nav-prev {
        transform: rotate(180deg);
    }

    &.sp-real-nav-pos-vertical_center {
        width: unset;
        transform: translateY(-50%);
        z-index: 99;
    }

    &.sp-real-nav-pos-top_left,
    &.sp-real-nav-pos-bottom_left {
        justify-content: flex-start;
    }

    &.sp-real-nav-pos-top_right,
    &.sp-real-nav-pos-bottom_right {
        justify-content: flex-end;
    }

    &.sp-real-nav-pos-top_center,
    &.sp-real-nav-pos-bottom_center {
        justify-content: center;
    }
}

// RTL support
[dir="rtl"] {
    .sp-swiper-button-prev {
        left: auto;
        right: -20px;

        @media (max-width: 1024px) {
            right: 10px;
            left: auto;
        }
    }

    .sp-swiper-button-next {
        right: auto;
        left: -20px;

        @media (max-width: 1024px) {
            left: 10px;
            right: auto;
        }
    }
}

// TESTIMONIAL SUBMISSION FORM CSS.
// testimonial submission form style.
.sp-real-testimonial-submission-form {
    margin: 0 auto;

    * {
        font-family: inherit;
        box-sizing: border-box;
    }

    .sp-real-tsf-form {
        position: relative;
        overflow: hidden;
    }

    .sp-real-tsf-required-notice {
        font-size: 14px;
        color: #444;
        font-weight: 400;
        margin-top: 0;
        margin-bottom: 20px;
    }

    // fields container (row-wrap so fields share rows by width).
    .sp-real-tsf-fields {
        width: 100%;
    }

    // Input Style Two — label sits left of the input on a single row (default
    // Style One stacks label above input via the field's own `sp-flex-col`).
    .sp-real-tsf-input-style-two {
        .sp-real-tsf-field {
            flex-direction: row;
            flex-wrap: wrap;
            align-items: center;
            column-gap: 16px;
        }

        .sp-real-tsf-field-label-section {
            flex: 0 0 30%;
            max-width: 30%;
        }

        // Input column takes the remaining row width.
        >.sp-real-tsf-field>.sp-real-tsf-field__input,
        >.sp-real-tsf-field>.sp-real-tsf-rating {
            flex: 1 1 0;
            width: auto;
            min-width: 0;
        }

        // Notes and help text drop to a full-width row.
        >.sp-real-tsf-field>.sp-real-tsf-field__note {
            flex: 0 0 100%;
            max-width: 100%;
        }

        .sp-real-tsf-field__note:not(.sp-tsf-rating-note) {
            text-align: right;
        }
    }

    .sp-real-tsf-field {
        min-width: 0;
    }

    .sp-real-tsf-field__input {
        width: 100%;
    }

    textarea.sp-real-tsf-field__input {
        resize: vertical;
        min-height: 96px;
    }

    // File upload input.
    .sp-real-tsf-field__file {
        padding: 8px;
    }

    .sp-real-tsf-field__note,
    .sp-real-tsf-field__length {
        color: #949494;
    }

    // length info next to label.
    .sp-real-tsf-field__length {
        font-size: 12px;
        font-style: italic;
        font-weight: 400;
        line-height: 1.2;
    }

    // label.
    .sp-real-tsf-field__label {
        font-weight: 500;
    }

    .sp-real-tsf-required {
        color: red;
        margin-left: 2px;
    }

    // star rating.
    .sp-real-tsf-rating {
        font-size: 22px;
        line-height: 1;
        color: #D1D5DB;
        gap: 4px;

        // hide radio, show label as star.
        input[type="radio"] {
            position: absolute;
            width: 1px;
            height: 1px;
            opacity: 0;
            pointer-events: none;
        }

        .sp-real-tsf-rating__item {
            display: inline-flex;
        }

        label {
            color: inherit;
            line-height: 1;
        }

        // row-reverse + sibling combinator paints stars left → right when filled.
        .sp-real-tsf-rating__item:has(input:checked) label,
        .sp-real-tsf-rating__item:has(input:checked)~.sp-real-tsf-rating__item label,
        .sp-real-tsf-rating__item:hover~.sp-real-tsf-rating__item label,
        .sp-real-tsf-rating__item:hover label {
            color: #F5B301;
        }
    }

    // terms checkbox row.
    .sp-real-tsf-field__checkbox {
        cursor: pointer;

        input[type="checkbox"] {
            width: 16px;
            height: 16px;
            margin: 0;
            flex-shrink: 0;

            &:focus {
                outline: none;
            }
        }
    }

    .sp-real-tsf-field__terms {
        font-size: 15px;
        font-weight: 400;
        line-height: 1.4;

        a {
            text-decoration: underline;
        }
    }

    // input focus.
    .sp-real-tsf-field__input:focus {
        outline: none;
    }

    // submit button.
    .sp-real-tsf-submit {
        color: #fff;
        background-color: var(--sp-real-primary-color);

        &.loading {
            opacity: 0.8;
            cursor: progress;
        }

        &:hover {
            background-color: var(--sp-real-primary-color-hover);
        }
    }

    // submit button icon.
    .sp-real-tsf-submit__icon {
        flex-shrink: 0;
        line-height: 0;

        .sp-real-library-icon {
            display: inline-flex;
            width: 100%;
            height: 100%;
        }

        svg,
        img {
            width: 100%;
            height: 100%;
            fill: currentColor;
        }
    }

    .sp-tsf-full-btn {
        .sp-real-tsf-submit {
            width: 100%;
        }
    }

    .sp-real-tsf-message {
        font-size: 16px;
        line-height: 1.2;
        font-weight: 400;
        padding: 16px 20px;
        border-radius: 4px;

        &[hidden] {
            display: none;
        }
    }

    .sp-real-tsf-message__success {
        color: #2f2f2f;
        background-color: #4AB8661F;
        border: 1px solid #4AB8664D;
    }

    .sp-real-tsf-message__error {
        color: #2f2f2f;
        background-color: #CC18181F;
        border: 1px solid #CC18184D;
    }

    // popup.
    .sp-real-tsf-popup {
        position: fixed;
        inset: 0;
        z-index: 9999;

        &[hidden] {
            display: none !important;
        }
    }

    .sp-real-tsf-popup__overlay {
        position: fixed;
        inset: 0;
        background-color: rgba(0, 0, 0, 0.6);
    }

    .sp-real-tsf-popup__inner {
        position: relative;
        z-index: 1;
        background-color: #fff;
        max-width: 100%;
    }

    .sp-real-tsf-popup__close {
        position: absolute;
        top: 8px;
        right: 12px;
        background: transparent;
        border: 0;
        font-size: 24px;
        line-height: 1;
        z-index: 999;
    }
}

// template one css.
.sp-real-tsf-template-one {
    .sp-real-tsf-field {
        flex-direction: column;
    }
}

// template two css.
.sp-real-tsf-template-two {
    .sp-real-tsf-field {
        flex-direction: row;
        justify-content: space-between;
        position: relative;
        align-items: start;
    }

    .sp-real-tsf-field__length {
        position: absolute;
        right: 0;
        bottom: 0;
    }

    .sp-real-tsf-field__input {
        width: 60%;
    }

    .sp-real-tsf-field:has(.sp-real-tsf-field__length) .sp-real-tsf-field__input {
        margin-bottom: 20px;
    }
}

.sp-real-multiselect__frontend {
    position: relative;

    .sp-real-multiselect__dropdown {
        position: absolute;
        top: calc(100% + 4px);
        z-index: 9999;
        overflow-y: auto;
        width: 100%;
        max-height: 290px;
        padding: 0 !important;
        background-color: #fff;

        &:not(:has(*)) {
            display: none;
        }
    }

    .sp-real-multiselect__chosen {
        flex-wrap: wrap;
        width: 100%;

        .sp-real-multiselect__item-remove {
            font-size: 14px;
            line-height: 1.2;
            display: block;
        }
    }

    .sp-real-multiselect__placeholder:not(:only-child) {
        display: none;
    }

    .sp-real-multiselect__item {
        padding: 8px;
        border-radius: 2px;
    }

    .sp-real-multiselect__chosen .sp-real-multiselect__item,
    .sp-real-multiselect__item:hover {
        color: #2f2f2f;
        background-color: #E2E2E2;
    }

    .sp-real-multiselect__value {
        position: absolute;
        z-index: -1;
        opacity: 0;
        width: 100%;
        height: 100%;
    }
}

// background image overlay on form wrapper.
.sp-real-tsf-form.sp-real-bg-image {
    &::after {
        content: '';
        position: absolute;
        inset: 0;
        z-index: 0;
        border-radius: inherit;
    }

    &>* {
        position: relative;
        z-index: 1;
    }
}

// stack fields full-width on mobile.
@media (max-width: 575px) {
    .sp-real-testimonial-submission-form .sp-real-tsf-field {
        width: 100% !important;
    }
}