/* Home page — brands strip & top categories slider (static DB HTML) */

.home-slide-img {
    display: block;
    width: 100%;
    height: auto;
}

.home-slide-img--mobile {
    display: none;
}

.home-brands-section {
    width: 100%;
    background: #ffffff;
    padding: 28px 16px;
    box-sizing: border-box;
}

.home-brands-section__inner {
    max-width: 1560px;
    margin: 0 auto;
}

.home-brands-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 20px 36px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.home-brands-list__item {
    flex: 0 0 auto;
}

.home-brands-list__link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 4px 8px;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.home-brands-list__link:hover {
    opacity: 0.75;
}

.home-brands-list__link img {
    display: block;
    max-height: 52px;
    width: auto;
    height: auto;
    max-width: 140px;
    object-fit: contain;
}

/* Top categories */
.home-top-categories-section {
    position: relative;
    width: 100%;
    padding: 68px 0px 68px 0px;
    overflow: hidden;
    box-sizing: border-box;
}

.home-top-categories-section__bg {
    position: absolute;
    inset: 0;
    background-color: #f8f9fc;
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    z-index: 0;
    opacity: 0.2;
}

.home-top-categories-section__container {
    position: relative;
    z-index: 1;
    max-width: 1560px;
}

.home-top-categories-section__header {
    text-align: center;
    margin-bottom: 52px;
    padding: 0 12px;
    background: transparent;
}

.home-top-categories-section__title {
    margin: 0 0 8px;
    font-size: 22px;
    line-height: 1.45;
    font-weight: 700;
    color: #344054;
}

.home-top-categories-section__subtitle {
    margin: 0;
    font-size: 15px;
    line-height: 1.6;
    font-weight: 400;
    color: #667085;
}

.home-top-categories-slider {
    position: relative;
    padding: 0 52px;
}

.home-top-categories-slide {
    width: 100%;
    box-sizing: border-box;
}

.home-top-categories-grid {
    display: grid;
    direction: rtl;
    grid-template-columns: minmax(620px, 28%) repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(240px, 1fr));
    grid-auto-flow: dense;
    gap: 12px;
    width: 100%;
    min-height: 256px;
}

/* 1 featured (right) + 6 tiles in 3 columns × 2 rows (left) */
.home-top-categories-grid .home-top-category-tile--featured {
    grid-column: 1;
    grid-row: 1 / span 2;
}

.home-top-categories-grid .home-top-category-tile:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
}

.home-top-categories-grid .home-top-category-tile:nth-child(3) {
    grid-column: 3;
    grid-row: 1;
}

.home-top-categories-grid .home-top-category-tile:nth-child(4) {
    grid-column: 4;
    grid-row: 1;
}

.home-top-categories-grid .home-top-category-tile:nth-child(5) {
    grid-column: 2;
    grid-row: 2;
}

.home-top-categories-grid .home-top-category-tile:nth-child(6) {
    grid-column: 3;
    grid-row: 2;
}

.home-top-categories-grid .home-top-category-tile:nth-child(7) {
    grid-column: 4;
    grid-row: 2;
}

.home-top-category-tile {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 16px;
    min-height: 118px;
    background: #e4e7ec;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(16, 24, 40, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.home-top-category-tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(16, 24, 40, 0.12);
}

.home-top-category-tile--featured {
    min-height: 100%;
    border-top-right-radius: 50%;
    border-bottom-right-radius: 50%;
}

.home-top-category-tile__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.home-top-category-tile__mask {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg, rgba(16, 24, 40, 0.08) 0%, rgba(16, 24, 40, 0.62) 100%);
    pointer-events: none;
}

.home-top-category-tile__title {
    position: absolute;
    z-index: 2;
    right: 14px;
    bottom: 12px;
    left: 14px;
    margin: 0;
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.45;
    text-align: right;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
    text-align: center;
}

.home-top-category-tile--featured .home-top-category-tile__title {
    font-size: 18px;
    bottom: 18px;
    right: 18px;
    left: 18px;
}

