.product-gallery {
    flex: 0 0 48%;
    width: 48%;
    min-width: 0;
}
.gallery-main {
    position: relative;
    width: 100%;
    padding: 35px;
    background: white;
    border: 1px solid var(--line);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 390px;
}
.gallery-main > img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.gallery-main > span {
    position: absolute;
    right: 18px;
    bottom: 18px;
    padding: 8px;
    background: var(--pale);
    color: var(--blue);
    border-radius: 50%;
}
.gallery-main:hover,
.gallery-main:focus-visible {
    border-color: var(--blue);
    box-shadow: var(--shadow);
}
.gallery-thumbnails {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
}
.gallery-thumbnails > button {
    width: 88px;
    height: 74px;
    border: 1px solid var(--line);
    padding: 8px;
    background: white;
    border-radius: 4px;
}
.gallery-thumbnails img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.gallery-thumbnails > button:hover,
.gallery-thumbnails > button:focus-visible,
.gallery-thumbnails [aria-pressed="true"] {
    border-color: var(--blue);
    background: var(--pale);
}
.image-modal {
    position: fixed;
    inset: 0;
    z-index: 160;
    background: #102e49b8;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.image-modal-panel {
    position: relative;
    width: 800px;
    max-width: 100%;
    max-height: calc(100dvh - 48px);
    padding: 40px;
    border-radius: 7px;
    background: white;
}
.image-modal-panel > img {
    margin: auto;
    max-height: calc(100dvh - 128px);
    object-fit: contain;
}
.image-modal-panel > button {
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    background: white;
    border-radius: 50%;
}
.image-modal-panel > button:hover,
.image-modal-panel > button:focus-visible {
    border-color: var(--blue);
    background: var(--blue);
    color: white;
}
[data-modal-close] {
    right: 10px;
    top: 10px;
}
[data-modal-prev] {
    left: 10px;
    top: calc(50% - 19px);
}
[data-modal-next] {
    right: 10px;
    top: calc(50% - 19px);
}
@media (max-width: 900px) {
    .product-gallery {
        flex-basis: auto;
        width: 100%;
    }
}
@media (max-width: 640px) {
    .gallery-main {
        height: 300px;
        padding: 25px;
    }
    .image-modal {
        padding: 18px;
    }
    .image-modal-panel {
        padding: 40px 20px 24px;
    }
}
