/* One primary image; controls exist only for a real multi-image gallery. */
@media (min-width: 761px) {
    .product-detail .product-layout {
        width: min(1440px, calc(100% - 48px));
        grid-template-columns: minmax(0, 1.15fr) minmax(320px, 1fr);
        gap: 40px;
    }
}
.product-layout .gallery.faf-product-gallery {
    display: block;
    align-self: start;
    min-width: 0;
    margin: 0;
}
.faf-product-gallery .faf-gallery-stage { position: relative; }
.product-layout .gallery.faf-product-gallery figure.faf-gallery-image {
    display: block;
    grid-column: auto;
    width: 100%;
    margin: 0;
    height: var(--faf-gallery-image-height, min(620px, max(100px, calc(100vh - 310px))));
    height: var(--faf-gallery-image-height, min(620px, max(100px, calc(100svh - 310px))));
    aspect-ratio: auto;
    background: transparent;
}
.product-layout .gallery.faf-product-gallery .faf-gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transform: none;
}
.faf-product-gallery .faf-gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 10px;
    border: 1px solid #000;
    border-radius: 50%;
    color: #fff;
    background: #000;
    cursor: pointer;
}
.faf-product-gallery .faf-gallery-arrow:hover { background: #000; border-color: #000; color: #fff; }
.faf-product-gallery .faf-gallery-arrow svg { width: 20px; height: 20px; }
.faf-product-gallery .faf-gallery-prev { left: 14px; }
.faf-product-gallery .faf-gallery-next { right: 14px; }
.faf-product-gallery .faf-gallery-thumbnails {
    position: relative;
    display: flex;
    gap: 10px;
    padding: 12px 2px 4px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
}
.faf-product-gallery .faf-gallery-thumbnail {
    flex: 0 0 68px;
    width: 68px;
    height: 88px;
    padding: 3px;
    border: 1px solid var(--faf-line, #e7e3dc);
    background: transparent;
    cursor: pointer;
}
/* Auto margins center short rows without clipping an overflowing row. */
.faf-product-gallery .faf-gallery-thumbnail:first-child { margin-inline-start: auto; }
.faf-product-gallery .faf-gallery-thumbnail:last-child { margin-inline-end: auto; }
.faf-product-gallery .faf-gallery-thumbnail.is-active { border: 2px solid #161616; padding: 2px; }
.product-layout .gallery.faf-product-gallery .faf-gallery-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.faf-product-gallery .faf-gallery-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    color: var(--faf-muted, #626262);
    font-size: 12px;
}
.faf-product-gallery .faf-gallery-footer button {
    padding: 4px 0;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.faf-product-gallery [hidden] { display: none !important; }
@media (max-width: 760px) {
    .faf-product-gallery .faf-gallery-prev { left: 10px; }
    .faf-product-gallery .faf-gallery-next { right: 10px; }
    .faf-product-gallery .faf-gallery-thumbnail { flex-basis: 60px; width: 60px; height: 78px; }
}
@media (max-height: 600px) {
    .faf-product-gallery .faf-gallery-thumbnail { flex-basis: 48px; width: 48px; height: 58px; }
    .faf-product-gallery .faf-gallery-arrow { width: 36px; height: 36px; padding: 7px; }
}
