/* ============================================================
   Dynamic Banner Styles — shared across themes 11, 12, 13, 14
   Loaded via @pushOnce('css') from partials/dynamic-banners.blade.php
   ============================================================ */

/* --- Base section wrapper --- */
.home-banner-section {
    width: 100%;
    margin-top: 4px;
    margin-bottom: 8px;
}

/* --- CSS grid: map banner slots to named grid-areas by child order ---
   Works for both old HTML (class-named: .brand-img, .top-picks etc.)
   and new shared partial (.banner-slot-position-N).
   Themes 11/12/14: 5 areas (brand + 4 quadrants)
   Theme 13:        3 areas (brand + top-picks + express)
*/
.brand-grid-container > :nth-child(1) { grid-area: brand; display: flex; align-items: stretch; overflow: hidden; }
.brand-grid-container > :nth-child(2) { grid-area: top-picks; display: flex; align-items: stretch; overflow: hidden; }
.brand-grid-container > :nth-child(3) { grid-area: express;   display: flex; align-items: stretch; overflow: hidden; }
.brand-grid-container > :nth-child(4) { grid-area: new-product; display: flex; align-items: stretch; overflow: hidden; }
.brand-grid-container > :nth-child(5) { grid-area: bargain;   display: flex; align-items: stretch; overflow: hidden; }

.brand-grid-container > :nth-child(1) img {
    height: 100%;
    width: 100%;
    object-fit: cover;
}
.brand-grid-container > :nth-child(n+2) img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* --- Full-width single banner row --- */
.home-banner-section-top-single {
    margin: 8px 0;
}
.single-banner-item {
    display: flex;
    align-items: stretch;
    overflow: hidden;
    width: 100%;
}
.single-banner-item a {
    display: block;
    width: 100%;
}
.single-banner-item img {
    width: 100%;
    display: block;
}

/* --- Flex rows (positions 7-11, 13-17 etc.) --- */
.home-banner-section .d-flex {
    gap: 10px;
}
.home-banner-section .d-flex .banner-slot {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}
.home-banner-section .d-flex .banner-slot img {
    width: 100%;
    display: block;
}

/* --- General slot / link wrappers --- */
.home-banner-section .banner-slot { overflow: hidden; }
.home-banner-section .banner-link-wrapper { display: block; }
.home-banner-section .banner-link-wrapper,
.home-banner-section .single-banner-item a {
    display: block;
    width: 100%;
}

/* --- brand-grid-container slots: fill their named grid area --- */
.brand-grid-container .banner-slot {
    display: flex;
    align-items: stretch;
    overflow: hidden;
}
.brand-grid-container .banner-slot a {
    display: block;
    width: 100%;
}
.brand-grid-container .banner-slot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* --- Custom inline grid (2–4 item grid groups) --- */
.banner-custom-grid .banner-slot {
    overflow: hidden;
    position: relative;
}
.banner-custom-grid .banner-slot a,
.banner-custom-grid .banner-slot .banner-link-wrapper {
    display: block;
    width: 100%;
    height: 100%;
}
.banner-custom-grid .banner-slot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* --- Hover-image effect (two-image overlay) --- */
.banner-image-container {
    position: relative;
    overflow: hidden;
    display: block;
    width: 100%;
    height: 100%;
}
.banner-image-container .banner-main-image,
.banner-image-container .banner-hover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
    display: block;
}
.banner-image-container .banner-main-image {
    position: relative;
    z-index: 1;
}
.banner-image-container .banner-hover-image {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%; height: 100%;
    opacity: 0;
    z-index: 2;
    pointer-events: none;
}
.banner-link-wrapper.banner-has-hover:hover .banner-main-image { opacity: 0; }
.banner-link-wrapper.banner-has-hover:hover .banner-hover-image { opacity: 1; }

/* --- Slick slider wrapper per position --- */
.home-banner-slider { width: 100%; }
.home-banner-slider-item a { display: block; }
.home-banner-slider-item img { width: 100%; display: block; }

