/* components/product-gallery.css — Product gallery */
/* 상품 상세 — 이미지 갤러리 슬라이드 */
.product-gallery__viewport {
    position: relative;
    aspect-ratio: 800 / 700;
    overflow: hidden;
    border-radius: var(--radius-card);
    background-color: var(--surface-muted);
}

@media (min-width: 768px) {
    .product-gallery__viewport {
        border-radius: var(--radius-card-md);
    }
}

.gallery-thumb {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: var(--radius-card);
    opacity: 0.6;
    cursor: pointer;
    background: none;
    transition: opacity 0.3s ease;
}

.gallery-thumb.active,
.gallery-thumb[aria-current="true"] {
    opacity: 1;
}

.gallery-thumb:hover,
.gallery-thumb:focus-visible {
    opacity: 1;
}

.gallery-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.product-gallery__thumbs {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .product-gallery__thumbs {
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: 1rem;
    }
}

.product-gallery__track {
    display: flex;
    height: 100%;
    transition: transform 0.45s ease;
}

.product-gallery__slide {
    flex: 0 0 100%;
    min-width: 100%;
    height: 100%;
}

.product-gallery__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.product-gallery {
    --nav-link-base: var(--gray-900);
}

.product-gallery__nav[hidden] {
    display: none !important;
}

.product-gallery__thumbs[hidden] {
    display: none !important;
}

.product-gallery__nav {
    position: absolute;
    top: 50%;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    padding: 0.375rem;
    border: 0;
    background: none;
    color: var(--white);
    cursor: pointer;
    transform: translateY(-50%);
    transition: opacity 0.25s ease, visibility 0.25s ease, color 0.2s ease;
}

.product-gallery__nav:not([hidden]) {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

@media (hover: hover) {
    .product-gallery__viewport:hover .product-gallery__nav:not([hidden]),
    .product-gallery__viewport:focus-within .product-gallery__nav:not([hidden]) {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
}

.product-gallery__nav svg {
    display: block;
    width: 2.25rem;
    height: 2.25rem;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.35)) drop-shadow(0 0 12px rgba(0, 0, 0, 0.42));
    transition: filter 0.2s ease;
}

.product-gallery__nav--prev {
    left: 0.5rem;
}

.product-gallery__nav--next {
    right: 0.5rem;
}

.product-gallery__nav:hover,
.product-gallery__nav:focus-visible {
    color: var(--nav-link-base);
}

.product-gallery__nav:hover svg,
.product-gallery__nav:focus-visible svg {
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.3)) drop-shadow(0 0 12px rgba(0, 0, 0, 0.36));
}

@media (min-width: 768px) {
    .product-gallery__nav {
        padding: 0.5rem;
    }

    .product-gallery__nav--prev {
        left: 0.75rem;
    }

    .product-gallery__nav--next {
        right: 0.75rem;
    }

    .product-gallery__nav svg {
        width: 3rem;
        height: 3rem;
    }
}
