/* ImageKrafters product photo gallery
   New file only. Do not add these rules to imagekrafters.css.
   Link from a product page after CSS/imagekrafters.css:
     <link href="CSS/ik-product-gallery.css" rel="stylesheet" type="text/css" />
   Markup: a .ik-product-gallery[data-ik-product-gallery] region with slides,
   optional thumbs, and prev/next buttons. Works with one photo (arrows and
   thumbs hide) or many. Fixed 4:3 stage uses object-fit: contain so portrait
   and landscape photos share one frame without cropping or stretching.
*/

.ik-product-gallery {
    max-width: 680px;
    width: 100%;
    margin-top: 22px;
}

.ik-product-gallery__stage {
    position: relative;
    border: 1px solid var(--ik-line, #dce3e9);
    border-radius: var(--ik-radius, 10px);
    background: #e8edf1;
    box-shadow: var(--ik-shadow, 0 10px 30px rgba(25, 47, 69, .08));
    overflow: hidden;
}

.ik-product-gallery__viewport {
    position: relative;
    aspect-ratio: 4 / 3;
    width: 100%;
    background: #e8edf1;
    overflow: hidden;
}

@supports not (aspect-ratio: 4 / 3) {
    .ik-product-gallery__viewport::before {
        content: "";
        display: block;
        padding-top: 75%;
    }
}

.ik-product-gallery__slide {
    position: absolute;
    inset: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .25s ease, visibility .25s ease;
}

.ik-product-gallery__slide.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    z-index: 1;
}

.ik-product-gallery__slide picture,
.ik-product-gallery__thumb picture {
    display: block;
    width: 100%;
    height: 100%;
}

.ik-product-gallery__slide img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: contain;
    object-position: center center;
    background: #e8edf1;
}

.ik-product-gallery__nav {
    position: absolute;
    top: 50%;
    z-index: 2;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--ik-blue, #0355a7);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(25, 47, 69, .28);
    transform: translateY(-50%);
}

.ik-product-gallery__nav--prev { left: 10px; }
.ik-product-gallery__nav--next { right: 10px; }

.ik-product-gallery__nav svg {
    width: 20px;
    height: 20px;
    display: block;
}

.ik-product-gallery__nav:hover {
    background: var(--ik-blue-dark, #163a64);
}

.ik-product-gallery__nav:focus,
.ik-product-gallery__thumb:focus {
    outline: none;
}

.ik-product-gallery__nav:focus-visible,
.ik-product-gallery__thumb:focus-visible {
    outline: 2px solid var(--ik-cyan, #20a9d4);
    outline-offset: 2px;
}

.ik-product-gallery__thumbs {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 8px;
    margin-top: 10px;
    padding: 2px 2px 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.ik-product-gallery__thumb {
    flex: 0 0 88px;
    width: 88px;
    aspect-ratio: 4 / 3;
    margin: 0;
    padding: 0;
    border: 2px solid var(--ik-line, #dce3e9);
    border-radius: 8px;
    background: #e8edf1;
    overflow: hidden;
    cursor: pointer;
}

.ik-product-gallery__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: contain;
    object-position: center center;
    background: #e8edf1;
}

.ik-product-gallery__thumb.is-active {
    border-color: var(--ik-blue, #0355a7);
    box-shadow: 0 0 0 1px var(--ik-blue, #0355a7);
}

.ik-product-gallery__thumb:hover {
    border-color: var(--ik-cyan, #20a9d4);
}

.ik-product-gallery__status {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.ik-product-gallery--single .ik-product-gallery__nav,
.ik-product-gallery--single .ik-product-gallery__thumbs {
    display: none;
}

@media (prefers-reduced-motion: reduce) {
    .ik-product-gallery__slide {
        transition: none;
    }
}
