/* ==========================================================
   Phase 51 - Homepage Sales Layout
   Homepage-only conversion layout. Built on the proven 50.36
   mobile viewport fix. No global colour/brand reset.
========================================================== */

/* Homepage section rhythm */
.af-homepage .af-section{
    position:relative;
}
.af-homepage .af-section-head h2::before{
    content:none !important;
}
.af-homepage .af-section-head h2{
    letter-spacing:-.35px;
}

/* Quick sales shortcuts */
.af-home-quicklinks-section{
    padding:6px 0 10px !important;
}
.af-home-quicklinks{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:12px;
}
.af-home-quicklink{
    min-width:0;
    min-height:74px;
    display:flex;
    align-items:center;
    gap:12px;
    padding:14px 16px;
    border:1px solid var(--af-line);
    border-radius:18px;
    background:#fff;
    box-shadow:0 10px 28px rgba(15,23,42,.05);
    transition:transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.af-home-quicklink:hover{
    transform:translateY(-2px);
    box-shadow:0 16px 34px rgba(15,23,42,.09);
    border-color:rgba(43,143,202,.28);
}
.af-home-quicklink-icon{
    flex:0 0 42px;
    width:42px;
    height:42px;
    border-radius:14px;
    display:flex;
    align-items:center;
    justify-content:center;
    background:var(--af-blue-soft);
    color:var(--af-blue-dark);
    font-size:20px;
}
.af-home-quicklink:nth-child(2) .af-home-quicklink-icon{
    background:var(--af-orange-soft);
    color:var(--af-orange);
}
.af-home-quicklink:nth-child(3) .af-home-quicklink-icon{
    background:#fff8dc;
    color:#b77900;
}
.af-home-quicklink:nth-child(4) .af-home-quicklink-icon{
    background:#eefcf4;
    color:#15803d;
}
.af-home-quicklink strong{
    display:block;
    font-size:14px;
    line-height:1.2;
    color:#0f172a;
}
.af-home-quicklink small{
    display:block;
    margin-top:3px;
    color:var(--af-muted);
    font-size:11px;
    line-height:1.2;
}

/* Homepage categories: balanced premium cards */
.af-homepage #categoryGrid.af-category-grid{
    display:grid !important;
    grid-template-columns:repeat(6,minmax(0,1fr)) !important;
    gap:18px !important;
    width:100% !important;
    max-width:100% !important;
    margin:0 !important;
    padding:0 !important;
}
.af-homepage #categoryGrid .af-category-card{
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    min-height:170px !important;
    padding:18px 12px 16px !important;
    border-radius:22px !important;
    border:1px solid rgba(15,23,42,.08) !important;
    background:linear-gradient(180deg,#fff 0%,#fbfdff 100%) !important;
    box-shadow:0 12px 32px rgba(15,23,42,.055) !important;
    gap:12px !important;
    overflow:hidden !important;
}
.af-homepage #categoryGrid .af-category-card::after{
    content:none !important;
}
.af-homepage #categoryGrid .af-category-icon{
    width:96px !important;
    height:96px !important;
    max-width:100% !important;
    object-fit:contain !important;
    filter:drop-shadow(0 8px 14px rgba(15,23,42,.08)) !important;
}
.af-homepage #categoryGrid .af-category-card span{
    width:100% !important;
    min-height:38px !important;
    font-size:14px !important;
    line-height:1.22 !important;
    font-weight:800 !important;
    color:#0f172a !important;
    text-align:center !important;
    display:-webkit-box !important;
    -webkit-line-clamp:2 !important;
    -webkit-box-orient:vertical !important;
    overflow:hidden !important;
}
.af-category-toggle-wrap{
    display:none;
    margin-top:16px;
    text-align:center;
}
.af-category-toggle{
    min-height:44px;
    padding:0 20px;
    border-radius:14px;
    border:1px solid #dbe3ee;
    background:#fff;
    color:var(--af-blue-dark);
    font-size:13px;
    font-weight:900;
}

