/* =============================================
   LUXON Product Gallery
   ============================================= */

.luxon-gallery-wrap {
    width: 100%;
    direction: rtl;
}

/* ---- Main Image ---- */
.luxon-main-swiper {
    border-radius: 16px;
    overflow: hidden;

    position: relative;
    width: 100%;
    /* Height is driven by the active slide (Swiper autoHeight). Image slides pin it to
       the fixed gallery height below; a video slide collapses to its own 16:9 box, so
       no dead space is left above and below the player. */
    height: auto;
    margin-bottom: 12px;
}

.luxon-main-swiper .swiper-slide {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Image slides share the video's 16:9 shape (user request 2026-07-21): the box
   is landscape at every width, matching the 600x335 product renditions almost
   exactly, so object-fit: cover barely crops. Height comes from aspect-ratio,
   so the fill chain (slide -> picture -> img, all 100%) still holds and the
   thumbs row keeps sitting 12px below with no dead space. */
.luxon-main-swiper .swiper-slide.luxon-slide--image {
    height: auto;
    aspect-ratio: 16 / 9;
}

.luxon-main-swiper .swiper-slide.luxon-slide--video,
.luxon-main-swiper .swiper-slide.luxon-slide--video .luxon-video-slide {
    height: auto;
}

.luxon-main-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: zoom-in;
    transition: transform 0.3s ease;
}

.luxon-main-img:hover {
    transform: scale(1.02);
}

/* ---- Video Slide ---- */
.luxon-video-slide {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.luxon-yt-wrap {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
}

.luxon-yt-wrap iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: none;
}

.luxon-video-file {
    width: 100%;
    display: block;
}

/* ---- Navigation Arrows (on main image) ---- */
.luxon-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    transition: background 0.2s, opacity 0.2s;
    padding: 0;
    opacity: 0.9;
}

.luxon-arrow:hover {
    background: #fff;
    opacity: 1;
}

.luxon-arrow svg {
    width: 17px;
    height: 17px;
    color: #222;
}

.luxon-arrow-prev { right: 12px; }
.luxon-arrow-next { left: 12px; }

.luxon-arrow.swiper-button-disabled {
    opacity: 0.2;
    pointer-events: none;
}

/* ---- Thumbnails Row ---- */
.luxon-thumbs-swiper {
    width: 100%;
}

.luxon-thumbs-swiper .swiper-wrapper {
    align-items: flex-start;
}

.luxon-thumbs-swiper .swiper-slide {
    width: 72px !important;
    height: 72px;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s, outline 0.2s;
    outline: 2px solid transparent;
    flex-shrink: 0;
    background: #f0f0f0;
}

.luxon-thumbs-swiper .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.luxon-thumbs-swiper .swiper-slide-thumb-active {
    opacity: 1;
    outline-color: #222;
}

.luxon-thumbs-swiper .swiper-slide:hover {
    opacity: 0.85;
}

/* ---- Video Thumb ---- */
.luxon-thumb-video {
    position: relative;
    width: 100%;
    height: 100%;
}

.luxon-thumb-video img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.luxon-play-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.35);
}

.luxon-play-icon svg {
    width: 20px;
    height: 20px;
    color: #fff;
}

/* ---- Lightbox ---- */
.luxon-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    align-items: center;
    justify-content: center;
}

.luxon-lightbox.active { display: flex; }

.luxon-lightbox-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.9);
    cursor: pointer;
}

.luxon-lightbox-inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.luxon-lb-media img {
    max-width: 82vw;
    max-height: 88vh;
    border-radius: 10px;
    display: block;
    object-fit: cover;
}

.luxon-lb-media .luxon-yt-wrap {
    width: 80vw;
    max-width: 860px;
    border-radius: 10px;
}

.luxon-lb-close {
    position: fixed;
    top: 18px;
    right: 18px;
    background: rgba(255,255,255,0.12);
    border: none;
    color: #fff;
    font-size: 26px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 2;
}

.luxon-lb-close:hover { background: rgba(255,255,255,0.25); }

.luxon-lb-prev,
.luxon-lb-next {
    background: rgba(255,255,255,0.12);
    border: none;
    color: #fff;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}

.luxon-lb-prev:hover,
.luxon-lb-next:hover { background: rgba(255,255,255,0.28); }

.luxon-lb-prev svg,
.luxon-lb-next svg { width: 22px; height: 22px; }

.luxon-lb-prev.hidden,
.luxon-lb-next.hidden { visibility: hidden; }

.luxon-lb-counter {
    position: fixed;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.65);
    font-size: 13px;
    font-family: sans-serif;
}

/* ---- Mobile ---- */
@media (max-width: 767px) {
    .luxon-thumbs-swiper .swiper-slide {
        width: 58px !important;
        height: 58px;
    }

    .luxon-arrow { width: 32px; height: 32px; }
    .luxon-arrow svg { width: 14px; height: 14px; }
}

/* ---- Hide arrows ---- */
.luxon-arrow { display: none !important; }

/* ---- Mobile ---- */
@media (max-width: 767px) {
    /* Hide lightbox arrows on mobile — swipe to navigate */
    .luxon-lb-prev,
    .luxon-lb-next { display: none !important; }

    /* Lightbox image fills the screen on mobile */
    .luxon-lb-media img {
        max-width: 95vw;
        max-height: 80vh;
    }

    /* Center the media without side arrows taking space */
    .luxon-lightbox-inner {
        justify-content: center;
    }
}

/* ---- Sale Badge ---- */
.woocommerce span.onsale {
    background-color: #e00000 !important;
    color: #fff !important;
    font-family: 'JFB', Sans-serif !important;
    border-radius: 8px !important;
    min-height: unset !important;
    min-width: unset !important;
    line-height: 1 !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    padding: 6px 12px !important;
    text-align: center !important;
    width: auto !important;
    height: auto !important;
}

/* ---- Lightbox arrow direction fix ---- */
.luxon-lb-prev svg { transform: scaleX(-1); }
.luxon-lb-next svg { transform: scaleX(-1); }

/* ---- Main image must fill its slide (2026-07-21) ----
   Two separate things defeat ".luxon-main-img { height: 100% }":
   1. Elementor's global reset ".elementor img { height: auto }" outranks it
      (0,1,1 vs 0,1,0) — fixed with the higher-specificity selector below.
   2. A WebP plugin wraps every img in a <picture> whose height is auto, so
      even a winning "height: 100%" resolves to the image's natural height.
   Result was ~96px of dead space between the image and the thumbs row on
   mobile. Making the <picture> fill the slide gives the percentage a real
   containing block; object-fit: cover crops the overflow. */
.luxon-main-swiper .swiper-slide picture,
.luxon-thumbs-swiper .swiper-slide picture {
    display: block;
    width: 100%;
    height: 100%;
}

.luxon-main-swiper .swiper-slide .luxon-main-img {
    height: 100%;
}