/* Owl hides .owl-carousel until .owl-loaded; keep first slide visible if JS fails */
.home-top-categories-carousel.owl-carousel {
    display: block;
}

.home-top-categories-carousel.owl-carousel:not(.owl-loaded) > .home-top-categories-slide:not(:first-child) {
    display: none;
}

.home-top-categories-carousel.owl-carousel .owl-stage-outer {
    overflow: hidden;
    width: 100%;
}

/* Do not set float:none or width:100% on .owl-item — that stacks slides vertically */
.home-top-categories-carousel.owl-carousel .owl-item {
    box-sizing: border-box;
}

.home-top-categories-carousel.owl-carousel .owl-item.active {
    z-index: 1;
}

.home-top-categories-carousel.owl-carousel .owl-item .home-top-categories-slide,
.home-top-categories-carousel.owl-carousel .owl-item .home-top-categories-grid {
    width: 100%;
    box-sizing: border-box;
}

.home-top-categories-carousel.owl-carousel .owl-nav {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    margin: 0;
    pointer-events: none;
}

.home-top-categories-carousel.owl-carousel .owl-nav button.owl-prev,
.home-top-categories-carousel.owl-carousel .owl-nav button.owl-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    margin: 0;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.65);
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 14px rgba(16, 24, 40, 0.08);
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #344054;
    font-size: 22px;
    line-height: 1;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.home-top-categories-carousel.owl-carousel .owl-nav button.owl-prev:hover,
.home-top-categories-carousel.owl-carousel .owl-nav button.owl-next:hover {
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 6px 18px rgba(16, 24, 40, 0.12);
}

.home-top-categories-carousel.owl-carousel .owl-nav button.owl-prev {
    right: auto;
    left: -8px;
}

.home-top-categories-carousel.owl-carousel .owl-nav button.owl-next {
    left: auto;
    right: -8px;
}

.home-top-categories-carousel.owl-carousel .owl-nav button span {
    line-height: 1;
}

@media (max-width: 991px) {
    .home-slide-img--desktop {
        display: none;
    }

    .home-slide-img--mobile {
        display: block;
    }

    .home-brands-section {
        overflow: hidden;
        padding: 20px 0;
    }

    .home-brands-section__inner {
        overflow: hidden;
    }

    .home-brands-list {
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 8px 28px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        padding: 0 16px 6px;
        scrollbar-width: none;
    }

    .home-brands-list::-webkit-scrollbar {
        display: none;
    }

    .home-brands-list__link img {
        max-height: 44px;
        max-width: 110px;
    }

    .home-top-categories-section {
        padding: 32px 0 40px;
    }

    .home-top-categories-section__title {
        font-size: 20px;
    }

    .home-top-categories-section__subtitle {
        font-size: 14px;
    }

    .home-top-categories-section__header {
        margin-bottom: 24px;
    }

    .home-top-categories-slider {
        padding: 0 36px;
    }

    /* Keep the desktop slide: 1 curved featured tile + 6 tiles. Only the track size changes. */
    .home-top-categories-grid {
        grid-template-columns: minmax(0, 1.35fr) repeat(3, minmax(0, 1fr));
        grid-template-rows: repeat(2, minmax(78px, 22vw));
        min-height: 0;
        gap: 8px;
    }

    .home-top-category-tile {
        min-height: 0;
        border-radius: 14px;
    }

    .home-top-category-tile--featured {
        min-height: 100%;
        border-radius: 14px;
        border-top-right-radius: 50%;
        border-bottom-right-radius: 50%;
    }

    .home-top-category-tile__title,
    .home-top-category-tile--featured .home-top-category-tile__title {
        font-size: 12px;
        right: 8px;
        left: 8px;
        bottom: 8px;
    }

    .home-top-categories-carousel.owl-carousel .owl-nav button.owl-prev {
        left: -4px;
    }

    .home-top-categories-carousel.owl-carousel .owl-nav button.owl-next {
        right: -4px;
    }
}
