/* =====================================================
   HOME PAGE CSS
   File: public/assets/css/home.css
===================================================== */

.home-container{
    max-width:1320px;
}

/* CATEGORY LEFT MENU */
.category-menu-box{
    background:#fff;
    border-radius:18px;
    overflow:hidden;
    box-shadow:0 8px 22px rgba(0,0,0,.07);
    height:405px;
}

.category-menu-title{
    background:linear-gradient(135deg,var(--primary),var(--primary2));
    color:#fff;
    padding:14px 16px;
    font-weight:900;
}

.category-menu-list{
    max-height:350px;
    overflow-y:auto;
}

.category-menu-list::-webkit-scrollbar{
    width:6px;
}

.category-menu-list::-webkit-scrollbar-thumb{
    background:var(--primary);
    border-radius:20px;
}

.cat-row{
    position:relative;
    border-bottom:1px solid #f1f1f1;
}

.cat-link{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    padding:12px 15px;
    color:#333;
    text-decoration:none;
    font-weight:700;
    transition:.25s;
}

.cat-link:hover{
    background:#f0f7ff;
    color:var(--primary);
    padding-left:20px;
}

.cat-name-with-icon{
    display:flex;
    align-items:center;
    gap:10px;
}

.cat-menu-icon{
    width:22px;
    height:22px;
    object-fit:contain;
    flex-shrink:0;
}

.cat-menu-fallback-icon{
    font-size:18px;
    color:var(--primary);
    flex-shrink:0;
}

.sub-cat-box{
    position:fixed;
    width:260px;
    background:#fff;
    border-radius:0 14px 14px 0;
    box-shadow:10px 10px 30px rgba(0,0,0,.15);
    display:none;
    z-index:99999;
    overflow:hidden;
    border:1px solid #eee;
}

.sub-cat-title{
    padding:10px 15px;
    background:#f8f9fa;
    font-weight:900;
    color:var(--primary);
    border-bottom:1px solid #eee;
}

.sub-cat-link{
    display:block;
    padding:11px 16px;
    text-decoration:none;
    color:#555;
    font-size:14px;
    border-bottom:1px solid #f7f7f7;
    transition:.2s;
}

.sub-cat-link:hover{
    color:var(--primary);
    background:#f3f8ff;
    padding-left:22px;
}

/* HERO */
.hero-slider{
    height:405px;
    border-radius:18px;
    overflow:hidden;
    box-shadow:0 8px 22px rgba(0,0,0,.08);
    background:#fff;
}

.hero-slider .carousel-inner,
.hero-slider .carousel-item{
    height:100%;
}

.hero-slider img{
    width:100%;
    height:405px;
    object-fit:cover;
    display:block;
}


