/**
 * SWA Visa Carousel Styles
 *
 * @package SWA
 */

/* Carousel Wrapper */
.swa-visa-carousel-wrapper {
    position: relative;
    padding: var(--swa-space-6) 60px;
    width: 100%;
    box-sizing: border-box;
}

/* Fallback: Display cards in a grid if Swiper doesn't load */
.swa-visa-carousel-wrapper:not(.swiper-initialized) .swiper-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--swa-space-6);
}

.swa-visa-carousel-wrapper:not(.swiper-initialized) .swiper-slide {
    width: 100% !important;
}

/* Main Carousel */
.swa-visa-carousel {
    position: relative;
    overflow: hidden;
    padding-bottom: var(--swa-space-10);
    width: 100%;
}

.swa-visa-carousel .swiper-wrapper {
    display: flex;
    align-items: stretch;
}

.swa-visa-carousel .swiper-slide {
    height: auto;
    display: flex;
    box-sizing: border-box;
}

.swa-visa-carousel .swiper-slide .swa-visa-card {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    margin: 0;
}

/* Navigation Buttons - LTR Default */
.swa-visa-carousel .swa-carousel-nav-button {
    position: absolute;
    top: calc(50% - 40px);
    transform: translateY(-50%);
    z-index: 20;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--swa-white);
    border: 2px solid var(--swa-gray-200);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: var(--swa-primary, #d18829);
}

.swa-visa-carousel .swa-carousel-nav-button::after {
    display: none !important;
}

