/**
 * SHG Image Carousel Styles
 */

.shg-carousel-wrapper {
    width: 100%;
    max-width: 100%; /* Full width to fit 4 images */
    position: relative;
    margin: 0 auto;
    padding: 0 70px; /* Reserve 70px on each side for buttons (40px button + 20px spacing + 10px min gap) */
    overflow: visible !important;
}

.shg-carousel-wrapper .swiper {
    width: 100%;
    max-width: 100%; /* Full width - no restriction */
    margin: 0 auto;
    padding: 0;
    position: relative;
    overflow: hidden;
}

.shg-carousel-wrapper .swiper-wrapper {
    overflow: visible;
}

.shg-carousel-wrapper .swiper-slide {
    /* Width controlled by Swiper slidesPerView - don't override */
    height: auto !important;
    aspect-ratio: 1 / 1; /* Square images */
}

.shg-carousel-image-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 100%; /* 1:1 aspect ratio fallback for older browsers */
    overflow: hidden;
    background: #f5f5f5;
    border-radius: 0;
}

.shg-carousel-image-wrapper img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    min-width: 100%;
    min-height: 100%;
    object-fit: cover;
    object-position: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.shg-carousel-image-wrapper:hover img {
    transform: translate(-50%, -50%) scale(1.05);
}

/* Lightbox overlay */
.shg-carousel-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.shg-carousel-lightbox.active {
    display: flex;
}

.shg-carousel-lightbox img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
}

.shg-carousel-lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10000;
    transition: opacity 0.3s ease;
}

.shg-carousel-lightbox-close:hover {
    opacity: 0.7;
}

/* Navigation arrows */
.shg-carousel-wrapper .swiper-button-prev,
.shg-carousel-wrapper .swiper-button-next {
    position: absolute !important;
    width: 40px !important;
    height: 40px !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    border: none !important;
    transition: all 0.3s ease !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    margin-top: 0 !important;
    z-index: 100 !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    cursor: pointer !important;
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: transparent !important;
}

.shg-carousel-wrapper .swiper-button-prev::after,
.shg-carousel-wrapper .swiper-button-next::after {
    display: none !important;
}

.shg-carousel-wrapper .swiper-button-prev {
    background-image: url('../images/prev_button_icon.png') !important;
    transform: translateY(-50%) scaleX(-1) !important; /* Flip to point left */
}

.shg-carousel-wrapper .swiper-button-next {
    background-image: url('../images/prev_button_icon.png') !important;
}

/* Position buttons 20px outside the swiper container */
.shg-carousel-wrapper .swiper-button-prev {
    left: 20px !important; /* 20px from wrapper edge, which has 90px padding */
}

.shg-carousel-wrapper .swiper-button-next {
    right: 20px !important; /* 20px from wrapper edge, which has 90px padding */
}

.shg-carousel-wrapper .swiper-button-prev:hover {
    transform: translateY(-50%) scaleX(-1) scale(1.1) !important;
    opacity: 0.8 !important;
}

.shg-carousel-wrapper .swiper-button-next:hover {
    transform: translateY(-50%) scale(1.1) !important;
    opacity: 0.8 !important;
}

.shg-carousel-wrapper .swiper-button-prev.swiper-button-disabled,
.shg-carousel-wrapper .swiper-button-next.swiper-button-disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* Pagination dots */
.shg-carousel-wrapper .swiper-pagination {
    position: relative;
    margin-top: 20px;
}

.shg-carousel-wrapper .swiper-pagination-bullet {
    width: 12px;
    height: 12px;
    background: #d0ab76;
    opacity: 0.4;
    transition: all 0.3s ease;
}

.shg-carousel-wrapper .swiper-pagination-bullet-active {
    opacity: 1;
    transform: scale(1.2);
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    /* On tablets and below, remove padding and move buttons inside */
    .shg-carousel-wrapper {
        padding: 0;
    }

    .shg-carousel-wrapper .swiper {
        overflow: hidden;
        touch-action: pan-y !important;
    }

    .shg-carousel-wrapper .swiper-slide {
        /* Width controlled by Swiper - auto sizes for tablets */
        height: auto !important;
        aspect-ratio: 1 / 1;
    }

    .shg-carousel-wrapper .swiper-button-prev {
        left: 10px !important;
        z-index: 200 !important;
    }

    .shg-carousel-wrapper .swiper-button-next {
        right: 10px !important;
        z-index: 200 !important;
    }

    .shg-carousel-wrapper .swiper-button-prev,
    .shg-carousel-wrapper .swiper-button-next {
        width: 40px !important;
        height: 40px !important;
        pointer-events: auto !important;
    }
}

@media (max-width: 768px) {
    .shg-carousel-wrapper .swiper-button-prev,
    .shg-carousel-wrapper .swiper-button-next {
        width: 35px !important;
        height: 35px !important;
        z-index: 200 !important;
        pointer-events: auto !important;
        cursor: pointer !important;
        -webkit-user-select: none !important;
        user-select: none !important;
    }

    .shg-carousel-wrapper .swiper-button-prev {
        left: 10px !important;
    }

    .shg-carousel-wrapper .swiper-button-next {
        right: 10px !important;
    }

    .shg-carousel-wrapper .swiper-slide {
        /* Width controlled by Swiper - auto sizes for mobile */
        height: auto !important;
        aspect-ratio: 1 / 1;
    }
}

@media (max-width: 480px) {
    .shg-carousel-wrapper .swiper-slide {
        /* Width controlled by Swiper - auto sizes for small phones */
        height: auto !important;
        aspect-ratio: 1 / 1;
    }

    .shg-carousel-wrapper .swiper-button-prev,
    .shg-carousel-wrapper .swiper-button-next {
        width: 35px !important;
        height: 35px !important;
        z-index: 200 !important;
        pointer-events: auto !important;
        cursor: pointer !important;
        -webkit-user-select: none !important;
        user-select: none !important;
    }

    .shg-carousel-wrapper .swiper-button-prev {
        left: 10px !important;
    }

    .shg-carousel-wrapper .swiper-button-next {
        right: 10px !important;
    }
}