/* --- Flex slots with explicit dimensions --- */
.d-flex .banner-slot[style] {
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
}
/* Make <a> and <img> fill the entire slot height */
.d-flex .banner-slot[style] > a,
.d-flex .banner-slot[style] > .banner-link-wrapper {
    display: block;
    width: 100%;
    height: 100%;
}
.d-flex .banner-slot[style] > a > img,
.d-flex .banner-slot[style] > .banner-link-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* --- Slider images: always fill the slider container --- */
.home-banner-slider .home-banner-slider-item,
.home-banner-slider .slick-slide,
.home-banner-slider .slick-list,
.home-banner-slider .slick-track {
    height: 100%;
}
.home-banner-slider .home-banner-slider-item a {
    display: block;
    width: 100%;
    height: 100%;
}
.home-banner-slider .home-banner-slider-item img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
}

/* --- Dots navigation for Slick home banner sliders --- */
.home-banner-slider .slick-dots {
    position: absolute;
    left: 50%;
    top: auto;
    right: auto;
    bottom: 15px;
    transform: translateX(-50%);
    display: flex !important;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 8px;
    z-index: 10;
    padding: 0;
    border-radius: 20px;
}

.home-banner-slider .slick-dots li {
    width: 14px;
    height: 14px;
    margin: 0;
}

.home-banner-slider .slick-dots li button {
    width: 14px;
    height: 14px;
    padding: 0;
    border: 2px solid var(--primary-color, #232F5D);
    border-radius: 50%;
    background-color: transparent;
    transition: all 0.3s ease;
}

.home-banner-slider .slick-dots li button:before {
    display: none;
}

.home-banner-slider .slick-dots li.slick-active button {
    background-color: var(--primary-color, #232F5D);
    border-color: var(--primary-color, #232F5D);
    border-width: 2px;
    box-shadow: 0 0 8px var(--primary-color, #232F5D);
}

.home-banner-slider .slick-dots li button:hover {
    background-color: var(--primary-color, #232F5D);
    border-color: var(--primary-color, #232F5D);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    /* Use a compact mobile grid: 1 item for single groups, 2 per row for 2+ groups */
    .home-banner-section .d-flex,
    .home-banner-section .banner-custom-grid,
    .home-banner-section .brand-grid-container {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
        grid-template-rows: none !important;
    }

    .home-banner-section .banner-slot,
    .home-banner-section .single-banner-item {
        width: calc(50% - 4px) !important;
        height: auto !important;
        margin-bottom: 0;
        display: block;
    }

    .home-banner-section .banner-slot[style],
    .home-banner-section .single-banner-item[style] {
        width: calc(50% - 4px) !important;
        height: auto !important;
        flex: 0 0 calc(50% - 4px) !important;
        grid-row: auto !important;
    }

    .home-banner-section.banner-items-1 .banner-slot,
    .home-banner-section.banner-items-1 .single-banner-item,
    .home-banner-section.banner-items-1 .banner-slot[style],
    .home-banner-section.banner-items-1 .single-banner-item[style] {
        width: 100% !important;
        flex: 0 0 100% !important;
    }

    .home-banner-section .banner-slot.mobile-full,
    .home-banner-section .single-banner-item.mobile-full,
    .home-banner-section .banner-slot.mobile-full[style],
    .home-banner-section .single-banner-item.mobile-full[style] {
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }

    .home-banner-section .banner-slot.mobile-half,
    .home-banner-section .single-banner-item.mobile-half,
    .home-banner-section .banner-slot.mobile-half[style],
    .home-banner-section .single-banner-item.mobile-half[style] {
        width: calc((100% - 10px) / 2) !important;
        flex: 0 0 calc((100% - 10px) / 2) !important;
        max-width: calc((100% - 10px) / 2) !important;
    }

    .home-banner-section .banner-slot.mobile-half:last-child:nth-child(odd),
    .home-banner-section .single-banner-item.mobile-half:last-child:nth-child(odd),
    .home-banner-section .banner-slot.mobile-half[style]:last-child:nth-child(odd),
    .home-banner-section .single-banner-item.mobile-half[style]:last-child:nth-child(odd) {
        margin-left: auto;
        margin-right: auto;
    }

    .home-banner-section .banner-slot > a,
    .home-banner-section .single-banner-item > a,
    .home-banner-section .banner-slot .banner-link-wrapper {
        display: block !important;
        width: 100% !important;
        max-width: 100%;
    }

    .home-banner-section .banner-slot img,
    .home-banner-section .single-banner-item img {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
    }
}
