/* WAC Lightbox Styles - Consolidated with iPad Support */
.wac-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.wac-lightbox--open {
    opacity: 1;
    visibility: visible;
}

.wac-lightbox__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

.wac-lightbox__container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.wac-lightbox__image-container {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wac-lightbox__image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: opacity 0.3s ease;
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.wac-lightbox__loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
    align-items: center;
    justify-content: center;
}

.wac-lightbox__spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #fff;
    border-radius: 50%;
    animation: wac-lightbox-spin 1s linear infinite;
}

@keyframes wac-lightbox-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Consolidated button styling */
.wac-lightbox__close,
.wac-lightbox__prev,
.wac-lightbox__next {
    position: absolute;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #032165;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 10001;
    transition: background-color 0.3s ease, opacity 0.3s ease;
}

/* Remove transform/scale hover effects - only change background */
.wac-lightbox__close:hover,
.wac-lightbox__prev:hover,
.wac-lightbox__next:hover {
    background: rgba(255, 255, 255, 1);
}

.wac-lightbox__close:focus,
.wac-lightbox__prev:focus,
.wac-lightbox__next:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

.wac-lightbox__close:active,
.wac-lightbox__prev:active,
.wac-lightbox__next:active {
    background: rgba(255, 255, 255, 0.8);
}

/* Button positioning */
.wac-lightbox__close {
    top: 20px;
    right: 20px;
}

.wac-lightbox__prev {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.wac-lightbox__next {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.wac-lightbox__counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    backdrop-filter: blur(4px);
}

/* Body class when lightbox is open */
.wac-lightbox-open {
    overflow: hidden;
}

/* Mobile responsive adjustments (up to 768px) */
@media (max-width: 768px) {
    .wac-lightbox__container {
        padding: 10px;
    }

    .wac-lightbox__image-container {
        max-width: 95%;
        max-height: 85%;
    }

    .wac-lightbox__close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
    }

    .wac-lightbox__prev,
    .wac-lightbox__next {
        width: 40px;
        height: 40px;
    }

    .wac-lightbox__prev {
        left: 10px;
    }

    .wac-lightbox__next {
        right: 10px;
    }

    .wac-lightbox__counter {
        bottom: 10px;
        font-size: 12px;
        padding: 6px 12px;
    }
}

/* iPad responsive adjustments (769px to 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .wac-lightbox__container {
        padding: 15px;
    }

    .wac-lightbox__image-container {
        max-width: 92%;
        max-height: 88%;
    }

    .wac-lightbox__close {
        top: 15px;
        right: 15px;
        width: 48px;
        height: 48px;
    }

    .wac-lightbox__prev,
    .wac-lightbox__next {
        width: 48px;
        height: 48px;
    }

    .wac-lightbox__prev {
        left: 15px;
    }

    .wac-lightbox__next {
        right: 15px;
    }

    .wac-lightbox__counter {
        bottom: 15px;
        font-size: 14px;
        padding: 8px 16px;
    }
}

/* Mobile lightbox enabled styling - responsive for viewport changes */
.wac-image-slider--lightbox-enabled .wac-image-slider__item-image {
    position: relative;
    transition: transform 0.2s ease, filter 0.2s ease;
}

/* Mobile rules (up to 768px) */
@media (max-width: 768px) {
    .wac-image-slider--lightbox-enabled .wac-image-slider__item-image {
        cursor: pointer !important;
    }

    .wac-image-slider--lightbox-enabled .wac-image-slider__item-image:hover {
        transform: scale(1.02);
        filter: brightness(1.1);
    }

    .wac-image-slider--lightbox-enabled .wac-image-slider__item-image:active {
        transform: scale(0.98);
    }

    /* Add a subtle tap indicator for lightbox-enabled images */
    .wac-image-slider--lightbox-enabled .wac-image-slider__item-image::after {
        content: '';
        position: absolute;
        top: 12px;
        right: 12px;
        width: 24px;
        height: 24px;
        background: rgba(255, 255, 255, 0.9);
        border-radius: 50%;
        opacity: 0;
        transition: opacity 0.3s ease;
        background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M15 3H6C4.343 3 3 4.343 3 6V18C3 19.657 4.343 21 6 21H18C19.657 21 21 19.657 21 18V9M15 3L21 9M15 3V9H21' stroke='%23032165' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: center;
        background-size: 12px 12px;
    }

    .wac-image-slider--lightbox-enabled .wac-image-slider__item:hover .wac-image-slider__item-image::after {
        opacity: 1;
    }
}

/* iPad rules (769px to 1024px) - same behavior as mobile */
@media (min-width: 769px) and (max-width: 1024px) {
    .wac-image-slider--lightbox-enabled .wac-image-slider__item-image {
        cursor: pointer !important;
    }

    .wac-image-slider--lightbox-enabled .wac-image-slider__item-image:hover {
        transform: scale(1.02);
        filter: brightness(1.1);
    }

    .wac-image-slider--lightbox-enabled .wac-image-slider__item-image:active {
        transform: scale(0.98);
    }

    /* Add a subtle tap indicator for lightbox-enabled images on iPad */
    .wac-image-slider--lightbox-enabled .wac-image-slider__item-image::after {
        content: '';
        position: absolute;
        top: 12px;
        right: 12px;
        width: 28px;
        height: 28px;
        background: rgba(255, 255, 255, 0.9);
        border-radius: 50%;
        opacity: 0;
        transition: opacity 0.3s ease;
        background-image: url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M15 3H6C4.343 3 3 4.343 3 6V18C3 19.657 4.343 21 6 21H18C19.657 21 21 19.657 21 18V9M15 3L21 9M15 3V9H21' stroke='%23032165' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: center;
        background-size: 14px 14px;
    }

    .wac-image-slider--lightbox-enabled .wac-image-slider__item:hover .wac-image-slider__item-image::after {
        opacity: 1;
    }
}

/* Desktop - ensure lightbox styles are disabled (1025px and up) */
@media (min-width: 1025px) {
    .wac-image-slider--lightbox-enabled .wac-image-slider__item-image {
        cursor: default !important;
    }

    .wac-image-slider--lightbox-enabled .wac-image-slider__item-image::after {
        display: none !important;
    }
}

/* High DPI display optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .wac-lightbox__image {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {

    .wac-lightbox,
    .wac-lightbox__image,
    .wac-lightbox__close,
    .wac-lightbox__prev,
    .wac-lightbox__next {
        transition: none;
    }

    .wac-lightbox__spinner {
        animation: none;
    }
}