/**
 * UX Shop - Base Slider Styles
 * Mobile First - Common styles for all sliders
 */

/* Screen reader only text */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Loading skeleton - MOBILE FIRST */
.ux-shop-slider__skeleton,
.ux-shop-homepage-slider__skeleton {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f0f0f0;
    overflow: hidden;
    z-index: 0;
}

.ux-shop-slider__skeleton-slide,
.ux-shop-homepage-slider__skeleton-slide {
    width: 100%;
    height: 100%;
}

.ux-shop-slider__skeleton-content,
.ux-shop-homepage-slider__skeleton-content {
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        #f0f0f0 0%,
        #e0e0e0 20%,
        #f0f0f0 40%,
        #f0f0f0 100%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Base slider container */
.ux-shop-slider,
.ux-shop-homepage-slider {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #000;
}

/* Images */
.ux-shop-slider img,
.ux-shop-homepage-slider img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}

/* Box sizing */
.ux-shop-slider *,
.ux-shop-homepage-slider * {
    box-sizing: border-box;
}

/* Focus styles for accessibility */
.ux-shop-slider:focus,
.ux-shop-homepage-slider:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.ux-shop-slider button:focus,
.ux-shop-homepage-slider button:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* No JS fallback */
.no-js .ux-shop-slider__skeleton,
.no-js .ux-shop-homepage-slider__skeleton {
    display: none;
}

.no-js .ux-shop-slider__container,
.no-js .ux-shop-homepage-slider__container {
    display: block !important;
}

/* DESKTOP - skeleton aspect ratio */
@media (min-width: 768px) {
    .ux-shop-slider__skeleton-slide,
    .ux-shop-homepage-slider__skeleton-slide {
        aspect-ratio: var(--desktop-ratio, 2.328);
    }
}

/**
 * UX Shop - Product Slider
 * Mobile First - JavaScript controls desktop layout via .is-desktop class
 */

/* Main container - MOBILE FIRST */
.ux-shop-product-slider {
    --slider-aspect-ratio: 1 / 1;
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

.ux-shop-product-slider *,
.ux-shop-product-slider *::before,
.ux-shop-product-slider *::after {
    box-sizing: border-box;
}

/* Main image container - Mobile */
.ux-shop-product-slider__main-image {
    position: relative;
    width: 100%;
    aspect-ratio: var(--slider-aspect-ratio);
    overflow: hidden;
    margin-bottom: 16px;
}

.ux-shop-product-slider__main-image-container {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 4px;
    overflow: hidden;
    background: #f8f8f8;
}

/* Individual main image/video */
.ux-shop-product-slider__main-image-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
    margin: 0;
}

.ux-shop-product-slider__main-image-item--active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    z-index: 1;
}

/* Picture element */
.ux-shop-product-slider__main-image-item picture {
    display: block;
    width: 100%;
    height: 100%;
}

/* Images */
.ux-shop-product-slider__main-image-item img,
.ux-shop-product-slider__main-image-item picture img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Navigation arrows */
.ux-shop-product-slider__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.ux-shop-product-slider__arrow:hover {
    background-color: rgba(255, 255, 255, 1);
    transform: translateY(-50%) scale(1.05);
}

.ux-shop-product-slider__arrow:active {
    transform: translateY(-50%) scale(0.95);
}

.ux-shop-product-slider__arrow:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.ux-shop-product-slider__arrow--prev {
    left: 12px;
}

.ux-shop-product-slider__arrow--next {
    right: 12px;
}

.ux-shop-product-slider__arrow svg {
    width: 20px;
    height: 20px;
    fill: #333;
}

/* Thumbnails container - MOBILE */
.ux-shop-product-slider__thumbnails {
    width: 100%;
    overflow: hidden;
}

.ux-shop-product-slider__thumbnails-container {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 0 4px 4px 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.ux-shop-product-slider__thumbnails-container::-webkit-scrollbar {
    display: none;
}

/* Thumbnails */
.ux-shop-product-slider__thumbnail {
    flex: 0 0 calc(25% - 6px);
    max-width: 90px;
    aspect-ratio: 1 / 1;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.2s ease;
    background-color: #f8f8f8;
    position: relative;
}

.ux-shop-product-slider__thumbnail:hover {
    border-color: #ddd;
}

.ux-shop-product-slider__thumbnail--active {
    border-color: #000000;
    box-shadow: 0 0 0 1px #000000;
}

.ux-shop-product-slider__thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Video elements */
.ux-shop-product-slider__video-placeholder {
    cursor: pointer;
    position: relative;
}

.ux-shop-product-slider__video-item {
    cursor: pointer;
}

.ux-shop-product-slider__play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.ux-shop-product-slider__video-item:hover .ux-shop-product-slider__play-button {
    opacity: 0.8;
}

/* Video thumbnails */
.ux-shop-product-slider__video-thumbnail {
    position: relative;
}

.ux-shop-product-slider__thumbnail-play {
    position: absolute;
    bottom: 4px;
    right: 4px;
    z-index: 5;
    pointer-events: none;
}

/* Video iframe */
.ux-shop-product-slider__video-loaded iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}


/* Touch device improvements */
@media (hover: none) and (pointer: coarse) {
    .ux-shop-product-slider__thumbnail {
        min-width: 80px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .ux-shop-product-slider__main-image-item,
    .ux-shop-product-slider__thumbnail,
    .ux-shop-product-slider__arrow {
        transition: none;
    }
    
    .ux-shop-product-slider__thumbnails-container {
        scroll-behavior: auto;
    }
}

/* Print styles */
@media print {
    .ux-shop-product-slider__arrow,
    .ux-shop-product-slider__thumbnails {
        display: none;
    }
    
    .ux-shop-product-slider__main-image-item {
        position: static;
        opacity: 1;
        visibility: visible;
        page-break-inside: avoid;
    }
}

/* ========================================
   LIGHTBOX
   ======================================== */

.ux-shop-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.ux-shop-lightbox.active {
    opacity: 1;
    visibility: visible;
}

.ux-shop-lightbox__content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ux-shop-lightbox__image {
    max-width: 100%;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

/* Close button */
.ux-shop-lightbox__close {
    position: absolute;
    top: -50px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 40px;
    line-height: 1;
    cursor: pointer;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
    padding: 0;
}

.ux-shop-lightbox__close:hover {
    opacity: 0.7;
}

/* Navigation arrows */
.ux-shop-lightbox__prev,
.ux-shop-lightbox__next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 60px;
    font-weight: 300;
    cursor: pointer;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
}

.ux-shop-lightbox__prev:hover,
.ux-shop-lightbox__next:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.ux-shop-lightbox__prev {
    left: -80px;
}

.ux-shop-lightbox__next {
    right: -80px;
}

/* Counter */
.ux-shop-lightbox__counter {
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 16px;
    background: rgba(0, 0, 0, 0.6);
    padding: 8px 16px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
    white-space: nowrap;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .ux-shop-lightbox__prev,
    .ux-shop-lightbox__next {
        width: 50px;
        height: 50px;
        font-size: 40px;
    }
    
    .ux-shop-lightbox__prev {
        left: 10px;
    }
    
    .ux-shop-lightbox__next {
        right: 10px;
    }
    
    .ux-shop-lightbox__close {
        top: 10px;
        right: 10px;
        font-size: 36px;
    }
    
    .ux-shop-lightbox__counter {
        bottom: 10px;
        font-size: 14px;
        padding: 6px 12px;
    }
}

/* Prevent body scroll when lightbox is open */
body.ux-shop-lightbox-open {
    overflow: hidden;
}