.hero-empty-state{
    width:100%;
    height:100%;
    min-height:240px;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:10px;
    padding:24px;
    background:linear-gradient(135deg,#f8fafc,#eef2f7);
    color:#64748b;
    text-align:center;
    font-weight:800;
}

.hero-empty-state i{
    font-size:42px;
    color:var(--primary);
}

/* SIDE BANNER */
.side-banner-wrap{
    height:405px;
    display:flex;
    flex-direction:column;
    gap:12px;
}

.side-banner{
    flex:1;
    border-radius:18px;
    overflow:hidden;
    box-shadow:0 8px 20px rgba(0,0,0,.07);
    background:#fff;
}

.side-banner img{
    width:100%;
    height:100%;
    object-fit:cover;
    transition:.35s;
    display:block;
}

.side-banner img:hover{
    transform:scale(1.04);
}

/* =====================================================
   DYNAMIC PREMIUM NOTICE TICKER
===================================================== */

.notice-ticker{
    position:relative;

    display:flex;
    align-items:center;

    min-height:48px;

    overflow:hidden;

    border:1px solid rgba(37,99,235,.18);
    border-radius:15px;

    background:
        linear-gradient(
            110deg,
            #0f172a 0%,
            #172033 48%,
            #111827 100%
        );

    color:#fff;

    box-shadow:
        0 10px 25px rgba(15,23,42,.15),
        inset 0 1px 0 rgba(255,255,255,.08);
}

.notice-label{
    position:relative;
    z-index:5;

    align-self:stretch;

    display:flex;
    align-items:center;
    gap:8px;

    flex-shrink:0;

    padding:0 18px;

    background:
        linear-gradient(
            135deg,
            #ef4444,
            #e11d48
        );

    color:#fff;

    font-size:12px;
    font-weight:900;
    letter-spacing:.03em;
    text-transform:uppercase;

    box-shadow:
        8px 0 22px rgba(239,68,68,.20);
}

.notice-label::after{
    content:'';

    position:absolute;
    top:0;
    right:-16px;

    width:18px;
    height:100%;

    background:#e11d48;

    clip-path:polygon(
        0 0,
        100% 50%,
        0 100%
    );
}

.notice-label-icon{
    display:flex;
    align-items:center;
    justify-content:center;

    width:27px;
    height:27px;

    border-radius:50%;

    background:rgba(255,255,255,.20);
}

.notice-track-wrap{
    position:relative;

    flex:1;
    min-width:0;

    overflow:hidden;

    margin-left:18px;
}

.notice-track-wrap::before,
.notice-track-wrap::after{
    content:'';

    position:absolute;
    top:0;
    bottom:0;

    width:50px;

    z-index:3;
    pointer-events:none;
}

.notice-track-wrap::before{
    left:0;

    background:
        linear-gradient(
            to right,
            #172033,
            transparent
        );
}

.notice-track-wrap::after{
    right:0;

    background:
        linear-gradient(
            to left,
            #111827,
            transparent
        );
}

.notice-track-link{
    display:block;
    color:inherit;
    text-decoration:none;
}

.notice-track-link:hover{
    color:inherit;
}

.notice-track{
    display:flex;
    align-items:center;
    width:max-content;
    transform:translateX(0);
}

.home-page.home-motion-ready .notice-track{
    animation:
        premiumNoticeScroll
        var(--notice-speed,24s)
        linear
        infinite;
    will-change:transform;
}

.notice-ticker:hover .notice-track{
    animation-play-state:paused;
}

.notice-message{
    display:flex;
    align-items:center;
    gap:14px;

    flex-shrink:0;

    padding:0 55px 0 22px;

    color:#f8fafc;

    font-size:13px;
    font-weight:700;
    white-space:nowrap;

    text-shadow:0 1px 2px rgba(0,0,0,.22);
}

.notice-dot{
    width:8px;
    height:8px;
    flex-shrink:0;
    border-radius:50%;
    background:#22c55e;
    box-shadow:
        0 0 0 5px rgba(34,197,94,.13),
        0 0 12px rgba(34,197,94,.70);
}

.home-page.home-motion-ready .notice-dot{
    animation:noticePulse 1.6s ease-in-out infinite;
}

.notice-separator{
    display:inline-flex;
    align-items:center;
    justify-content:center;

    color:#facc15;

    font-size:15px;
}

.notice-live{
    position:relative;
    z-index:5;

    display:flex;
    align-items:center;
    gap:6px;

    flex-shrink:0;

    margin-right:11px;
    padding:6px 10px;

    border:1px solid rgba(255,255,255,.12);
    border-radius:999px;

    background:rgba(255,255,255,.08);

    color:#e2e8f0;

    font-size:10px;
    font-weight:900;
    letter-spacing:.05em;
    text-transform:uppercase;
}

.notice-live span{
    width:7px;
    height:7px;
    border-radius:50%;
    background:#22c55e;
    box-shadow:0 0 10px rgba(34,197,94,.85);
}

.home-page.home-motion-ready .notice-live span{
    animation:noticePulse 1.4s ease-in-out infinite;
}

@keyframes premiumNoticeScroll{

    from{
        transform:translateX(0);
    }

    to{
        transform:translateX(-50%);
    }

}

@keyframes noticePulse{

    0%,
    100%{
        opacity:1;
        transform:scale(1);
    }

    50%{
        opacity:.45;
        transform:scale(.75);
    }

}

/* SECTION TITLE */
.section-head{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:18px;
}

.section-title{
    font-weight:900;
    font-size:30px;
    margin:0;
    position:relative;
    padding-bottom:9px;
    color:#111827;
}

.section-title::after{
    content:'';
    position:absolute;
    left:50%;
    bottom:0;
    width:76px;
    height:4px;
    background:var(--primary);
    border-radius:20px;
    transform:translateX(-50%);
}

@media(min-width:992px){
    .home-container .section-head,
    .home-container .product-section-head-center{
        display:grid;
        grid-template-columns:1fr auto 1fr;
        align-items:center;
        text-align:center;
        width:100%;
    }

    .home-container .section-head .section-title,
    .home-container .product-section-head-center .section-title{
        grid-column:2;
        justify-self:center;
        text-align:center;
    }

    .home-container .section-head .btn,
    .home-container .product-section-head-center .btn{
        grid-column:3;
        justify-self:end;
    }
}

/* PREMIUM TOP CATEGORY */
.category-scroll{
    display:flex;
    gap:20px;
    padding:10px 2px 26px;
    overflow-x:auto;
    overflow-y:hidden;
    scroll-behavior:smooth;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:thin;
}

.category-scroll::-webkit-scrollbar{
    height:7px;
}

.category-scroll::-webkit-scrollbar-thumb{
    background:var(--primary);
    border-radius:20px;
}

.category-card{
    position:relative;
    flex:0 0 auto;
    width:220px;
    height:180px;
    overflow:hidden;
    border-radius:22px;
    background:#fff;
    box-shadow:0 12px 30px rgba(0,0,0,.12);
    border:1px solid rgba(255,255,255,.6);
    transition:.35s;
    cursor:pointer;
}

.category-card:hover{
    transform:translateY(-8px);
    box-shadow:0 20px 45px rgba(0,0,0,.18);
}

.category-card img{
    width:100%;
    height:100%;
    object-fit:cover;
    display:block;
    transition:.45s;
}

.category-card:hover img{
    transform:scale(1.08);
}

.category-overlay{
    position:absolute;
    left:0;
    right:0;
    bottom:0;
    padding:20px 16px 16px;
    background:linear-gradient(
        to top,
        rgba(0,0,0,.85),
        rgba(0,0,0,.45),
        transparent
    );
    text-align:center;
}

.category-overlay h5{
    color:#fff;
    font-size:21px;
    font-weight:900;
    margin:0 0 7px;
    text-shadow:0 2px 7px rgba(0,0,0,.45);
}

.category-overlay span{
    color:#fff;
    font-size:14px;
    font-weight:800;
    opacity:.95;
}

.category-card:hover .category-overlay span{
    color:#ffe082;
}

/* PRODUCT SCROLL */
.product-scroll{
    display:flex;
    gap:18px;
    padding:5px 2px 22px;
    overflow-x:auto;
    overflow-y:hidden;
    scroll-behavior:smooth;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:none;
    scroll-snap-type:x mandatory;
}

.product-scroll::-webkit-scrollbar{
    display:none;
}

.product-item{
    flex:0 0 calc((100% - 18px) / 2);
    max-width:calc((100% - 18px) / 2);
    scroll-snap-align:start;
}

.product-card{
    background:#fff;
    border-radius:18px;
    overflow:hidden;
    border:1px solid var(--border);
    box-shadow:0 7px 18px rgba(0,0,0,.06);
    transition:.25s;
    height:100%;
    position:relative;
}

.product-card:hover{
    transform:translateY(-6px);
    box-shadow:0 12px 28px rgba(0,0,0,.10);
}

.product-img-box{
    height:170px;
    background:#f8fafc;
    padding:12px;
    display:flex;
    align-items:center;
    justify-content:center;
}

.product-img-box img{
    width:100%;
    height:100%;
    object-fit:contain;
    display:block;
}

.wishlist-btn,
.wishlist-btn-top{
    position:absolute;
    top:12px;
    right:12px;
    width:38px;
    height:38px;
    border-radius:50%;
    border:1px solid #eee;
    background:#fff;
    display:flex;
    align-items:center;
    justify-content:center;
    box-shadow:0 4px 12px rgba(0,0,0,.12);
    z-index:10;
    transition:.25s;
}

.wishlist-btn:hover,
.wishlist-btn-top:hover{
    transform:scale(1.08);
}

.tag-badge{
    position:absolute;
    top:10px;
    left:0;
    border-radius:0 50px 50px 0;
    font-size:10px;
    padding:4px 9px;
    z-index:4;
}

.price-text{
    color:var(--primary);
    font-weight:900;
}

.product-card-rating{
    display:flex;
    align-items:center;
    justify-content:center;
    gap:2px;
    margin:5px 0 6px;
    font-size:12px;
    color:var(--gold);
}

.product-card-rating i{
    color:var(--gold);
    font-size:14px;
}

.product-card-rating span{
    color:var(--muted);
    font-size:11px;
    margin-left:4px;
}

/* PROMO */
.promo-banner{
    width:100%;
}

.promo-banner img{
    width:100%;
    max-height:300px;
    object-fit:cover;
    border-radius:20px;
    box-shadow:0 10px 26px rgba(0,0,0,.08);
    display:block;
}

/* TRUST */
.trust-box{
    background:#fff;
    border-radius:18px;
    padding:24px;
    box-shadow:0 7px 18px rgba(0,0,0,.06);
    border:1px solid var(--border);
}

.trust-item img{
    width:45px;
    height:45px;
    object-fit:contain;
    margin-bottom:8px;
}

.trust-item h6{
    font-size:15px;
    margin-bottom:5px;
}

/* POPUP */
#promoModal .modal-content{
    box-shadow:none;
}

