@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --primary: #0088cc; /* OSMON RANG */
    --dark: #222222;
    --bg: #ffffff;
    --gray-bg: #f4f5f7;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }
body { background: var(--bg); color: #111; padding-bottom: 70px; overflow-x: hidden; }
a { text-decoration: none; color: inherit; }

/* Konteyner */
.container { max-width: 1200px; margin: 0 auto; padding: 0 15px; width: 100%; box-sizing: border-box; }

/* HEADER */
.app-download-banner { display: none; }
.top-bar { background: var(--primary); color: white; padding: 12px 0; font-weight: 500; }
.logo { font-size: 22px; font-weight: 700; }
.main-header { padding: 15px 0; border-bottom: 1px solid #e0e0e0; background: white; }
.header-flex { display: flex; align-items: center; gap: 20px; width: 100%; }
.mobile-menu-btn { display: none; }
.btn-cat { background: var(--primary); color: white; border: none; padding: 12px 20px; border-radius: 8px; font-weight: 600; font-size: 14px; cursor: pointer; display: flex; align-items: center; gap: 10px; }
.search-bar { flex-grow: 1; display: flex; background: var(--gray-bg); border-radius: 8px; overflow: hidden; height: 44px; width: 100%; }
.search-bar input { width: 100%; border: none; background: transparent; padding: 0 15px; outline: none; font-size: 15px; }
.search-bar button { background: var(--primary); border: none; color: white; padding: 0 20px; cursor: pointer; }
.header-actions { display: flex; gap: 25px; align-items: center; }
.action-item { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; color: #666; cursor: pointer; }
.action-item i { font-size: 20px; color: #333; }
.btn-sell { background: var(--dark); color: white; border: none; padding: 12px 20px; border-radius: 8px; font-weight: 600; font-size: 14px; cursor: pointer; }

/* MAIN CONTENT (Kompyuter versiyasi uchun) */
.section-title { font-size: 24px; font-weight: 700; margin: 30px 0 20px; }

/* Kategoriya Wrapperi (Yangi tizim) */
.categories-wrapper { margin-bottom: 40px; display: flex; flex-direction: column; gap: 12px; }
.cat-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.cat-item { background: var(--gray-bg); border-radius: 12px; padding: 12px; height: 65px; display: flex; align-items: center; justify-content: space-between; position: relative; overflow: hidden; color: #111; font-weight: 500; font-size: 13px; box-sizing: border-box; }
.cat-item i { font-size: 35px; color: #cbd5e1; position: absolute; right: 8px; bottom: -5px; opacity: 0.4; z-index: 1; }
.cat-item-all { background: var(--gray-bg); border-radius: 12px; height: 65px; display: flex; align-items: center; justify-content: center; text-decoration: none; color: #111; font-weight: 500; font-size: 13px; }

.banners { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 15px; margin-bottom: 40px; }
.banner-item { height: 140px; border-radius: 16px; padding: 20px; position: relative; overflow:hidden; box-sizing: border-box; }

.ads-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 15px; margin-bottom: 40px; width: 100%; box-sizing: border-box; }
.ad-card { cursor: pointer; width: 100%; overflow: hidden; }
.ad-img { width: 100%; height: 210px; background: #f1f5f9; border-radius: 12px; margin-bottom: 10px; position: relative; overflow: hidden; }

/* FOOTER */
.regions-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; margin-bottom: 40px; }
.footer-bottom { border-top: 1px solid #e0e0e0; padding: 30px 0; display: flex; justify-content: space-between; align-items: center; }
.footer-links { display: flex; gap: 20px; font-size: 14px; }
.apps { display: flex; gap: 10px; }

/* BOTTOM MENU */
.bottom-menu { display: none; position: fixed; bottom: 0; left: 0; width: 100%; background: white; border-top: 1px solid #e0e0e0; z-index: 999; padding: 10px 0; justify-content: space-around; align-items: center; }
.b-menu-item { display: flex; flex-direction: column; align-items: center; font-size: 10px; color: #666; gap: 4px; }
.b-menu-item i { font-size: 20px; }
.b-menu-item.active { color: var(--primary); } 
.b-menu-add { background: var(--dark); color: white; width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px; margin-bottom: 2px; }

/* =========================================
   MOBIL ADAPTATSIYA (Xato oraliqlar 1x1 to'g'rilandi)
   ========================================= */
@media (max-width: 768px) {
    .app-download-banner { display: flex; justify-content: space-between; padding: 10px 15px; border-bottom: 1px solid #e0e0e0; }
    .btn-download { background: var(--primary); color: white; border: none; padding: 8px 15px; border-radius: 6px; font-weight: 600; font-size: 12px; }
    
    .top-bar .logo { display: block; font-size: 18px; }
    .top-bar .top-right { width: auto; justify-content: flex-end; }
    .top-bar .top-right span:last-child { display: none; }

    .header-flex { gap: 12px; }
    .main-header .btn-cat, .main-header .header-actions { display: none; }
    
    .mobile-menu-btn { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; background: var(--gray-bg); border: none; border-radius: 8px; font-size: 20px; color: #111; flex-shrink: 0; }
    .search-bar button { display: none; }

    /* =================================================== */
    /* 1. KATEGORIYALAR (MUSTAQIL, IPDEK TEKIS ORALIQLAR)  */
    /* =================================================== */
    .categories-wrapper { 
        display: flex !important; 
        flex-direction: column !important; 
        gap: 6px !important; /* Qatorlar orasidagi masofa */
        overflow-x: auto !important; 
        -webkit-overflow-scrolling: touch !important; 
        padding-bottom: 10px; 
        margin-bottom: 15px; 
    }
    .categories-wrapper::-webkit-scrollbar { display: none; }
    
    .cat-row { 
        display: flex !important; 
        gap: 6px !important; /* Elementlar orasidagi QAT'IY masofa */
        width: max-content !important; 
    }

    .cat-item { 
        width: max-content !important; 
        height: 36px !important; 
        padding: 0 10px 0 6px !important; 
        border-radius: 8px; 
        display: flex !important;
        align-items: center;
        justify-content: flex-start;
        gap: 6px !important; 
        background: var(--gray-bg);
    }
    .cat-item span { 
        font-size: 11px !important; 
        white-space: nowrap !important; 
        order: 2; 
    }
    .cat-item i { 
        font-size: 16px !important; 
        opacity: 1; 
        order: 1; 
        color: #94a3b8;
        position: static !important;
        margin: 0 !important;
    }
    
    .cat-item-all {
        width: max-content;
        height: 36px !important;
        padding: 0 12px;
        border-radius: 8px;
        font-size: 11px;
        display: flex;
        align-items: center;
        justify-content: center;
        white-space: nowrap;
        background: var(--gray-bg);
    }

    /* =================================================== */
    /* 2. BANNERLAR                                        */
    /* =================================================== */
    .banners { 
        display: flex; 
        overflow-x: auto; 
        scroll-snap-type: x mandatory; 
        -webkit-overflow-scrolling: touch;
        gap: 12px; 
        padding-bottom: 5px; 
        margin-bottom: 25px; 
    }
    .banners::-webkit-scrollbar { display: none; }
    .banner-item { 
        min-width: 88vw; 
        height: 140px; 
        scroll-snap-align: center; 
        flex-shrink: 0; 
    }
    .banner-item:first-child { background-color: var(--primary) !important; }
    .slider-controls { display: none !important; }

    /* =================================================== */
    /* 3. E'LONLAR KARTASI                                 */
    /* =================================================== */
    .section-title { font-size: 18px; margin: 20px 0 15px; }
    .ads-grid { 
        grid-template-columns: repeat(2, 1fr); 
        gap: 10px; 
        width: 100%; 
    }
    .ad-img { height: 140px; } 
    .ad-price { font-size: 14px !important; }
    .ad-title { font-size: 12px !important; }

    .regions-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .footer-bottom { flex-direction: column; align-items: flex-start; gap: 20px; }
    .footer-links { flex-wrap: wrap; gap: 15px; }
    .apps { flex-direction: column; width: 100%; }
    .apps > div { justify-content: center; width: 100%; }

    .bottom-menu { display: flex; }
}