/* ==========================================================================
   Single Product — Related & Recently Viewed Sections
   Self-contained: includes all card CSS scoped to .df-product-section.
   Does NOT depend on custom-shop.css (which has shop-only layout globals).
   ========================================================================== */


/* ==========================================================================
   Card Zoom-In Animation
   ========================================================================== */

@keyframes df-productZoomOut {
    0%   { opacity: 0; transform: scale(1.15); }
    100% { opacity: 1; transform: scale(1); }
}

.df-product-section .product-card {
    opacity: 0;
    overflow: hidden;
    position: relative;
    list-style: none;
    padding: 0 !important;
    margin: 0 !important;
}

.df-product-section .product-card.animate-in {
    opacity: 1;
    transition: opacity 0.6s ease-out;
}

.df-product-section .product-card .product-card-inner {
    transform: scale(1.15);
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0;
    margin: 0;
}

.df-product-section .product-card.animate-in .product-card-inner {
    animation: df-productZoomOut 0.6s ease-out forwards;
}

/* Stagger animation delays */
.df-product-section .product-card.animate-in:nth-child(1)  .product-card-inner { animation-delay: 0.05s; }
.df-product-section .product-card.animate-in:nth-child(2)  .product-card-inner { animation-delay: 0.10s; }
.df-product-section .product-card.animate-in:nth-child(3)  .product-card-inner { animation-delay: 0.15s; }
.df-product-section .product-card.animate-in:nth-child(4)  .product-card-inner { animation-delay: 0.20s; }
.df-product-section .product-card.animate-in:nth-child(5)  .product-card-inner { animation-delay: 0.25s; }
.df-product-section .product-card.animate-in:nth-child(6)  .product-card-inner { animation-delay: 0.30s; }
.df-product-section .product-card.animate-in:nth-child(7)  .product-card-inner { animation-delay: 0.35s; }
.df-product-section .product-card.animate-in:nth-child(8)  .product-card-inner { animation-delay: 0.40s; }


/* ==========================================================================
   Card Image
   ========================================================================== */

.df-product-section .product-card-image {
    position: relative;
    overflow: hidden;
    background: #000;
    aspect-ratio: 1 / 1;
    margin-bottom: 0;
    border-radius: 0;
}

.df-product-section .product-image-link {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
}

.df-product-section .product-main-image,
.df-product-section .product-hover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.5s ease;
}

.df-product-section .product-hover-image {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.df-product-section .product-card:hover .product-hover-image {
    opacity: 1;
}


/* ==========================================================================
   Image Overlay (title + price + stock, visible on hover)
   ========================================================================== */

.df-product-section .product-image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 100%);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.df-product-section .product-card:hover .product-image-overlay {
    opacity: 1;
}

.df-product-section .product-overlay-title {
    font-size: 14px;
    font-weight: 400;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.df-product-section .product-overlay-price {
    font-size: 16px;
    font-weight: 500;
    color: #fff;
    margin-bottom: 5px;
}

.df-product-section .product-overlay-price span,
.df-product-section .product-overlay-price ins {
    color: #fff;
    text-decoration: none;
}

.df-product-section .product-overlay-price del {
    color: rgba(255, 255, 255, 0.6);
    margin-right: 8px;
}

.df-product-section .product-overlay-stock {
    font-size: 12px;
    font-weight: 300;
    color: #fff;
    text-transform: capitalize;
}


/* ==========================================================================
   Section & Slider Layout
   ========================================================================== */

.df-product-section {
    padding: 0;
    width: 100%;
}

.df-section-title {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #111;
    margin: 0 0 24px;
    padding: 0;
}

.df-products-slider-wrap {
    position: relative;
}


/* ==========================================================================
   Desktop Grid (≥ 769px) — 4 columns, no arrows
   ========================================================================== */

@media (min-width: 769px) {
    .df-product-section .df-products-slider {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 5px;
        list-style: none;
        margin: 0;
        padding: 0;
        overflow: visible;
    }

    .df-slider-buttons {
        display: none;
    }
}


/* ==========================================================================
   Mobile Slider (≤ 768px) — horizontal scroll-snap + arrow buttons
   ========================================================================== */

@media (max-width: 768px) {

    /* Horizontal scroll-snap container */
    .df-product-section .df-products-slider {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: visible;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;       /* Firefox */
        gap: 5px;
        padding: 0;
        margin: 0;
        list-style: none;
    }

    .df-product-section .df-products-slider::-webkit-scrollbar {
        display: none;               /* Chrome / Safari */
    }

    /* ~1.1 cards visible — large card with a clear peek at the next */
    .df-product-section .df-products-slider > li.product-card {
        flex: 0 0 calc(87vw - 8px);
        max-width: calc(87vw - 8px);
        width: auto;
        scroll-snap-align: start;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Mobile overlay: always visible (no hover on touch devices) */
    .df-product-section .product-image-overlay {
        opacity: 1 !important;
        transition: none !important;
        padding: 16px 6px 4px;
        max-height: 40%;
    }

    .df-product-section .product-overlay-title {
        font-size: 9px;
        line-height: 1.2;
        margin-bottom: 2px;
        letter-spacing: 0.5px;
    }

    .df-product-section .product-overlay-price {
        font-size: 11px;
    }

    .df-product-section .product-overlay-stock {
        font-size: 9px;
    }

    /* Disable hover image on touch */
    .df-product-section .product-hover-image {
        opacity: 0 !important;
        pointer-events: none !important;
    }

    .df-product-section .product-card:hover .product-hover-image {
        opacity: 0 !important;
    }

    .df-product-section .product-card:hover .product-image-overlay {
        opacity: 1 !important;
    }

    /* ── Prev / Next arrow buttons ── */
    .df-slider-buttons {
        display: flex;
        justify-content: center;
        gap: 12px;
        margin-top: 20px;
    }

    .df-slider-btn {
        width: 40px;
        height: 40px;
        border: 1px solid #333;
        background: #fff;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: background 0.2s ease, color 0.2s ease;
        color: #333;
        padding: 0;
        flex-shrink: 0;
    }

    .df-slider-btn:hover {
        background: #333;
        color: #fff;
    }

    .df-slider-btn.is-disabled {
        opacity: 0.3;
        pointer-events: none;
    }
}
