/* ============================================
   PRODUCT SHOWCASE (Home Page)
   ============================================ */

.showcase {
    padding: var(--space-20) 0 var(--space-24);
    background-color: var(--color-white);
}

.showcase-header {
    text-align: center;
    margin-bottom: var(--space-12);
    padding: 0 var(--page-padding);
}

.showcase-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--color-black);
}

.showcase-header p {
    margin-top: var(--space-3);
    font-size: 1.05rem;
    color: var(--color-gray-500);
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

/* Product grid */
.product-grid {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-8);
    padding: 0 var(--page-padding);
}

/* Product card group (card + info) */
.product-group {
    display: flex;
    flex-direction: column;
    width: 320px;
    text-decoration: none;
    color: var(--color-black);
    cursor: pointer;
    transition: transform var(--transition-base);
}

.product-group:hover {
    transform: translateY(-8px);
}

/* The card itself */
.product-card {
    height: 440px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    transition: box-shadow var(--transition-base);
    margin-bottom: var(--space-4);
    overflow: hidden;
    position: relative;
}

.product-group:hover .product-card {
    box-shadow: var(--shadow-xl);
}

/* Card background layers — crossfade stack */
.card-bg-stack {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    overflow: hidden;
    z-index: 0;
}

.card-bg {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.45s ease;
}

.card-bg.active {
    opacity: 1;
}

/* Product image inside card — crossfade stack */
.card-image-stack {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-8);
    z-index: 1;
}

.card-image-stack .product-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: var(--space-8);
    opacity: 0;
    transition: opacity 0.45s ease, transform var(--transition-base);
}

.card-image-stack .product-image.active {
    opacity: 1;
}

.product-group:hover .card-image-stack .product-image.active {
    transform: scale(1.03) translateY(-4px);
}

/* Placeholder for missing images */
.card-image-placeholder {
    font-size: 0.9rem;
    color: var(--color-gray-400);
    font-style: italic;
    z-index: 1;
    transition: opacity 0.45s ease;
}

.card-image-placeholder.hidden {
    opacity: 0;
}

/* ============================================
   STYLE SELECTORS (replaces card-swatches)
   ============================================ */

.card-style-selectors {
    position: absolute;
    bottom: var(--space-4);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: var(--space-2);
    z-index: 2;
    align-items: center;
}

/* Style swatch circle */
.style-swatch {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    padding: 0;
    background: none;
    transition: transform var(--transition-fast), border-color var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.style-swatch-inner {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.style-swatch:hover {
    transform: scale(1.2);
}

.style-swatch.active {
    border-color: var(--color-white);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.style-swatch.active .style-swatch-inner {
    border-color: transparent;
}

/* More/dropdown trigger */
.style-more {
    position: relative;
}

.style-more-trigger {
    position: relative;
}

.style-more-chevron {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-black);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.style-more-chevron svg {
    display: block;
}

/* Dropdown panel */
.style-dropdown {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-white);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    padding: var(--space-2);
    display: none;
    flex-direction: column;
    gap: 2px;
    min-width: 140px;
    z-index: 10;
}

.style-dropdown.open {
    display: flex;
}

.style-dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 6px;
    transition: background-color var(--transition-fast);
    white-space: nowrap;
    font-size: 0.8rem;
    color: var(--color-gray-700);
}

.style-dropdown-item:hover {
    background-color: var(--color-gray-50);
}

.style-dropdown-item .style-swatch-inner {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
}

.style-dropdown-label {
    font-weight: 500;
}

/* Product info below card */
.product-info {
    text-align: center;
    padding: 0 var(--space-2);
}

.product-info h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: var(--space-1);
    color: var(--color-black);
    position: relative;
    display: inline-block;
}

.product-info .product-price {
    font-size: 1rem;
    color: var(--color-gray-500);
    font-weight: 500;
}

.product-info .product-arrow {
    position: absolute;
    left: 100%;
    top: 50%;
    margin-left: var(--space-1);
    opacity: 0;
    transform: translateY(-50%) translateX(-4px);
    transition: opacity var(--transition-fast), transform var(--transition-fast);
    font-size: 0.85rem;
}

.product-group:hover .product-arrow {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

/* Fade-in animation (triggered by IntersectionObserver) */
.showcase.fade-section {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.showcase.fade-section.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
    .showcase {
        padding: var(--space-16) 0;
    }

    .product-grid {
        justify-content: flex-start;
        flex-wrap: nowrap;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding: 0 var(--space-5);
        gap: var(--space-4);
    }

    .product-grid::-webkit-scrollbar {
        display: none;
    }

    .product-group {
        flex: 0 0 72vw;
        scroll-snap-align: center;
    }

    .product-group:hover {
        transform: none;
    }

    .product-card {
        height: 380px;
    }

    /* Larger selectors for touch targets */
    .card-style-selectors {
        bottom: var(--space-5);
        gap: var(--space-3);
    }

    .style-swatch {
        width: 36px;
        height: 36px;
        flex: 0 0 36px;
    }

    .style-swatch-inner {
        width: 24px;
        height: 24px;
        flex: 0 0 24px;
    }

    .style-more-chevron {
        width: 14px;
        height: 14px;
    }

    .showcase-header h2 {
        font-size: 2rem;
    }
}