/* Product sections */
.af-homepage .af-home-product-section{
    scroll-margin-top:112px;
}
.af-homepage .af-home-product-section[data-home-section="best-sellers"]{
    background:linear-gradient(180deg,rgba(238,248,255,.52),rgba(255,255,255,0));
}
.af-homepage .af-home-product-section[data-home-section="special-offers"]{
    background:linear-gradient(180deg,rgba(255,241,235,.48),rgba(255,255,255,0));
}

/* Saudi favourites collection block */
.af-saudi-feature{
    position:relative;
    overflow:hidden;
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    gap:28px;
    align-items:center;
    padding:34px 38px;
    border:1px solid #e7edf4;
    border-radius:26px;
    background:
        radial-gradient(circle at 88% 15%,rgba(247,189,43,.22),transparent 28%),
        radial-gradient(circle at 10% 100%,rgba(103,183,228,.18),transparent 34%),
        #fff;
    box-shadow:0 18px 44px rgba(15,23,42,.07);
}
.af-saudi-feature-copy{
    position:relative;
    z-index:1;
}
.af-saudi-feature-kicker{
    margin-bottom:7px;
    color:var(--af-orange);
    font-size:12px;
    font-weight:900;
    text-transform:uppercase;
    letter-spacing:.6px;
}
.af-saudi-feature h2{
    margin:0 0 8px;
    color:#0f172a;
    font-size:30px;
    font-weight:900;
    line-height:1.1;
}
.af-saudi-feature p{
    max-width:700px;
    margin:0;
    color:var(--af-muted);
    font-size:14px;
}
.af-saudi-feature-actions{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
    justify-content:flex-end;
}

/* Wholesale CTA replaces unsupported fixed 20% promise */
.af-homepage .af-register-band.af-wholesale-home-cta{
    grid-template-columns:minmax(0,1fr) auto !important;
    gap:24px !important;
    padding:38px !important;
    border-radius:26px !important;
    border:1px solid #dceaf3 !important;
    box-shadow:0 18px 42px rgba(15,23,42,.06);
}
.af-homepage .af-wholesale-home-cta h2{
    margin-bottom:10px;
}
.af-wholesale-home-actions{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
    justify-content:flex-end;
}

/* Mobile-only mid-page promotion */
.af-mobile-mid-promo{
    display:none;
}

@media(max-width:1199px){
    .af-homepage #categoryGrid.af-category-grid{
        grid-template-columns:repeat(4,minmax(0,1fr)) !important;
    }
    .af-home-quicklinks{
        grid-template-columns:repeat(2,minmax(0,1fr));
    }
}

