/* =========================================================
   GLOBAL RESET
========================================================= */

*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

html,
body{
    min-height:100%;
    font-family:'Poppins',sans-serif;
    background:#f5f5f5;
    color:#222;
}

body{
    overflow-x:hidden;
}

a{
    color:inherit;
}


/* =========================================================
   PAGE WRAPPER
========================================================= */

.page-wrapper{
    min-height:100vh;
    display:flex;
    flex-direction:column;
}


/* =========================================================
   HEADER
========================================================= */

.header{
    position:sticky;
    top:0;
    z-index:1000;
    width:100%;
    min-height:64px;
    padding:12px 5%;
    background:#fff;

    display:flex;
    align-items:center;
    justify-content:space-between;

    gap:25px;

    transition:box-shadow .3s ease;
}

.header.scrolled{
    box-shadow:0 4px 12px rgba(0,0,0,.08);
}


/* =========================================================
   LOGO SECTION
========================================================= */

.logo-section{
    display:flex;
    align-items:center;
    gap:15px;
    flex-shrink:0;
}

.logo-section img{
    display:block;
    height:30px;
    width:auto;
}

.track-link{
    font-size:13px;
    color:#ff6b00;
    text-decoration:none;
    font-weight:600;
    white-space:nowrap;
}

.track-link:hover{
    color:#e65100;
}


/* =========================================================
   SEARCH BOX
========================================================= */

.search-box{
    position:relative;
    width:420px;
    max-width:100%;
    margin:0 auto;
}

.search-box input{
    width:100%;
    height:36px;

    padding:8px 12px;

    border:1px solid #ddd;
    border-radius:6px;

    outline:none;

    font-family:'Poppins',sans-serif;
    font-size:13px;

    background:#fff;

    transition:
        border-color .2s ease,
        box-shadow .2s ease;
}

.search-box input:focus{
    border-color:#ff6b00;
    box-shadow:0 0 0 3px rgba(255,107,0,.1);
}

.search-box input::placeholder{
    color:#888;
}


/* =========================================================
   SEARCH RESULTS
========================================================= */

#searchResults{
    display:none;

    position:absolute;
    top:100%;
    left:0;

    width:100%;

    margin-top:5px;

    background:#fff;

    border-radius:10px;

    box-shadow:0 8px 20px rgba(0,0,0,.15);

    z-index:99999;

    max-height:420px;

    overflow-y:auto;
}

.search-item{
    display:flex;
    align-items:center;

    gap:12px;

    padding:10px;

    border-bottom:1px solid #eee;

    cursor:pointer;

    transition:.2s;
}

.search-item:hover{
    background:#f5f5f5;
}

.search-item img{
    width:55px;
    height:55px;

    object-fit:cover;

    border-radius:8px;
}

.search-details{
    flex:1;
}

.search-name{
    font-weight:600;
    color:#222;
}

.search-brand{
    font-size:13px;
    color:#777;
}

.search-price{
    color:#16a34a;
    font-weight:bold;
}

.view-all{
    padding:12px;

    text-align:center;

    font-weight:bold;

    background:#f8f8f8;

    cursor:pointer;
}

.view-all:hover{
    background:#ececec;
}


/* =========================================================
   HEADER ACTIONS
========================================================= */

.header-actions{
    display:flex;
    align-items:center;
    justify-content:flex-end;

    gap:18px;

    flex-shrink:0;
}


/* =========================================================
   LOGIN LINK
========================================================= */

.login-link{
    display:flex;
    align-items:center;

    gap:6px;

    color:#0f766e;

    text-decoration:none;

    font-weight:600;

    white-space:nowrap;
}

.login-link:hover{
    color:#0d9488;
}


/* =========================================================
   USER DROPDOWN
   IMPORTANT:
   Only .user-dropdown-menu is used.
   Old .dropdown-menu CSS removed.
========================================================= */

.user-dropdown{
    position:relative;
    display:inline-block;
}

.user-dropdown-menu{
    position:absolute;
    top:calc(100% + 5px);
    right:0;
    width:210px;
    background:#fff;
    border-radius:10px;
    box-shadow:0 8px 25px rgba(0,0,0,.15);
    padding:6px 0;
    display:none;
    z-index:999999;
}

.user-dropdown:hover .user-dropdown-menu{
    display:block;
}


