/* =========================================================
   COSMETIC POINT FINAL HOMEPAGE FIX
   Loaded last.
   Desktop + Mobile:
   - Category title left, View all Categories right
   - Category one-row auto carousel
   - Brand title left, View all Brands right
   - Brand one-line logo rail, no brand text inside cards
   ========================================================= */


/* ---------- CATEGORY SECTION ---------- */

body .cp-home-categories-desktop.cp-category-section-auto {
    padding: 26px 3.2% 20px !important;
    background: #fff !important;
    overflow: hidden !important;
}

body .cp-home-categories-desktop.cp-category-section-auto .cp-category-head-auto {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 16px !important;
    width: 100% !important;
    margin: 0 0 18px !important;
    padding: 0 0 13px !important;
    border-bottom: 1px solid rgba(17, 24, 39, .08) !important;
    text-align: left !important;
}

body .cp-home-categories-desktop.cp-category-section-auto .cp-category-head-auto > div {
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

body .cp-home-categories-desktop.cp-category-section-auto .cp-category-head-auto h2 {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    margin: 0 !important;
    color: #101827 !important;
    font-size: 26px !important;
    line-height: 1.1 !important;
    font-weight: 950 !important;
    letter-spacing: -0.035em !important;
    white-space: nowrap !important;
}

body .cp-home-categories-desktop.cp-category-section-auto .cp-category-head-auto h2::before {
    content: "" !important;
    width: 8px !important;
    height: 25px !important;
    border-radius: 999px !important;
    background: linear-gradient(180deg, #d6297c, #ff88b8) !important;
    flex: 0 0 auto !important;
}

body .cp-home-categories-desktop.cp-category-section-auto .cp-category-head-auto p {
    display: none !important;
}

body .cp-home-categories-desktop.cp-category-section-auto .cp-category-head-auto .cp-view-all-categories-auto {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 7px !important;
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: max-content !important;
    margin: 0 !important;
    padding: 9px 15px !important;
    border-radius: 999px !important;
    background: #fff1f7 !important;
    border: 1px solid rgba(214, 41, 124, .16) !important;
    color: #d6297c !important;
    font-size: 13px !important;
    line-height: 1 !important;
    font-weight: 900 !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    opacity: 1 !important;
    visibility: visible !important;
    position: static !important;
    pointer-events: auto !important;
    z-index: 50 !important;
}

body .cp-home-categories-desktop.cp-category-section-auto .cp-category-head-auto .cp-view-all-categories-auto::after {
    content: "→" !important;
}

/* no visible arrows */
body .cp-home-categories-desktop .cp-cat-nav,
body .cp-home-categories-desktop .cp-cat-nav-final {
    display: none !important;
}

body .cp-category-auto-shell {
    position: relative !important;
    width: 100% !important;
    overflow: hidden !important;
}

body .cp-category-auto-rail {
    display: flex !important;
    grid-template-columns: none !important;
    flex-wrap: nowrap !important;
    gap: 18px !important;
    width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: x mandatory !important;
    scroll-behavior: smooth !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    padding: 4px 0 12px !important;
    margin: 0 !important;
}

body .cp-category-auto-rail::-webkit-scrollbar {
    display: none !important;
}

body .cp-category-auto-shell::after {
    content: "" !important;
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    width: 54px !important;
    height: 100% !important;
    pointer-events: none !important;
    background: linear-gradient(90deg, rgba(255,255,255,0), #fff 78%) !important;
}

body .cp-category-auto-card {
    flex: 0 0 96px !important;
    width: 96px !important;
    min-width: 96px !important;
    max-width: 96px !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    text-align: center !important;
    text-decoration: none !important;
    scroll-snap-align: start !important;
    overflow: visible !important;
}

body .cp-category-auto-card img,
body .cp-category-auto-card .cp-icon-placeholder {
    width: 78px !important;
    height: 78px !important;
    min-width: 78px !important;
    min-height: 78px !important;
    max-width: 78px !important;
    max-height: 78px !important;
    margin: 0 auto 9px !important;
    padding: 13px !important;
    border-radius: 999px !important;
    background:
        radial-gradient(circle at 35% 25%, rgba(255,255,255,.96), rgba(255,255,255,.25) 42%, transparent 64%),
        linear-gradient(145deg, #ffe4ee 0%, #fff4f8 58%, #ffffff 100%) !important;
    border: 1px solid rgba(214, 41, 124, .11) !important;
    box-shadow: 0 10px 25px rgba(214, 41, 124, .10) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    object-fit: contain !important;
    color: #4d1174 !important;
}

body .cp-category-auto-card strong {
    display: block !important;
    margin: 0 !important;
    color: #111827 !important;
    font-size: 13px !important;
    line-height: 1.18 !important;
    font-weight: 850 !important;
    text-align: center !important;
}


/* ---------- BRAND SECTION ---------- */

body .cp-brand-section-v4 {
    padding: 24px 3.2% 22px !important;
    background: #fff !important;
    overflow: hidden !important;
}

body .cp-brand-section-v4 .cp-brand-head-final,
body .cp-brand-section-v4 .cp-home-head {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 16px !important;
    width: 100% !important;
    margin: 0 0 18px !important;
    padding: 0 0 13px !important;
    border-bottom: 1px solid rgba(17, 24, 39, .08) !important;
    text-align: left !important;
}

body .cp-brand-section-v4 .cp-brand-head-final > div,
body .cp-brand-section-v4 .cp-home-head > div {
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

body .cp-brand-section-v4 .cp-brand-head-final h2,
body .cp-brand-section-v4 .cp-home-head h2 {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    margin: 0 !important;
    color: #101827 !important;
    font-size: 26px !important;
    line-height: 1.1 !important;
    font-weight: 950 !important;
    letter-spacing: -0.035em !important;
    white-space: nowrap !important;
}

body .cp-brand-section-v4 .cp-brand-head-final h2::before,
body .cp-brand-section-v4 .cp-home-head h2::before {
    content: "" !important;
    width: 8px !important;
    height: 25px !important;
    border-radius: 999px !important;
    background: linear-gradient(180deg, #d6297c, #ff88b8) !important;
    flex: 0 0 auto !important;
}

body .cp-brand-section-v4 .cp-brand-head-final p,
body .cp-brand-section-v4 .cp-home-head p {
    display: none !important;
}

/* Force View all Brands visible */
body .cp-brand-section-v4 .cp-brand-head-final .cp-view-all-brands-final,
body .cp-brand-section-v4 .cp-home-head .cp-view-all-brands-final,
body .cp-brand-section-v4 .cp-home-head > a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 7px !important;
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: max-content !important;
    margin: 0 !important;
    padding: 9px 15px !important;
    border-radius: 999px !important;
    background: #fff1f7 !important;
    border: 1px solid rgba(214, 41, 124, .16) !important;
    color: #d6297c !important;
    font-size: 13px !important;
    line-height: 1 !important;
    font-weight: 900 !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    opacity: 1 !important;
    visibility: visible !important;
    position: static !important;
    pointer-events: auto !important;
    z-index: 50 !important;
}

body .cp-brand-section-v4 .cp-brand-head-final .cp-view-all-brands-final::after,
body .cp-brand-section-v4 .cp-home-head .cp-view-all-brands-final::after,
body .cp-brand-section-v4 .cp-home-head > a::after {
    content: "→" !important;
}

/* one-line brand rail */
body .cp-brand-section-v4 .cp-brand-grid,
body .cp-brand-section-v4 .cp-brand-rail-v4 {
    display: flex !important;
    grid-template-columns: none !important;
    flex-wrap: nowrap !important;
    gap: 14px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: x mandatory !important;
    scroll-behavior: smooth !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    padding: 4px 0 10px !important;
    margin: 0 !important;
}

body .cp-brand-section-v4 .cp-brand-grid::-webkit-scrollbar,
body .cp-brand-section-v4 .cp-brand-rail-v4::-webkit-scrollbar {
    display: none !important;
}

/* logo only cards */
body .cp-brand-section-v4 .cp-brand-card-v4 strong,
body .cp-brand-section-v4 .cp-brand-card strong {
    display: none !important;
}

body .cp-brand-section-v4 .cp-brand-card-v4,
body .cp-brand-section-v4 .cp-brand-card {
    flex: 0 0 158px !important;
    width: 158px !important;
    min-width: 158px !important;
    max-width: 158px !important;
    height: 76px !important;
    min-height: 76px !important;
    padding: 12px 16px !important;
    border-radius: 16px !important;
    background:
        radial-gradient(circle at 50% 0%, rgba(255, 241, 247, .72), rgba(255,255,255,1) 58%) !important;
    border: 1px solid rgba(214, 41, 124, .13) !important;
    box-shadow: 0 9px 24px rgba(17, 24, 39, .05) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    scroll-snap-align: start !important;
}

body .cp-brand-section-v4 .cp-brand-card-v4 img,
body .cp-brand-section-v4 .cp-brand-card img {
    display: block !important;
    width: auto !important;
    height: auto !important;
    max-width: 132px !important;
    max-height: 50px !important;
    object-fit: contain !important;
    object-position: center !important;
    margin: auto !important;
    filter: none !important;
}


/* ---------- MOBILE HOMEPAGE FLOW ---------- */

@media (max-width: 768px) {
    /* keep admin mobile banner first naturally; compact category after banner */
    body .cp-home-categories-desktop.cp-category-section-auto {
        padding: 18px 14px 14px !important;
        margin-top: 0 !important;
    }

    body .cp-home-categories-desktop.cp-category-section-auto .cp-category-head-auto,
    body .cp-brand-section-v4 .cp-brand-head-final,
    body .cp-brand-section-v4 .cp-home-head {
        gap: 10px !important;
        margin-bottom: 13px !important;
        padding-bottom: 10px !important;
    }

    body .cp-home-categories-desktop.cp-category-section-auto .cp-category-head-auto h2,
    body .cp-brand-section-v4 .cp-brand-head-final h2,
    body .cp-brand-section-v4 .cp-home-head h2 {
        font-size: 19px !important;
    }

    body .cp-home-categories-desktop.cp-category-section-auto .cp-category-head-auto h2::before,
    body .cp-brand-section-v4 .cp-brand-head-final h2::before,
    body .cp-brand-section-v4 .cp-home-head h2::before {
        width: 6px !important;
        height: 19px !important;
    }

    body .cp-home-categories-desktop.cp-category-section-auto .cp-category-head-auto .cp-view-all-categories-auto,
    body .cp-brand-section-v4 .cp-brand-head-final .cp-view-all-brands-final,
    body .cp-brand-section-v4 .cp-home-head .cp-view-all-brands-final,
    body .cp-brand-section-v4 .cp-home-head > a {
        padding: 7px 10px !important;
        font-size: 11px !important;
    }

    body .cp-category-auto-shell,
    body .cp-brand-section-v4 .cp-brand-grid,
    body .cp-brand-section-v4 .cp-brand-rail-v4 {
        margin-left: -14px !important;
        margin-right: -14px !important;
        padding-left: 14px !important;
        padding-right: 14px !important;
    }

    body .cp-category-auto-shell::after {
        width: 28px !important;
    }

    body .cp-category-auto-rail {
        gap: 13px !important;
        padding-bottom: 8px !important;
    }

    body .cp-category-auto-card {
        flex: 0 0 70px !important;
        width: 70px !important;
        min-width: 70px !important;
        max-width: 70px !important;
    }

    body .cp-category-auto-card img,
    body .cp-category-auto-card .cp-icon-placeholder {
        width: 60px !important;
        height: 60px !important;
        min-width: 60px !important;
        min-height: 60px !important;
        max-width: 60px !important;
        max-height: 60px !important;
        padding: 9px !important;
        margin-bottom: 7px !important;
    }

    body .cp-category-auto-card strong {
        font-size: 10.5px !important;
        line-height: 1.15 !important;
    }

    body .cp-brand-section-v4 {
        padding: 18px 14px 16px !important;
    }

    body .cp-brand-section-v4 .cp-brand-card-v4,
    body .cp-brand-section-v4 .cp-brand-card {
        flex: 0 0 108px !important;
        width: 108px !important;
        min-width: 108px !important;
        max-width: 108px !important;
        height: 60px !important;
        min-height: 60px !important;
        padding: 8px 10px !important;
        border-radius: 13px !important;
    }

    body .cp-brand-section-v4 .cp-brand-card-v4 img,
    body .cp-brand-section-v4 .cp-brand-card img {
        max-width: 88px !important;
        max-height: 36px !important;
    }
}
