/* ---------------------------------------------------------------------------
 * image-lightbox.css — full-screen viewer for product images.
 *
 * Used by the Quick Add popup: clicking the product image opens the picture
 * full screen. Pairs with js/image-lightbox.js.
 * ------------------------------------------------------------------------- */

/* Above Bootstrap's modal (1055) so it covers the Quick Add popup it opens from. */
.img-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: rgba(12, 6, 8, .93);
    opacity: 0;
    visibility: hidden;
    transition: opacity .28s ease, visibility .28s ease;
}

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

.img-lightbox__img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .6);
    transform: scale(.96);
    transition: transform .28s cubic-bezier(.22, .61, .36, 1);
    cursor: zoom-out;
}

.img-lightbox.is-open .img-lightbox__img {
    transform: scale(1);
}

.img-lightbox__close {
    position: absolute;
    top: 20px;
    right: 24px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 50%;
    background: rgba(0, 0, 0, .45);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: background .25s ease, transform .25s ease;
}

.img-lightbox__close:hover,
.img-lightbox__close:focus-visible {
    background: var(--primary, #AE873E);
    transform: rotate(90deg);
}

/* Tells the visitor the image is clickable. */
.prd-image {
    cursor: zoom-in;
}

@media (max-width: 575px) {
    .img-lightbox {
        padding: 16px;
    }

    .img-lightbox__close {
        top: 12px;
        right: 12px;
        width: 38px;
        height: 38px;
        font-size: 19px;
    }
}

@media (prefers-reduced-motion: reduce) {

    .img-lightbox,
    .img-lightbox__img,
    .img-lightbox__close {
        transition: none;
    }
}

/* ------------------------------------------------------------ gallery ----
 * Prev/next controls, so the product shot and its certificate can be compared
 * without closing and reopening the viewer.
 */

.img-lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, .32);
    border-radius: 50%;
    background: rgba(0, 0, 0, .48);
    color: #fff;
    font-size: 17px;
    cursor: pointer;
    transition: background .25s ease, border-color .25s ease;
}

.img-lightbox__nav[hidden] {
    display: none;
}

.img-lightbox__nav.is-prev { left: 20px; }
.img-lightbox__nav.is-next { right: 20px; }

.img-lightbox__nav:hover,
.img-lightbox__nav:focus-visible {
    background: var(--primary, #AE873E);
    border-color: var(--primary, #AE873E);
}

.img-lightbox__count {
    position: absolute;
    left: 50%;
    bottom: 22px;
    transform: translateX(-50%);
    z-index: 2;
    padding: 5px 14px;
    border-radius: 14px;
    background: rgba(0, 0, 0, .5);
    border: 1px solid rgba(255, 255, 255, .2);
    color: #fff;
    font-size: 12px;
    letter-spacing: 1.4px;
}

.img-lightbox__count[hidden] {
    display: none;
}

/* The picture no longer closes the viewer — tapping it is how a touch user
   reaches the arrows — so it should not advertise zoom-out. */
.img-lightbox__img {
    cursor: default;
}

@media (max-width: 575px) {

    .img-lightbox__nav {
        width: 42px;
        height: 42px;
        font-size: 15px;
    }

    .img-lightbox__nav.is-prev { left: 8px; }
    .img-lightbox__nav.is-next { right: 8px; }

    .img-lightbox__count {
        bottom: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .img-lightbox__nav {
        transition: none;
    }
}