#promoModal img{
    max-height:80vh;
    object-fit:contain;
}

/* DESKTOP PRODUCT WIDTH */
@media(min-width:768px){
    .product-item{
        flex:0 0 215px;
        max-width:215px;
    }
}

/* TABLET */
@media(max-width:991px){
    .hero-slider{
        height:auto;
        min-height:0;
        aspect-ratio:1200 / 420;
    }

    .hero-slider .carousel-inner,
    .hero-slider .carousel-item{
        height:100%;
    }

    .hero-slider img{
        width:100%;
        height:100%;
        min-height:0;
        object-fit:cover;
    }

    .hero-empty-state{
        min-height:170px;
    }

    .side-banner-wrap{
        height:auto;
        flex-direction:row;
    }

    .side-banner{
        height:120px;
    }

    .product-img-box{
        height:140px;
    }

    .section-head,
    .product-section-head-center{
        display:flex;
        justify-content:space-between;
        align-items:center;
        text-align:left;
    }

    .section-title{
        font-size:23px;
    }

    .section-title::after{
        left:0;
        transform:none;
        width:54px;
        height:3px;
    }

    .category-card{
        width:190px;
        height:160px;
    }

    .category-overlay h5{
        font-size:18px;
    }
}

/* MOBILE */
@media(max-width:768px){
    .category-scroll{
        gap:14px;
        padding-bottom:20px;
    }

    .category-card{
        width:170px;
        height:145px;
        border-radius:18px;
    }

    .category-overlay{
        padding:14px 12px 12px;
    }

    .category-overlay h5{
        font-size:17px;
        margin-bottom:5px;
    }

    .category-overlay span{
        font-size:12px;
    }

    .product-card-rating i{
        font-size:13px;
    }

    .promo-banner img{
        max-height:210px;
        border-radius:16px;
    }

    .trust-box{
        padding:18px 12px;
        border-radius:16px;
    }
}