/* USER BUTTON */

.user-dropdown-btn{
    display:flex;
    align-items:center;

    gap:7px;

    padding:8px 12px;

    border:none;

    background:transparent;

    border-radius:25px;

    color:#0f766e;

    font-family:'Poppins',sans-serif;

    font-size:14px;

    font-weight:600;

    cursor:pointer;

    white-space:nowrap;
}

.user-dropdown-btn:hover{
    background:#f5f5f5;
}

.user-dropdown-btn .fa-user-circle{
    font-size:20px;
}

.user-dropdown-btn .dropdown-arrow{
    font-size:11px;

    margin-left:2px;

    transition:transform .2s ease;
}


/* ROTATE ARROW WHEN OPEN */

.user-dropdown.open .dropdown-arrow{
    transform:rotate(180deg);
}


/* DROPDOWN MENU */

.user-dropdown-menu{
    position:absolute;

    top:calc(100% + 8px);

    right:0;

    width:210px;

    background:#fff;

    border-radius:10px;

    box-shadow:0 8px 25px rgba(0,0,0,.15);

    padding:6px 0;

    display:none;

    z-index:99999;

    overflow:hidden;
}


/* SHOW ONLY WHEN OPEN */

.user-dropdown.open .user-dropdown-menu{
    display:block;
}


/* DROPDOWN LINKS */

.user-dropdown-menu a{
    display:flex;

    align-items:center;

    gap:10px;

    width:100%;

    padding:11px 15px;

    color:#333;

    text-decoration:none;

    font-size:14px;

    font-weight:400;

    transition:
        background .2s ease,
        color .2s ease;
}

.user-dropdown-menu a i{
    width:18px;

    text-align:center;

    color:#64748b;
}

.user-dropdown-menu a:hover{
    background:#f3f4f6;

    color:#16a34a;
}

.user-dropdown-menu a:hover i{
    color:#16a34a;
}


/* =========================================================
   CART ICON
========================================================= */

.cart-icon{
    position:relative;

    display:inline-flex;

    align-items:center;
    justify-content:center;

    width:35px;
    height:35px;

    font-size:22px;

    cursor:pointer;

    color:#111;

    flex-shrink:0;
}

.cart-icon:hover{
    color:#ff6f00;
}

.cart-count{
    position:absolute;

    top:-5px;
    right:-7px;

    background:#97DE2C;

    color:#fff;

    font-size:11px;

    font-weight:600;

    min-width:18px;
    height:18px;

    padding:0 5px;

    border-radius:50%;

    display:flex;

    align-items:center;
    justify-content:center;

    line-height:18px;
}

.cart-count:empty{
    display:none;
}


/* =========================================================
   CATEGORIES BAR
========================================================= */

.categories{
    position:sticky;

    top:64px;

    z-index:998;

    min-height:54px;

    background:#fff;

    display:flex;

    align-items:center;

    gap:20px;

    padding:10px 5%;

    overflow-x:auto;

    scroll-behavior:smooth;

    border-bottom:1px solid #eee;
}

.categories::-webkit-scrollbar{
    height:4px;
}

.categories::-webkit-scrollbar-thumb{
    background:#ddd;

    border-radius:10px;
}

.categories a{
    text-decoration:none;

    color:#333;

    white-space:nowrap;

    padding:7px 14px;

    border-radius:20px;

    transition:.2s;

    font-size:14px;
}

.categories a:hover{
    background:#ff6f00;

    color:#fff;
}

.categories a.active{
    background:#ff6f00;

    color:#fff;
}


/* =========================================================
   CATEGORY PAGE
========================================================= */

.category-page{
    flex:1;

    display:flex;

    align-items:flex-start;

    gap:20px;

    padding:20px 5%;
}


/* =========================================================
   MOBILE FILTER TOGGLE
========================================================= */

.filter-toggle{
    display:none;

    width:100%;

    padding:12px 15px;

    background:#fff;

    border-radius:8px;

    font-weight:600;

    cursor:pointer;

    margin-bottom:10px;

    justify-content:space-between;

    align-items:center;
}


/* =========================================================
   LEFT FILTER SIDEBAR
========================================================= */

