/* ==========================================================
   NEXORA HOMEPAGE — DESKTOP/LAPTOP LAYOUT REFINEMENT
   Scope: index.html only (this file is linked only there)
   Mobile/tablet layouts below 1024px are intentionally untouched.
   ========================================================== */

@media screen and (min-width:1024px){

    html, body{
        overflow-x:hidden;
    }

    body{
        background:#f5f3f0;
    }

    /* ---------- shared desktop content frame ---------- */
    html body #premiumSection,
    html body section.category-section,
    html body #categorySponsor,
    html body #escrowWrapper,
    html body #categorySections,
    html body #categoryPosters,
    html body #newListings,
    html body #spinSection{
        width:min(calc(100% - 64px),1380px) !important;
        max-width:1380px !important;
        margin-left:auto !important;
        margin-right:auto !important;
        box-sizing:border-box !important;
    }

    /* ---------- header: deliberate desktop proportions ---------- */
    html body .nx-commerce-header{
        min-height:76px !important;
        padding-left:max(32px, calc((100vw - 1380px)/2)) !important;
        padding-right:max(32px, calc((100vw - 1380px)/2)) !important;
        box-sizing:border-box !important;
    }

    html body .nx-commerce-header .nx-commerce-wordmark{
        font-size:28px !important;
        letter-spacing:.5px !important;
    }

    html body .nx-commerce-header .nx-commerce-actions{
        gap:10px !important;
    }

    html body .nx-commerce-header .nx-commerce-action{
        width:44px !important;
        height:44px !important;
        min-width:44px !important;
        min-height:44px !important;
        border-radius:12px !important;
        font-size:17px !important;
    }

    /* ---------- premium area ---------- */
    html body #premiumSection{
        padding:22px 0 8px !important;
    }

    html body #premiumGrid.premium-grid{
        display:grid !important;
        grid-template-columns:repeat(4,minmax(0,1fr)) !important;
        gap:18px !important;
        width:100% !important;
        max-width:none !important;
        margin:0 !important;
        padding:0 !important;
        overflow:visible !important;
    }

    html body #premiumGrid > *{
        width:100% !important;
        min-width:0 !important;
        max-width:none !important;
        margin:0 !important;
    }

    /* ---------- categories: no long scattered horizontal strip ---------- */
    html body section.category-section{
        padding:10px 0 16px !important;
        margin-top:4px !important;
    }

    html body section.category-section #categoryScroll.category-scroll{
        display:flex !important;
        flex-wrap:wrap !important;
        align-items:center !important;
        justify-content:flex-start !important;
        gap:9px !important;
        width:100% !important;
        max-width:none !important;
        margin:0 !important;
        padding:12px 14px !important;
        overflow:visible !important;
        background:rgba(255,255,255,.72) !important;
        border:1px solid rgba(39,25,46,.08) !important;
        border-radius:18px !important;
        box-shadow:0 8px 24px rgba(28,18,34,.055) !important;
        box-sizing:border-box !important;
    }

    html body section.category-section #categoryScroll.category-scroll .category-chip,
    html body section.category-section #categoryScroll.category-scroll .category-chip.active{
        flex:0 0 auto !important;
        min-height:38px !important;
        padding:0 14px !important;
        border-radius:10px !important;
        font-size:13px !important;
        line-height:1 !important;
        white-space:nowrap !important;
    }

    /* ---------- buyer protection + sponsor block ---------- */
    html body #escrowWrapper{
        margin-top:14px !important;
        margin-bottom:24px !important;
        padding:0 !important;
    }

    html body #escrowWrapper .escrow-notice{
        width:100% !important;
        max-width:none !important;
        margin:0 0 16px !important;
        border-radius:18px !important;
        padding:20px 24px !important;
        box-sizing:border-box !important;
    }

    html body #homeSponsorBanner{
        display:block !important;
        width:100% !important;
        max-width:none !important;
        margin:0 !important;
        overflow:hidden !important;
        border-radius:18px !important;
    }

    html body #homeSponsorImage{
        display:block !important;
        width:100% !important;
        max-height:240px !important;
        object-fit:cover !important;
    }

    /* ---------- generated category sections ---------- */
    html body #categorySections{
        padding:0 !important;
    }

    html body #categorySections > .nx-home-category-section,
    html body #categoryPosters > .nx-home-category-section{
        width:100% !important;
        max-width:none !important;
        margin:0 0 24px !important;
        padding:20px !important;
        box-sizing:border-box !important;
        background:rgba(255,255,255,.78) !important;
        border:1px solid rgba(39,25,46,.075) !important;
        border-radius:20px !important;
        box-shadow:0 10px 28px rgba(28,18,34,.05) !important;
    }

    html body .nx-home-category-header{
        display:flex !important;
        align-items:center !important;
        justify-content:space-between !important;
        gap:20px !important;
        margin:0 0 16px !important;
        padding:0 2px 12px !important;
        border-bottom:1px solid rgba(39,25,46,.08) !important;
    }

    html body .nx-home-category-heading{
        min-width:0 !important;
    }

    html body .nx-home-category-view-all{
        flex:0 0 auto !important;
        white-space:nowrap !important;
    }

    html body .nx-home-category-products{
        display:grid !important;
        grid-template-columns:repeat(4,minmax(0,1fr)) !important;
        gap:16px !important;
        width:100% !important;
        overflow:visible !important;
    }

    html body .nx-category-product-card,
    html body .nx-category-empty-card{
        width:100% !important;
        min-width:0 !important;
        max-width:none !important;
        margin:0 !important;
    }

    html body .nx-category-product-image{
        aspect-ratio:4/3 !important;
        overflow:hidden !important;
        border-radius:14px !important;
    }

    html body .nx-category-product-image img{
        width:100% !important;
        height:100% !important;
        object-fit:cover !important;
    }

    /* ---------- sponsored strips ---------- */
    html body #categoryPosters{
        padding:0 !important;
    }

    html body #categoryPosters > .sponsored-feed-section,
    html body .sponsored-feed-section{
        width:100% !important;
        max-width:none !important;
        margin:0 0 24px !important;
        padding:18px 20px !important;
        box-sizing:border-box !important;
        border-radius:20px !important;
    }

    html body .sponsored-feed-heading{
        margin-bottom:14px !important;
    }

    html body .sponsored-feed-viewport{
        width:100% !important;
        overflow-x:auto !important;
        overflow-y:hidden !important;
    }

    html body .sponsored-feed-track{
        gap:16px !important;
    }

    /* ---------- new listings ---------- */
    html body #newListings.listing-row{
        display:grid !important;
        grid-template-columns:repeat(4,minmax(0,1fr)) !important;
        gap:18px !important;
        padding:0 !important;
        margin-top:24px !important;
        margin-bottom:30px !important;
        overflow:visible !important;
    }

    html body #newListings > *{
        width:100% !important;
        min-width:0 !important;
        max-width:none !important;
        margin:0 !important;
    }

    html body #newListings .listing-card{
        border-radius:18px !important;
        overflow:hidden !important;
        box-shadow:0 9px 24px rgba(28,18,34,.075) !important;
    }

    html body #newListings .nx-image-wrap{
        aspect-ratio:4/3 !important;
        height:auto !important;
    }

    html body #newListings .nx-image{
        width:100% !important;
        height:100% !important;
        object-fit:cover !important;
    }

    /* ---------- spin section ---------- */
    html body #spinSection.spin-section{
        margin-top:12px !important;
        margin-bottom:34px !important;
        padding:24px !important;
        border-radius:22px !important;
        box-sizing:border-box !important;
    }

    html body #spinSection .spin-title{
        display:flex !important;
        align-items:center !important;
        justify-content:space-between !important;
        gap:20px !important;
    }
}

@media screen and (min-width:1440px){
    html body #premiumGrid.premium-grid,
    html body .nx-home-category-products,
    html body #newListings.listing-row{
        grid-template-columns:repeat(5,minmax(0,1fr)) !important;
    }
}

@media screen and (min-width:1800px){
    html body #premiumSection,
    html body section.category-section,
    html body #categorySponsor,
    html body #escrowWrapper,
    html body #categorySections,
    html body #categoryPosters,
    html body #newListings,
    html body #spinSection{
        width:min(calc(100% - 96px),1500px) !important;
        max-width:1500px !important;
    }

    html body .nx-commerce-header{
        padding-left:max(48px, calc((100vw - 1500px)/2)) !important;
        padding-right:max(48px, calc((100vw - 1500px)/2)) !important;
    }
}