/* SMALL MOBILE */
@media(max-width:576px){
    .home-container{
        padding-left:10px;
        padding-right:10px;
    }

    .category-card{
        width:155px;
        height:132px;
        border-radius:16px;
    }

    .category-overlay h5{
        font-size:15px;
    }

    .category-overlay span{
        font-size:11px;
    }

    .product-item{
        flex:0 0 calc((100% - 14px) / 2);
        max-width:calc((100% - 14px) / 2);
    }

    .product-scroll{
        gap:14px;
    }

    .product-card{
        border-radius:15px;
    }

    .product-img-box{
        height:135px;
        padding:10px;
    }

    .wishlist-btn-top{
        width:34px;
        height:34px;
    }

    .tag-badge{
        font-size:9px;
    }

    .notice-bar{
        padding:8px 10px;
        border-radius:10px;
    }

    .notice-ticker{
    min-height:43px;
    border-radius:11px;
}

.notice-label{
    gap:5px;
    padding:0 11px;

    font-size:10px;
}

.notice-label::after{
    right:-12px;
    width:14px;
}

.notice-label-icon{
    width:23px;
    height:23px;
}

.notice-label-icon i{
    font-size:11px;
}

.notice-track-wrap{
    margin-left:12px;
}

.notice-message{
    gap:10px;

    padding-left:16px;
    padding-right:35px;

    font-size:11px;
}

.notice-live{
    display:none;
}



}

@media(prefers-reduced-motion:reduce){

    .notice-track{
        animation:none;
        transform:none;
    }

    .notice-dot,
    .notice-live span{
        animation:none;
    }

}

/* =====================================================
   ACCESSIBILITY + PERFORMANCE HARDENING
===================================================== */
.cat-link:focus-visible,
.sub-cat-link:focus-visible,
.section-head .btn:focus-visible,
.product-card a:focus-visible,
.product-card button:focus-visible{
    outline:3px solid rgba(37,99,235,.35);
    outline-offset:3px;
}

.category-scroll,
.product-scroll{
    overscroll-behavior-inline:contain;
}

@media(min-width:992px){
    .home-container:nth-of-type(n+3){
        content-visibility:auto;
        contain-intrinsic-size:500px;
    }
}

@media(max-width:575.98px){
    .section-head,
    .product-section-head-center{
        gap:12px;
    }

    .section-title{
        font-size:20px;
        line-height:1.3;
    }

    .section-head .btn,
    .product-section-head-center .btn{
        flex-shrink:0;
        white-space:nowrap;
    }

    #promoModal .modal-dialog{
        margin:12px;
    }
}
