/* In Stock overlay — scoped only to in-stock.html */
.in-stock-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    background: rgba(0, 0, 0, 0.72);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.28s ease, visibility 0s linear 0.28s;
}

.in-stock-overlay.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.28s ease, visibility 0s linear 0s;
}

.in-stock-dialog {
    position: relative;
    width: min(1080px, 94vw);
    max-height: 90vh;
    overflow: auto;
    background: #ffffff;
    color: #000000;
    font-family: 'Josefin Sans', sans-serif;
    opacity: 0;
    transform: translateY(18px) scale(0.985);
    transition: opacity 0.32s ease, transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
}

.in-stock-overlay.is-open .in-stock-dialog {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.in-stock-dialog-content {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
    min-height: 560px;
}

.in-stock-dialog-image {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 560px;
    padding: 34px;
    background: #f7f7f7;
    opacity: 0;
    transform: translateX(-12px);
    transition: opacity 0.35s ease 0.08s, transform 0.42s cubic-bezier(0.22, 1, 0.36, 1) 0.08s;
}

.in-stock-overlay.is-open .in-stock-dialog-image {
    opacity: 1;
    transform: translateX(0);
}

.in-stock-dialog-image img {
    display: block;
    width: 100%;
    height: 100%;
    max-height: 72vh;
    object-fit: contain;
}

.in-stock-dialog-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 52px 48px;
    opacity: 0;
    transform: translateX(12px);
    transition: opacity 0.35s ease 0.12s, transform 0.42s cubic-bezier(0.22, 1, 0.36, 1) 0.12s;
}

.in-stock-overlay.is-open .in-stock-dialog-info {
    opacity: 1;
    transform: translateX(0);
}

.in-stock-dialog-info p {
    margin: 0 0 30px;
    font-size: 15px;
    line-height: 1.55;
    font-weight: 300;
}

.in-stock-dialog-info span { font-weight: 600; }

.in-stock-buy {
    display: inline-block;
    min-width: 92px;
    padding: 10px 18px 9px;
    border: 1px solid #000000;
    color: #000000;
    background: #ffffff;
    font: 400 12px/1 'Josefin Sans', sans-serif;
    letter-spacing: 0.16em;
    text-align: center;
    text-decoration: none;
    transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.in-stock-buy:hover,
.in-stock-buy:focus {
    background: #000000;
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-2px);
}

.in-stock-close {
    position: absolute;
    top: 13px;
    right: 17px;
    z-index: 2;
    border: 0;
    padding: 0;
    background: transparent;
    color: #000000;
    font: 300 34px/1 'Josefin Sans', sans-serif;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.in-stock-close:hover,
.in-stock-close:focus {
    transform: rotate(90deg);
    opacity: 0.65;
}

.in-stock-trigger {
    cursor: pointer;
    overflow: hidden;
}

.in-stock-trigger .content-overlay {
    background: transparent;
    pointer-events: none;
}

.in-stock-trigger .gallery-image {
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.in-stock-trigger:hover .gallery-image,
.in-stock-trigger:focus .gallery-image {
    transform: scale(1.025);
}

body.in-stock-overlay-open { overflow: hidden; }

/* Full thumbnail overlay */
.in-stock-label {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(255, 255, 255, 0.84);
    color: #000000;
    font-family: 'Josefin Sans', sans-serif;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-align: center;
    opacity: 0;
    transform: scale(0.985);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

.in-stock-trigger:hover .in-stock-label,
.in-stock-trigger:focus .in-stock-label,
.in-stock-trigger:focus-visible .in-stock-label {
    opacity: 1;
    transform: scale(1);
}

@media only screen and (max-width: 760px) {
    .in-stock-overlay {
        align-items: flex-start;
        padding: 18px;
        overflow-y: auto;
    }

    .in-stock-dialog {
        width: 100%;
        max-height: none;
        margin: auto 0;
        overflow: visible;
    }

    .in-stock-dialog-content { display: block; min-height: 0; }

    .in-stock-dialog-image {
        min-height: 0;
        padding: 42px 20px 20px;
        transform: translateY(10px);
    }

    .in-stock-dialog-image img { max-height: 56vh; }

    .in-stock-dialog-info {
        padding: 24px 24px 32px;
        transform: translateY(10px);
    }

    .in-stock-overlay.is-open .in-stock-dialog-image,
    .in-stock-overlay.is-open .in-stock-dialog-info {
        transform: translateY(0);
    }

    .in-stock-dialog-info p { font-size: 14px; }
}

@media only screen and (max-width: 480px) {
    .in-stock-label { padding: 12px; font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
    .in-stock-overlay,
    .in-stock-dialog,
    .in-stock-dialog-image,
    .in-stock-dialog-info,
    .in-stock-buy,
    .in-stock-close,
    .in-stock-trigger .gallery-image,
    .in-stock-label {
        transition: none;
    }
}

/* Keep In Stock thumbnails at a consistent size; prevent the final item from stretching */
.gallery-box .in-stock-trigger {
    flex: 0 0 20%;
    max-width: 20%;
}

@media only screen and (max-width: 1280px) {
    .gallery-box .in-stock-trigger {
        flex-basis: 25%;
        max-width: 25%;
    }
}

@media only screen and (max-width: 720px) {
    .gallery-box .in-stock-trigger {
        flex-basis: 50%;
        max-width: 50%;
    }
}

@media only screen and (max-width: 480px) {
    .gallery-box .in-stock-trigger {
        flex-basis: 100%;
        max-width: 100%;
    }
}

/* 2026-09-29: stable In Stock tile sizing on incomplete final row */
.gallery-box .in-stock-trigger {
    aspect-ratio: 1 / 1;
    min-width: 0;
}
.gallery-box .in-stock-trigger .gallery-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.gallery-box .in-stock-spacer {
    min-width: 0;
    visibility: hidden;
    pointer-events: none;
}

/* 2026-09-29: In Stock spacers use the same column width as artwork tiles */
.gallery-box .in-stock-spacer {
    flex: 0 0 20%;
    max-width: 20%;
}
@media only screen and (max-width: 1280px) {
    .gallery-box .in-stock-spacer {
        flex-basis: 25%;
        max-width: 25%;
    }
}
@media only screen and (max-width: 720px) {
    .gallery-box .in-stock-spacer {
        flex-basis: 50%;
        max-width: 50%;
    }
}
