.product-page {
    --product-gallery-height: calc(100svh - var(--site-header-height, 79px) - 115px);
    --product-thumbnail-size: 54px;
}

.product-page > .product-detail {
    padding-top: 18px;
    align-items: stretch;
}

.product-page .product-gallery {
    --product-gallery-controls-height: 0px;
    display: grid;
    grid-template-rows: minmax(0, 1fr);
    gap: 0;
    min-width: 0;
    min-height: min(710px, var(--product-gallery-height));
    max-height: none;
    overflow: hidden;
    border: 1px solid var(--border-pearl);
    border-radius: 24px;
    background: var(--brand-white);
}

.product-page .product-gallery.has-gallery-thumbnails {
    --product-gallery-controls-height: 77px;
    grid-template-rows: minmax(0, 1fr) auto;
}

.product-page .product-main-image {
    position: relative;
    flex: none;
    min-width: 0;
    min-height: 0;
    width: 100%;
    height: auto;
    aspect-ratio: auto;
    border: 0;
    border-radius: 0;
    background: var(--surface-champagne);
}

.product-page .product-image-open {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    min-width: 0;
    min-height: 0;
    width: 100%;
    height: 100%;
}

.product-page .product-image-open > img {
    display: block;
    min-width: 0;
    min-height: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.product-page .gallery-thumbnails {
    flex: none;
    align-items: flex-start;
    gap: 9px;
    width: 100%;
    height: auto;
    min-height: 0;
    padding: 10px 12px;
    border-top: 1px solid var(--border-pearl);
    background: var(--brand-white);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
}

.product-page .gallery-thumbnails::-webkit-scrollbar {
    display: none;
}

.product-page .gallery-thumbnail {
    flex: 0 0 var(--product-thumbnail-size);
    width: var(--product-thumbnail-size);
    min-width: var(--product-thumbnail-size);
    height: var(--product-thumbnail-size);
    padding: 3px;
    border: 1px solid transparent;
    border-radius:var(--button-radius);
    background: var(--brand-white);
}

.product-page .gallery-thumbnail.selected {
    border-color: var(--brand-plum);
    box-shadow: 0 0 0 2px var(--surface-lilac);
}

.product-page .gallery-thumbnail img {
    width: 100%;
    height: 100%;
    border-radius: calc(var(--button-radius) - 4px);
    object-fit: contain;
}

.product-page .gallery-thumbnail:focus-visible {
    outline: 2px solid var(--brand-plum);
    outline-offset: -4px;
}

#product-lightbox:not(.is-zoomed) .lightbox-stage {
    overflow: hidden;
}

#product-lightbox:not(.is-zoomed) .lightbox-viewport {
    position: absolute;
    inset: 15px 62px;
    display: block;
    min-width: 0;
    min-height: 0;
    width: auto;
    height: auto;
    padding: 0;
    overflow: hidden;
}

#product-lightbox:not(.is-zoomed) .lightbox-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: contain;
    object-position: center;
}

.product-information-heading h2 em {
    color: var(--jewel-primary);
    font-style: normal;
}

.product-information-section .product-accordions {
    margin-top: 0;
}

.product-information-section details {
    border: 1px solid var(--border-blush);
    border-radius: 18px;
    background: var(--surface-pearl);
}

.product-information-section details + details {
    margin-top: 12px;
}

.product-information-section summary {
    gap: 16px;
    padding: 20px 24px;
    font-size: 15px;
}

.product-information-section summary .icon {
    width: 24px;
    height: 24px;
    padding: 4px;
    border-radius: 50%;
    background: var(--surface-lilac);
    color: var(--jewel-primary);
}

.product-information-section details p {
    padding: 0 24px 22px;
    font-size: 14px;
    line-height: 1.85;
}

@media (min-width: 651px) {
    .product-page .product-detail-sidebar {
        position: sticky;
        top: var(--store-sticky-offset, 22px);
        display: flex;
        flex-direction: column;
        align-self: start;
        gap: 24px;
        min-width: 0;
        min-height: 0;
        height: auto;
        max-height: none;
    }

    .product-page .product-detail-main {
        min-width: 0;
        min-height: 0;
    }

    .product-page .product-detail-main > .product-detail-copy {
        position: static;
        top: auto;
        min-width: 0;
        min-height: 0;
        max-height: none;
        padding-top: 0;
        overflow: visible;
    }
}

@media (max-width: 650px) {
    .product-page {
        --product-gallery-height: calc(100svh - var(--site-header-height, 77px) - 115px);
        --product-thumbnail-size: 48px;
    }

    .product-page > .product-detail {
        gap: 22px;
        align-items: start;
    }

    .product-page .product-gallery {
        display: flex;
        flex-direction: column;
        min-height: 0;
        max-height: none;
        border-radius: 20px;
    }

    .product-page .product-gallery.has-gallery-thumbnails {
        --product-gallery-controls-height: 71px;
    }

    .product-page .product-main-image {
        height: min(calc(100vw - 38px), calc(var(--product-gallery-height) - var(--product-gallery-controls-height)));
    }

    .product-page .gallery-thumbnails {
        gap: 8px;
    }

    .product-page .product-detail-sidebar,
    .product-page .product-detail-main {
        display: block;
        position: static;
        min-width: 0;
        min-height: 0;
    }

    .product-page .product-detail-main > .product-detail-copy {
        position: static;
        max-height: none;
        overflow: visible;
    }

    .product-information-section summary {
        padding: 17px 18px;
        font-size: 14px;
    }

    .product-information-section details p {
        padding: 0 18px 18px;
        font-size: 13px;
    }

    #product-lightbox:not(.is-zoomed) .lightbox-viewport {
        inset: 12px 10px;
    }
}
