/* ============================================================
   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;
    vertical-align: top;
}
.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;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .home-banner-section .d-flex { flex-wrap: wrap; gap: 4px; }
    .home-banner-section .d-flex .banner-slot { flex: 0 0 calc(50% - 4px); }
}