.swa-visa-carousel .swa-carousel-nav-button:hover {
    background: var(--swa-primary, #d18829);
    color: var(--swa-white);
    border-color: var(--swa-primary, #d18829);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 6px 20px rgba(209, 136, 41, 0.4);
}

.swa-visa-carousel .swa-carousel-nav-button:active {
    transform: translateY(-50%) scale(0.95);
}

.swa-visa-carousel .swa-carousel-nav-button svg {
    width: 24px;
    height: 24px;
    stroke-width: 2.5;
    flex-shrink: 0;
}

.swa-visa-carousel .swa-carousel-nav-button.swiper-button-disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

/* LTR: Prev on Left, Next on Right */
.swa-visa-carousel .swiper-button-prev {
    left: -54px;
    right: auto;
}

.swa-visa-carousel .swiper-button-next {
    right: -54px;
    left: auto;
}

/* RTL Support: Swap arrow positions and directions */
[dir="rtl"] .swa-visa-carousel .swiper-button-prev,
.swa-rtl .swa-visa-carousel .swiper-button-prev,
body.rtl .swa-visa-carousel .swiper-button-prev {
    left: auto;
    right: -54px;
}

[dir="rtl"] .swa-visa-carousel .swiper-button-next,
.swa-rtl .swa-visa-carousel .swiper-button-next,
body.rtl .swa-visa-carousel .swiper-button-next {
    right: auto;
    left: -54px;
}

/* Flip arrow icons in RTL */
[dir="rtl"] .swa-visa-carousel .swiper-button-prev svg,
.swa-rtl .swa-visa-carousel .swiper-button-prev svg,
body.rtl .swa-visa-carousel .swiper-button-prev svg,
[dir="rtl"] .swa-visa-carousel .swiper-button-next svg,
.swa-rtl .swa-visa-carousel .swiper-button-next svg,
body.rtl .swa-visa-carousel .swiper-button-next svg {
    transform: scaleX(-1);
}

/* Pagination */
.swa-visa-carousel .swiper-pagination {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.swa-visa-carousel .swiper-pagination-bullet {
    width: 12px;
    height: 12px;
    background: var(--swa-gray-300, #CED4DA);
    opacity: 1;
    border-radius: 50%;
    transition: all 0.3s ease;
    cursor: pointer;
    margin: 0 !important;
}

.swa-visa-carousel .swiper-pagination-bullet:hover {
    background: var(--swa-gray-400, #ADB5BD);
}

.swa-visa-carousel .swiper-pagination-bullet-active {
    background: var(--swa-primary, #d18829);
    width: 32px;
    border-radius: 6px;
}

/* Responsive - Tablet */
@media (max-width: 1200px) {
    .swa-visa-carousel-wrapper {
        padding: var(--swa-space-4) 50px;
    }

    .swa-visa-carousel .swiper-button-prev {
        left: -45px;
    }

    .swa-visa-carousel .swiper-button-next {
        right: -45px;
    }

    [dir="rtl"] .swa-visa-carousel .swiper-button-prev,
    .swa-rtl .swa-visa-carousel .swiper-button-prev,
    body.rtl .swa-visa-carousel .swiper-button-prev {
        right: -45px;
        left: auto;
    }

    [dir="rtl"] .swa-visa-carousel .swiper-button-next,
    .swa-rtl .swa-visa-carousel .swiper-button-next,
    body.rtl .swa-visa-carousel .swiper-button-next {
        left: -45px;
        right: auto;
    }
}

/* Responsive - Small Tablet */
@media (max-width: 1024px) {
    .swa-visa-carousel-wrapper {
        padding: var(--swa-space-4) 40px;
    }

    .swa-visa-carousel .swa-carousel-nav-button {
        width: 40px;
        height: 40px;
    }

    .swa-visa-carousel .swa-carousel-nav-button svg {
        width: 20px;
        height: 20px;
    }

    .swa-visa-carousel .swiper-button-prev {
        left: -35px;
    }

    .swa-visa-carousel .swiper-button-next {
        right: -35px;
    }

    [dir="rtl"] .swa-visa-carousel .swiper-button-prev,
    .swa-rtl .swa-visa-carousel .swiper-button-prev,
    body.rtl .swa-visa-carousel .swiper-button-prev {
        right: -35px;
        left: auto;
    }

    [dir="rtl"] .swa-visa-carousel .swiper-button-next,
    .swa-rtl .swa-visa-carousel .swiper-button-next,
    body.rtl .swa-visa-carousel .swiper-button-next {
        left: -35px;
        right: auto;
    }
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .swa-visa-carousel-wrapper {
        padding: var(--swa-space-4) var(--swa-space-4);
    }

    .swa-visa-carousel .swiper-button-prev,
    .swa-visa-carousel .swiper-button-next {
        display: none !important;
    }

    .swa-visa-carousel {
        padding-bottom: var(--swa-space-8);
    }

    .swa-visa-carousel .swiper-pagination {
        position: relative;
        margin-top: var(--swa-space-4);
    }
}

/* Responsive - Small Mobile */
@media (max-width: 480px) {
    .swa-visa-carousel .swiper-pagination-bullet {
        width: 10px;
        height: 10px;
    }

    .swa-visa-carousel .swiper-pagination-bullet-active {
        width: 24px;
    }
}

/* Elementor Editor Styles */
.elementor-editor-active .swa-visa-carousel-wrapper {
    min-height: 350px;
}

.elementor-editor-active .swa-visa-carousel .swiper-slide {
    min-height: 300px;
}

/* Loading State */
.swa-visa-carousel-wrapper.loading {
    opacity: 0.6;
    pointer-events: none;
}

.swa-visa-carousel-wrapper.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid var(--swa-gray-200, #DEE2E6);
    border-top-color: var(--swa-primary, #d18829);
    border-radius: 50%;
    animation: swa-carousel-spin 1s linear infinite;
    z-index: 100;
}

@keyframes swa-carousel-spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Accessibility */
.swa-visa-carousel .swa-carousel-nav-button:focus {
    outline: 3px solid var(--swa-primary, #d18829);
    outline-offset: 2px;
}

.swa-visa-carousel .swiper-pagination-bullet:focus {
    outline: 2px solid var(--swa-primary, #d18829);
    outline-offset: 2px;
}

/* Override default Swiper navigation styles */
.swa-visa-carousel .swiper-button-prev::after,
.swa-visa-carousel .swiper-button-next::after {
    display: none !important;
    content: none !important;
}

/* Print Styles */
@media print {
    .swa-visa-carousel-wrapper {
        padding: 0;
    }

    .swa-carousel-nav-button,
    .swa-visa-carousel .swiper-pagination {
        display: none !important;
    }

    .swa-visa-carousel .swiper-wrapper {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .swa-visa-carousel .swiper-slide {
        width: 100% !important;
        margin-bottom: 20px;
    }
}
