/* --- QUICK MART NEPAL - FULL MASTER REFINED CSS --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;700;900&display=swap');

/* =========================
   1. RESET & BASE
========================= */
html { scroll-behavior: smooth; }
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }
body { background: #fff; color: #000; display: flex; flex-direction: column; min-height: 100vh; overflow-x: hidden; }
a { text-decoration: none; color: inherit; }

/* =========================
   2. HEADER & NAVIGATION
========================= */
header {
    display: flex; justify-content: space-between; align-items: center; padding: 15px 5%;
    border-bottom: 1px solid #eee; position: sticky; top: 0; background: #fff; z-index: 1000;
}
.logo img { height: 40px; }
.nav-links { display: flex; gap: 20px; }
.nav-links a { font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; transition: 0.3s; }
.nav-links a:hover { color: #ff0000; }
.chat-right { display: flex; align-items: center; gap: 15px; }
.menu-toggle { display: none; font-size: 24px; cursor: pointer; }

/* =========================
   3. MOBILE MENU
========================= */
.mobile-menu {
    position: fixed; top: 0; right: -100%; width: 80%; height: 100%; background: #fff; z-index: 2000;
    transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: -10px 0 20px rgba(0,0,0,0.1); padding: 80px 40px;
}
.mobile-menu.active { right: 0; }
.close-menu { position: absolute; top: 25px; right: 25px; font-size: 28px; cursor: pointer; }
.mobile-links { display: flex; flex-direction: column; gap: 20px; }
.mobile-links a { font-size: 18px; font-weight: 900; text-transform: uppercase; border-bottom: 1px solid #f4f4f4; padding-bottom: 10px; }

/* =========================
   4. HERO SLIDER
========================= */
.hero-slider { width: 100%; height: 0; padding-top: 56.25%; position: relative; overflow: hidden; background: #f4f4f4; }
.slide-track { display: flex; width: 500%; height: 100%; position: absolute; top: 0; left: 0; animation: slideForward 20s infinite; }
.slide { width: 20%; height: 100%; flex-shrink: 0; }
.slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
@keyframes slideForward {
    0%, 15% { transform: translateX(0%); }
    20%, 35% { transform: translateX(-20%); }
    40%, 55% { transform: translateX(-40%); }
    60%, 75% { transform: translateX(-60%); }
    80%, 95% { transform: translateX(-80%); }
    100% { transform: translateX(0%); }
}

/* =========================
   5. CATEGORY GRID
========================= */
.cat-hero { height: 20vh; min-height: 150px; background: #000; display: flex; align-items: center; justify-content: center; color: #fff; text-align: center; }
.cat-hero h1 { font-size: clamp(22px, 5vw, 32px); font-weight: 900; text-transform: uppercase; }

.container { padding: 40px 5%; flex: 1; max-width: 1400px; margin: 0 auto; width: 100%; }
.section-head { margin-bottom: 30px; border-bottom: 2px solid #000; padding-bottom: 10px; }
.section-head h2 { font-weight: 900; text-transform: uppercase; font-size: 18px; }
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px 25px; }

/* =========================
   6. PRODUCT CARD & SIZES
========================= */
.product-card { display: flex; flex-direction: column; position: relative; }
.img-container { width: 100%; aspect-ratio: 1 / 1; overflow: hidden; background: #f4f4f4; position: relative; }
.img-container img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(100%); transition: 0.5s; }
.product-card:hover img { filter: grayscale(0%); transform: scale(1.05); }

.product-info { padding: 15px 0; display: flex; flex-direction: column; flex-grow: 1; }
.p-name { font-weight: 900; font-size: 14px; text-transform: uppercase; margin-bottom: 8px; min-height: 34px; }

.size-options { display: flex; gap: 8px; margin: 15px 0; flex-wrap: wrap; border: none; background: none; }
.size-btn { 
    display: inline-flex; align-items: center; justify-content: center; padding: 8px 12px; 
    border: 1px solid #000; background: #fff; color: #000; font-size: 12px; font-weight: 700; 
    cursor: pointer; border-radius: 4px; transition: 0.2s; min-width: 42px; height: 35px;
}
.size-btn:hover { background: #f0f0f0; }
.size-btn.active { background: #000 !important; color: #fff !important; border-color: #000 !important; }

.price { font-weight: 900; font-size: 16px; margin-bottom: 15px; }
.order-btn { margin-top: auto; width: 100%; padding: 14px; background: #000; color: #fff; border: none; font-weight: 700; font-size: 11px; cursor: pointer; transition: 0.3s; text-transform: uppercase; }
.order-btn:hover { background: #ff0000; }

/* =========================
   7. FOOTER & BREAKPOINTS
========================= */
footer { text-align: center; padding: 50px 20px; background: #000; color: #fff; margin-top: auto; }
.designed-by { margin-top: 15px; font-size: 11px; color: #888; }
.designed-by a { color: #fff; font-weight: 700; }

@media (max-width: 1024px) { .product-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 850px) {
    header { padding: 10px 4%; }
    .logo img { height: 32px; }
    .nav-links { display: none; }
    .menu-toggle { display: block; }
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 15px; }
    .container { padding: 25px 4%; }
    .nav-arrow { display: none; } /* Disable arrows on mobile touch */
}
@media (max-width: 480px) {
    .p-name { font-size: 12px; min-height: 30px; }
    .price { font-size: 14px; }
    .order-btn { padding: 12px; font-size: 10px; }
    .size-btn { padding: 5px 8px; font-size: 11px; min-width: 38px; height: 30px; }
}

/* =========================
   9. CAROUSEL & STOCK UPGRADES
========================= */
.img-carousel {
    display: flex !important; overflow-x: auto !important; scroll-snap-type: x mandatory;
    width: 100%; scrollbar-width: none;
}
.img-carousel::-webkit-scrollbar { display: none; }
.img-carousel img { flex: 0 0 100% !important; scroll-snap-align: center; }

.badge {
    position: absolute; top: 10px; left: 10px; background: #ff0000; color: #fff;
    padding: 4px 8px; font-size: 10px; font-weight: 900; text-transform: uppercase; z-index: 10;
}
.out-of-stock-btn { background: #222 !important; color: #666 !important; cursor: not-allowed !important; pointer-events: none; }

/* =========================
   10. CAROUSEL ARROWS
========================= */
.nav-arrow {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9); color: #000; width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center; border-radius: 50%;
    cursor: pointer; z-index: 20; opacity: 0; transition: 0.3s; border: none; font-size: 12px;
}
.product-card:hover .nav-arrow { opacity: 1; }
.nav-arrow:hover { background: #000; color: #fff; }
.arrow-left { left: 10px; }
.arrow-right { right: 10px; }

/* =========================================
   11. ULTIMATE RESPONSIVE OVERRIDES
   ========================================= */

@media (max-width: 1100px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .grid-3, .content-layout { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    body { flex-direction: column; overflow-y: auto; height: auto; }
    
    /* Sidebar becomes a top-bar on mobile */
    .sidebar { 
        width: 100% !important; 
        height: auto; 
        flex-direction: row; 
        padding: 10px 20px; 
        justify-content: space-between; 
        position: sticky; 
        top: 0;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    .logo-box { margin-bottom: 0; width: 30px; height: 30px; font-size: 14px; }
    .sidebar nav { flex-direction: row; gap: 10px; width: auto; }
    .nav-item { margin-bottom: 0; width: auto; padding: 10px; }
    .nav-item span { display: none; } /* Icons only on mobile top-bar */
    .logout { margin-top: 0; }

    .main { padding: 20px; }
    .header h1 { font-size: 24px; }
    
    .stats-grid { grid-template-columns: 1fr; gap: 15px; }
    .stat-card { padding: 20px; }
    
    /* Tables on mobile */
    .main-panel { padding: 15px; }
    table { display: block; overflow-x: auto; white-space: nowrap; }
}

@media (max-width: 480px) {
    .header { flex-direction: column; align-items: flex-start; gap: 15px; }
    .stat-val { font-size: 22px; }
}