@media(max-width:767px){
    /* Keep the proven full-width mobile layout */
    .af-homepage{
        width:100% !important;
        max-width:100% !important;
        overflow-x:clip !important;
    }

    .af-homepage .af-home-banners-section{
        padding-top:10px !important;
        padding-bottom:8px !important;
    }

    /* Main promo is shallower so the customer reaches products faster. */
    .af-homepage .af-home-banners-section .af-hero-main.af-banner-image-only{
        width:100% !important;
        height:auto !important;
        min-height:0 !important;
        max-height:none !important;
        aspect-ratio:30 / 13 !important;
        border-radius:16px !important;
    }
    .af-homepage .af-home-banners-section .af-hero-main.af-banner-image-only img{
        width:100% !important;
        height:100% !important;
        object-fit:contain !important;
    }

    /* Side banners leave the top fold and one is reused mid-page. */
    .af-homepage .af-home-banners-section .af-side-offers{
        display:none !important;
    }
    .af-homepage .af-home-banners-section .af-hero-grid{
        grid-template-columns:1fr !important;
        gap:0 !important;
    }

    .af-home-quicklinks-section{
        padding:7px 0 14px !important;
    }
    .af-home-quicklinks{
        grid-template-columns:repeat(4,minmax(0,1fr));
        gap:7px;
    }
    .af-home-quicklink{
        min-height:82px;
        padding:9px 4px 8px;
        gap:6px;
        border-radius:16px;
        flex-direction:column;
        justify-content:center;
        text-align:center;
        box-shadow:0 8px 22px rgba(15,23,42,.045);
    }
    .af-home-quicklink-icon{
        width:38px;
        height:38px;
        flex-basis:38px;
        border-radius:13px;
        font-size:18px;
    }
    .af-home-quicklink strong{
        font-size:10.5px;
        line-height:1.15;
    }
    .af-home-quicklink small{
        display:none;
    }

    .af-homepage .af-section-head{
        margin-bottom:14px !important;
    }
    .af-homepage .af-section-head h2{
        font-size:20px !important;
        line-height:1.12 !important;
    }
    .af-homepage .af-view-link{
        font-size:12px !important;
        max-width:42% !important;
    }

    .af-homepage #categoryGrid.af-category-grid{
        grid-template-columns:repeat(2,minmax(0,1fr)) !important;
        gap:12px !important;
    }
    .af-homepage #categoryGrid .af-category-card{
        min-height:145px !important;
        padding:12px 8px 11px !important;
        border-radius:20px !important;
        gap:8px !important;
        box-shadow:0 9px 24px rgba(15,23,42,.05) !important;
    }
    .af-homepage #categoryGrid .af-category-icon{
        width:84px !important;
        height:84px !important;
    }
    .af-homepage #categoryGrid .af-category-card span{
        min-height:32px !important;
        font-size:12.5px !important;
        line-height:1.2 !important;
    }
    .af-homepage #categoryGrid .af-category-mobile-extra{
        display:none !important;
    }
    .af-homepage #categoryGrid.af-category-show-all .af-category-mobile-extra{
        display:flex !important;
    }
    .af-homepage .af-category-toggle-wrap{
        display:block;
    }

    .af-mobile-mid-promo{
        display:block;
        padding:4px 0 12px;
    }
    .af-mobile-mid-promo .af-side-card{
        display:block !important;
        width:100% !important;
        height:auto !important;
        min-height:0 !important;
        aspect-ratio:16 / 9 !important;
        padding:0 !important;
        border-radius:16px !important;
        overflow:hidden !important;
        border:1px solid var(--af-line) !important;
        background:#fff !important;
        box-shadow:0 10px 28px rgba(15,23,42,.06) !important;
    }
    .af-mobile-mid-promo .af-side-card img{
        display:block !important;
        width:100% !important;
        height:100% !important;
        object-fit:contain !important;
        background:#fff !important;
    }
    .af-mobile-mid-promo .af-banner-content-mode{
        min-height:140px !important;
        padding:20px !important;
        aspect-ratio:auto !important;
    }

    .af-saudi-feature{
        grid-template-columns:1fr;
        gap:18px;
        padding:24px 20px;
        border-radius:22px;
    }
    .af-saudi-feature h2{
        font-size:24px;
    }
    .af-saudi-feature p{
        font-size:13px;
    }
    .af-saudi-feature-actions{
        justify-content:flex-start;
    }

    .af-homepage .af-register-band.af-wholesale-home-cta{
        grid-template-columns:1fr !important;
        padding:24px 20px !important;
        gap:18px !important;
        border-radius:22px !important;
    }
    .af-homepage .af-wholesale-home-cta h2{
        font-size:25px !important;
    }
    .af-wholesale-home-actions{
        justify-content:flex-start;
    }
    .af-wholesale-home-actions .btn,
    .af-saudi-feature-actions .btn{
        min-height:44px;
    }
}

@media(max-width:390px){
    .af-home-quicklinks{
        gap:6px;
    }
    .af-home-quicklink{
        min-height:78px;
        border-radius:14px;
    }
    .af-home-quicklink strong{
        font-size:10px;
    }
    .af-homepage #categoryGrid.af-category-grid{
        gap:10px !important;
    }
    .af-homepage #categoryGrid .af-category-card{
        min-height:136px !important;
    }
    .af-homepage #categoryGrid .af-category-icon{
        width:78px !important;
        height:78px !important;
    }
}


