/* ==========================================================================
   Component: Product Gallery
   ========================================================================== */

.product-gallery {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    position: sticky;
    top: calc(var(--header-height) + var(--spacing-lg));
}

/* --- Main Image --- */
.product-gallery__main {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: var(--color-accent-100);
}

.product-gallery__image {
    width: 100%;
    height: auto;
    aspect-ratio: 736 / 920;
    object-fit: cover;
    display: block;
    cursor: zoom-in;
}

/* --- Badges --- */
.product-gallery__badges {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    z-index: 1;
}

.product-gallery__badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: var(--font-size-xs);
    font-weight: 600;
    border-radius: var(--radius-sm);
    letter-spacing: 0.3px;
}

.product-gallery__badge--discount {
    background: var(--color-accent-700);
    color: var(--color-dark-700);
}

.product-gallery__badge--new {
    background: var(--color-accent-100);
    color: var(--color-text);
}

/* --- Thumbnails --- */
.product-gallery__thumbs {
    display: flex;
    gap: var(--spacing-sm);
}

.product-gallery__thumb {
    flex: 1;
    position: relative;
    border: 1px solid var(--color-accent-200);
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    padding: 0;
    background: var(--color-accent-100);
    transition: border-color 0.2s;
}

.product-gallery__thumb::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    z-index: 1;
}

.product-gallery__thumb::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 24px;
    height: 24px;
    background: var(--color-white);
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3Cline x1='11' y1='8' x2='11' y2='14'/%3E%3Cline x1='8' y1='11' x2='14' y2='11'/%3E%3C/svg%3E") no-repeat center;
    mask-size: contain;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    z-index: 2;
}

.product-gallery__thumb:hover::after,
.product-gallery__thumb:hover::before {
    opacity: 1;
}

.product-gallery__thumb:hover,
.product-gallery__thumb--active {
    border-color: var(--color-dark-400);
}

.product-gallery__thumb img {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1.25;
    object-fit: cover;
    display: block;
}

/* --- Responsive --- */

@media (max-width: 1024px) {
    .product-gallery {
        position: static;
    }
}

@media (max-width: 768px) {
    .product-gallery__main {
        border-radius: var(--radius-md);
    }

    .product-gallery__thumbs {
        gap: var(--spacing-xs);
    }
}
