/* Dynamic Home Slider Section */
/* Mirrors product-best-sale-section.css, renamed to the slider markup:
     .product-best-sale-section      -> .rootslab-dynamic-home-slider-section
     .product-best-sale-header-title -> .rootslab-dynamic-home-slider-title
     .product-best-sale-cards-row    -> .rootslab-dynamic-home-slider-cards-row
   Swiper + card visuals live in front-page.php. The slider card has no
   pricing/tags, so those best-sale rules have no equivalent. Slide gap
   (spaceBetween) is handled in assets/js/dynamic-slider-section.js. */

/* Main Section Container (= .product-best-sale-section) */
.rootslab-dynamic-home-slider-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 48px;
    width: 1440px;
    max-width: 100%;
    margin: 120px auto 0;
    padding: 0;
    opacity: 1;
    transform: none;
}

.rootslab-dynamic-home-slider-section.visible {
    opacity: 1;
    transform: none;
}

/* Title (= .product-best-sale-header-title, sharing the cards-row frame) */
.rootslab-dynamic-home-slider-title {
    width: 1440px;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 80px;
    font-family: 'Barlow', 'Pretendard', sans-serif;
    font-style: normal;
    font-weight: 600;
    font-size: 40px;
    line-height: 130%;
    letter-spacing: 0.035em;
    color: inherit;
}

/* Cards row (= .product-best-sale-cards-row) */
.rootslab-dynamic-home-slider-cards-row {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    padding: 0 80px;
    gap: 32px;
    width: 1440px;
    max-width: 100%;
    position: relative;
    margin: 0 auto;
    height: auto;
    overflow: visible;
}

/* Swiper (= .product-best-sale-swiper) */
.rootslab-dynamic-home-slider {
    width: 100%;
    overflow: hidden;
}

/* Slide + Card (= .product-best-sale-swiper .swiper-slide / .product-best-sale-card) */
.rootslab-dynamic-home-slider .swiper-slide,
.rootslab-dynamic-home-card {
    flex: 0 0 296px;
    width: 296px;
}

.rootslab-dynamic-home-card {
    display: flex;
    flex-direction: column;
    gap: 20px;
    color: inherit;
    text-decoration: none;
}

/* Card image (= .product-best-sale-card-picture) */
.rootslab-dynamic-home-card img {
    width: 296px;
    height: 296px;
    object-fit: cover;
}

.rootslab-dynamic-home-card h3 {
    font-family: 'Barlow', 'Pretendard', sans-serif;
    font-weight: 500;
    font-size: 20px;
    line-height: 130%;
    letter-spacing: 0.035em;
}

/* Nav arrows */
.rootslab-dynamic-home-slider-nav {
    position: absolute;
    left: 50%;
    top: 58%;
    width: 1260px;
    max-width: calc(100vw - 32px);
    display: flex;
    justify-content: space-between;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.rootslab-dynamic-home-slider-nav button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    pointer-events: auto;
}

.rootslab-dynamic-home-slider-nav button svg {
    width: 70px;
    height: 70px;
    display: block;
}

/* Responsive: 1200px - 1439px (slide 260, title 40) */
@media (min-width: 1200px) and (max-width: 1439px) {
    .rootslab-dynamic-home-slider-section {
        width: 100%;
        margin-top: 80px;
        gap: 40px;
    }

    .rootslab-dynamic-home-slider-title,
    .rootslab-dynamic-home-slider-cards-row {
        width: 1150px;
        padding-left: 75px;
        padding-right: 75px;
        margin-left: auto;
        margin-right: auto;
    }

    .rootslab-dynamic-home-slider .swiper-slide,
    .rootslab-dynamic-home-card {
        flex-basis: 260px;
        width: 260px;
    }

    .rootslab-dynamic-home-card img {
        width: 260px;
        height: 260px;
    }
}

/* Responsive: 768px - 1199px (slide 240, title 28, nav hidden) */
@media (min-width: 768px) and (max-width: 1199px) {
    .rootslab-dynamic-home-slider-section {
        width: 100%;
        margin-top: 64px;
        gap: 48px;
    }

    .rootslab-dynamic-home-slider-title,
    .rootslab-dynamic-home-slider-cards-row {
        width: 100%;
        padding: 0 24px;
    }

    .rootslab-dynamic-home-slider-cards-row {
        gap: 16px;
    }

    .rootslab-dynamic-home-slider-title {
        font-size: 28px;
    }

    .rootslab-dynamic-home-card h3 {
        font-size: 18px;
    }

    .rootslab-dynamic-home-slider-nav {
        display: none;
    }

    .rootslab-dynamic-home-slider .swiper-slide,
    .rootslab-dynamic-home-card {
        flex-basis: 240px;
        width: 240px;
    }

    .rootslab-dynamic-home-card img {
        width: 240px;
        height: 240px;
    }
}

/* Responsive: < 768px (2-up grid, title 24, nav hidden) */
@media (max-width: 767px) {
    .rootslab-dynamic-home-slider-section {
        --slider-mobile-card-width: calc((100vw - 40px) / 2);
        width: 100%;
        margin-top: 64px;
        gap: 48px;
        padding: 0;
    }

    .rootslab-dynamic-home-slider-title {
        width: 100%;
        padding: 0 16px;
        font-size: 24px;
    }

    .rootslab-dynamic-home-card h3 {
        font-size: 16px;
    }

    .rootslab-dynamic-home-slider-cards-row {
        width: 100%;
        padding: 0;
    }

    .rootslab-dynamic-home-slider-section .rootslab-dynamic-home-slider {
        padding-inline: 16px;
    }

    .rootslab-dynamic-home-slider-nav {
        display: none;
    }

    .rootslab-dynamic-home-slider .swiper-slide,
    .rootslab-dynamic-home-card {
        flex-basis: var(--slider-mobile-card-width);
        width: var(--slider-mobile-card-width);
    }

    .rootslab-dynamic-home-slider .swiper-slide {
        margin-right: 8px !important;
    }

    .rootslab-dynamic-home-card img {
        width: var(--slider-mobile-card-width);
        height: var(--slider-mobile-card-width);
    }
}