.side-menu{
    width:220px;

    flex:0 0 220px;

    background:#fff;

    padding:15px;

    border-radius:8px;

    position:sticky;

    top:90px;

    height:fit-content;

    box-shadow:0 2px 8px rgba(0,0,0,.04);
}

.side-menu a{
    display:block;

    padding:10px;

    text-decoration:none;

    color:#333;

    border-radius:6px;

    margin-bottom:8px;

    font-size:14px;

    transition:.2s;
}

.side-menu a:last-child{
    margin-bottom:0;
}

.side-menu a:hover,
.side-menu a.active{
    background:#ff6f00;

    color:#fff;
}


/* =========================================================
   PRODUCT GRID
========================================================= */

.product-grid{
    flex:1;

    min-width:0;

    display:grid;

    grid-template-columns:
        repeat(5,minmax(0,1fr));

    gap:20px;
}


/* =========================================================
   PRODUCT CARD
========================================================= */

.product-card{
    position:relative;

    background:#fff;

    padding:15px;

    border-radius:10px;

    text-align:center;

    transition:.3s;

    min-width:0;
}

.product-card:hover{
    box-shadow:0 5px 15px rgba(0,0,0,.08);

    transform:translateY(-2px);
}

.product-card img{
    display:block;

    width:120px;
    height:120px;

    max-width:100%;

    margin:0 auto;

    object-fit:contain;
}

.product-card h4{
    margin:10px 0 6px;

    font-size:15px;

    line-height:1.4;
}


/* PRODUCT META */

.product-card .product-meta{
    font-size:13px;

    color:#64748b;
}


/* =========================================================
   DISCOUNT BADGE
========================================================= */

.discount-badge{
    position:absolute;

    top:8px;
    left:8px;

    background:#16a34a;

    color:#fff;

    font-size:12px;

    padding:4px 8px;

    border-radius:6px;

    font-weight:500;

    z-index:2;
}


/* =========================================================
   PRICE
========================================================= */

.price{
    color:#ff6f00;

    font-weight:600;
}

.product-price{
    margin:6px 0;
}

.product-price .mrp{
    text-decoration:line-through;

    color:#94a3b8;
}

.product-price .selling-price{
    font-weight:600;

    color:#16a34a;

    margin-left:6px;
}


/* =========================================================
   QUANTITY BOX
========================================================= */

.qty-box{
    display:flex;

    justify-content:center;

    align-items:center;

    gap:10px;

    margin:8px 0;
}

.qty-btn{
    width:30px;
    height:30px;

    border:none;

    background:#e5e7eb;

    border-radius:6px;

    cursor:pointer;

    font-size:18px;

    line-height:30px;

    transition:.2s;
}

.qty-btn:hover{
    background:#d1d5db;
}

.qty-input{
    width:40px;
    height:30px;

    text-align:center;

    border:none;

    background:transparent;

    font-weight:500;

    outline:none;
}


/* =========================================================
   BUTTONS
========================================================= */

.btn{
    background:#ff6f00;

    color:#fff;

    padding:8px 12px;

    border:none;

    border-radius:6px;

    cursor:pointer;

    margin-top:8px;

    font-family:'Poppins',sans-serif;

    transition:.2s;
}

.btn:hover{
    background:#e65100;
}

.view-cart-btn{
    display:inline-block;

    background:#ff6f00;

    color:#fff;

    padding:8px 14px;

    border-radius:6px;

    text-decoration:none;

    font-size:14px;
}

.view-cart-btn:hover{
    background:#e65100;
}


/* =========================================================
   MOBILE CART BAR
========================================================= */

.mobile-cart-bar{
    display:none;

    position:fixed;

    bottom:0;
    left:0;

    width:100%;

    background:#fff;

    padding:12px 15px;

    box-shadow:0 -4px 12px rgba(0,0,0,.1);

    z-index:999;

    justify-content:space-between;

    align-items:center;

    font-weight:600;
}

.cart-info{
    font-size:14px;
}


/* =========================================================
   FOOTER
========================================================= */

.footer{
    background:#111;

    color:#fff;

    text-align:center;

    padding:15px 10px;

    font-size:14px;

    margin-top:auto;
}


/* =========================================================
   WHATSAPP
========================================================= */

.whatsapp-float{
    position:fixed;

    bottom:80px;

    right:15px;

    width:45px;

    height:55px;

    z-index:99999;
}

.whatsapp-float img{
    width:100%;

    height:auto;

    display:block;
}


/* =========================================================
   LARGE TABLET
========================================================= */

@media(max-width:1200px){

    .product-grid{
        grid-template-columns:
            repeat(4,minmax(0,1fr));
    }

    .search-box{
        width:350px;
    }

}


/* =========================================================
   TABLET
========================================================= */

@media(max-width:992px){

    .header{
        gap:15px;
    }

    .search-box{
        width:300px;
    }

    .header-actions{
        gap:10px;
    }

    .product-grid{
        grid-template-columns:
            repeat(3,minmax(0,1fr));
    }

    .side-menu{
        width:190px;

        flex-basis:190px;
    }

}


/* =========================================================
   MOBILE
========================================================= */

@media(max-width:768px){

    .header{
        flex-wrap:wrap;

        padding:10px 4%;

        gap:10px;
    }

    .logo-section{
        flex:1;

        min-width:0;
    }

    .logo-section img{
        height:30px;
    }

    .track-link{
        display:none;
    }

    .header-actions{
        gap:8px;
    }

    .user-dropdown-btn{
        padding:6px 5px;

        font-size:14px;
    }

    .user-dropdown-btn .fa-user-circle{
        font-size:18px;
    }

    .search-box{
        order:3;

        width:100%;

        margin:0;
    }

    .search-box input{
        width:100%;

        height:38px;
    }

    .categories{
        position:sticky;

        top:108px;

        gap:12px;

        padding:10px 4%;

        min-height:50px;

        -webkit-overflow-scrolling:touch;
    }

    .categories a{
        font-size:13px;

        padding:7px 13px;
    }

    .category-page{
        flex-direction:column;

        padding:15px 4%;

        gap:10px;
    }

    .filter-toggle{
        display:flex;
    }

    .side-menu{
        display:none;

        width:100%;

        flex-basis:auto;

        position:relative;

        top:0;

        margin-bottom:5px;
    }

    .side-menu.show{
        display:block;
    }

    .product-grid{
        width:100%;

        grid-template-columns:
            repeat(2,minmax(0,1fr));

        gap:12px;
    }

    .product-card{
        padding:12px 8px;
    }

    .product-card img{
        width:110px;

        height:110px;
    }

    .product-card h4{
        font-size:14px;
    }

    .qty-box{
        gap:6px;
    }

    .qty-btn{
        width:28px;

        height:28px;
    }

    .qty-input{
        width:35px;
    }

    .btn{
        width:100%;

        font-size:13px;

        padding:8px 6px;
    }

    .mobile-cart-bar{
        display:flex;
    }

    body{
        padding-bottom:70px;
    }

    .footer{
        padding-bottom:85px;
    }


    /* MOBILE DROPDOWN */

    .user-dropdown-menu{
        right:-5px;

        width:200px;
    }

}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media(max-width:480px){

    .header{
        padding:10px 3%;
    }

    .logo-section img{
        height:28px;
    }

    .user-dropdown-btn{
        font-size:13px;

        gap:4px;
    }

    .user-dropdown-btn .fa-user-circle{
        font-size:17px;
    }

    .user-dropdown-menu{
        position:fixed;

        top:105px;

        right:10px;

        width:210px;
    }

    .cart-icon{
        width:32px;

        height:32px;

        font-size:20px;
    }

    .categories{
        top:105px;
    }

    .category-page{
        padding:12px 3%;
    }

    .product-grid{
        grid-template-columns:
            repeat(2,minmax(0,1fr));

        gap:10px;
    }

    .product-card{
        padding:10px 6px;
    }

    .product-card img{
        width:95px;

        height:95px;
    }

    .product-card h4{
        font-size:13px;
    }

    .product-card .product-meta{
        font-size:11px;
    }

    .discount-badge{
        top:6px;

        left:5px;

        font-size:10px;

        padding:3px 6px;
    }

}


/* =========================================================
   VERY SMALL MOBILE
========================================================= */

@media(max-width:360px){

    .user-dropdown-btn{
        max-width:150px;

        overflow:hidden;

        text-overflow:ellipsis;
    }

    .user-dropdown-btn .dropdown-arrow{
        display:none;
    }

    .product-grid{
        grid-template-columns:1fr;
    }

}