:root {
    /* Brand */
    --primary: #1a7f4b;
    --primary-dark: #145f39;
    --primary-light: #e6f7ef;
    --primary-soft: rgba(26, 127, 75, 0.08);
    --primary-strong: #0f5132;
    --primary-gradient: linear-gradient(135deg, #059669 0%, #1a7f4b 100%);
    --price-color: #0f5132;
    --secondary: #d97706;
    --danger: #dc2626;
    --info: #2563eb;

    /* Surfaces */
    --bg-page: #eef2f7;
    --bg-light: #f8fafc;
    --card-bg: #ffffff;
    --white: #ffffff;
    --img-bg: #e9eef4;

    /* Text */
    --text-main: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;

    /* Borders & shadows */
    --border-color: #e2e8f0;
    --border-strong: #cbd5e1;
    --shadow: rgba(15, 23, 42, 0.07);
    --shadow-md: rgba(15, 23, 42, 0.12);

    /* Misc */
    --glass: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.25);
    --radius: 12px;
    --accent: #f59e0b;
    --transition: all 0.2s ease;
    --max-width: 1200px;

    /* Badge tokens */
    --badge-top-bg: #d97706;
    --badge-top-color: #fff;
    --badge-urgent-bg: #dc2626;
    --badge-urgent-color: #fff;
}

.dark-theme,
[data-theme="dark"] {
    --primary: #22c55e;
    --primary-dark: #16a34a;
    --primary-light: rgba(34, 197, 94, 0.12);
    --primary-soft: rgba(34, 197, 94, 0.1);
    --primary-strong: #4ade80;
    --primary-gradient: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
    --price-color: #4ade80;
    --bg-page: #0d1117;
    --bg-light: #0d1117;
    --card-bg: #161b22;
    --white: #161b22;
    --img-bg: #1e242d;
    --text-main: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: #8b949e;
    --border-color: #30363d;
    --border-strong: #444c56;
    --shadow: rgba(0, 0, 0, 0.4);
    --shadow-md: rgba(0, 0, 0, 0.6);
    --glass: rgba(22, 27, 34, 0.9);
    --glass-border: rgba(255, 255, 255, 0.08);

    /* Badge tokens — slightly brighter in dark */
    --badge-top-bg: #b45309;
    --badge-top-color: #fff;
    --badge-urgent-bg: #b91c1c;
    --badge-urgent-color: #fff;
}

.mobile-only {
    display: block;
}

.desktop-only {
    display: none;
}

/* Splash Screen / Loader */
.app-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.app-loader.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loader-logo {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 20px;
    animation: pulse-logo 2s infinite ease-in-out;
}

.loader-logo span {
    color: var(--accent);
}

.loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse-logo {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.05);
        opacity: 1;
    }
}

/* Desktop layout foundation */
@media (min-width: 1024px) {
    body {
        display: flex;
        justify-content: center;
        padding-bottom: 0;
    }

    .nav-bar {
        display: none !important;
    }

    .main-container {
        width: 100%;
        max-width: var(--max-width);
        display: grid;
        grid-template-columns: 240px 1fr;
        gap: 30px;
        padding: 40px 20px;
        align-items: start;
    }

    @media (min-width: 1280px) {
        .main-container {
            grid-template-columns: 260px 1fr 300px;
        }
    }

    .feed-section {
        width: 100%;
        min-width: 0;
    }

    .main-header {
        border-radius: 20px;
        margin-bottom: 20px;
        top: 20px;
    }

    .ads-grid {
        grid-template-columns: repeat(3, 1fr);
        padding: 0;
    }

    .mobile-only {
        display: none !important;
    }

    .desktop-only {
        display: block !important;
    }

    /* Reels Desktop Layout */
    .reels-desktop-layout {
        background: #000;
        max-width: 100%;
        padding: 0;
        gap: 0;
        height: 100vh;
        overflow: hidden;
    }

    .reels-desktop-layout .desktop-sidebar {
        background: #111;
        border-right: 1px solid #222;
        border-radius: 0;
        height: 100vh;
        top: 0;
    }

    .chat-feed {
        display: flex !important;
        flex-direction: column !important;
        height: 100vh !important;
        background: var(--bg-light);
    }

    .chat-feed .messages-container {
        flex: 1;
        overflow-y: auto;
    }

    .chat-feed .input-container {
        padding-bottom: 25px !important;
    }

    .reels-feed {
        display: flex;
        justify-content: center;
        background: #000;
        height: 100vh;
    }

    .reels-container {
        width: 450px !important;
        /* Phone-sized container on desktop */
        border-left: 1px solid #222;
        border-right: 1px solid #222;
        box-shadow: 0 0 100px rgba(0, 0, 0, 1);
        height: 100vh !important;
        position: relative;
    }
}


* {
    box-sizing: border-box;
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-page, var(--bg-light));
    color: var(--text-main);
    padding-bottom: 90px;
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-weight: 400;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.main-header {
    background: var(--primary);
    padding: 12px 16px 20px 16px;
    /* Added bottom padding for better curve visibility */

    position: sticky;
    top: 0;
}

.top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    margin-bottom: 16px;
}

.location-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 14px;
    border-radius: 50px;
    cursor: pointer;
    backdrop-filter: blur(5px);
}

.logo {
    font-weight: 1000;
    font-size: 20px;
}

.logo span {
    color: rgb(241, 196, 15);
}

.search-wrapper {
    display: flex;
    gap: 8px;

}

.search-bar {
    background: var(--card-bg);
    flex: 1;
    display: flex;
    align-items: center;
    padding: 0 12px;
    border-radius: var(--radius);
    height: 48px;
}

.search-bar i {
    color: #95a5a6;
    font-size: 18px;
}

.search-bar input {
    border: none;
    padding: 0 10px;
    width: 100%;
    outline: none;
    font-size: 15px;
    background: transparent;
}

.filter-icon-btn {
    background: var(--card-bg);
    border: none;
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    color: var(--primary);
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.filter-icon-btn:active {
    transform: scale(0.9);
}


.filter-collapse.show {
    max-height: 500px;
    /* Increased to allow for subcategories */
    opacity: 1;
}

.filter-inner {
    background: var(--card-bg);
    margin-top: 15px;
    padding: 16px;
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.filter-group label {
    font-size: 12px;
    text-transform: uppercase;
    font-weight: 700;
    color: #7f8c8d;
    margin-bottom: 4px;
    display: block;
}

.filter-select {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1.5px solid #eee;
    font-size: 14px;
    background-color: #fdfdfd;
}

.btn-apply {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px;
    font-weight: 600;
    border-radius: 10px;
    margin-top: 5px;
    cursor: pointer;
}

/* Categories */
.section-title {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    align-items: center;
}

.section-title h3 {
    font-size: 18px;
}

.section-title a {
    color: var(--primary);
    text-decoration: none;
    font-size: 14px;
}

/* Umumiy havola stili */
.category-scroll a {
    text-decoration: none !important;
    /* Chiziqni majburan o'chirish */
    color: inherit;
    /* Rangni ota-onadan olish */
}

/* Fix: Category Section background should match the body or be distinct */
.category-section {
    padding: 20px 0 10px 0;
    background: var(--bg-light);
    /* Slightly off-white */
}

/* Scroll konteyneri */
.category-scroll {
    display: flex;
    overflow-x: auto;
    padding: 5px 16px;
    gap: 16px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

/* Scrollbar-ni yashirish (Chrome, Safari, Opera) */
.category-scroll::-webkit-scrollbar {
    display: none;
}

/* Asosiy havola (Link) stili */
.category-scroll a.cat-item {
    text-decoration: none !important;
    /* Chiziqni butunlay o'chirish */
    color: #2c3e50;
    /* Standart matn rangi */
    text-align: center;
    min-width: 75px;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.2s ease;
}

/* Bosilganda effekt */
.category-scroll a.cat-item:active {
    transform: scale(0.95);
}

/* Ikonka qutisi */
.icon-box {
    background: var(--card-bg);
    font-size: 24px;
    width: 60px;
    height: 60px;
    border-radius: 18px;
    box-shadow: 0 4px 10px var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    transition: all 0.2s ease;
    border: 1px solid var(--border-color);
}

.icon-box .cat-icon {
    font-size: 24px;
    line-height: 1;
}

/* Matn stili */
.cat-item p {
    font-size: 12px;
    font-weight: 600;
    margin: 0;
    padding: 0;
    text-decoration: none !important;
}

/* AKTIV HOLAT (Tanlangan kategoriya) */
.cat-item.active .icon-box {
    background: var(--primary);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.cat-item.active p {
    color: var(--primary);
    font-weight: 700;
}

/* Ads Grid */
.ads-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    padding: 0 14px 20px;
}

/* Card */
.ad-card {
    background: var(--card-bg);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 3px var(--shadow), 0 4px 12px var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    height: 100%;
}

.ad-card:active {
    transform: scale(0.97);
    box-shadow: 0 2px 6px var(--shadow);
}

.image-container {
    position: relative;
    height: 140px;
    background: var(--img-bg);
    overflow: hidden;
}

/* Negotiable badge */
.handshake {
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 26px;
    padding: 3px;
    background: rgba(255, 255, 255, 0.9);
    color: #10B981;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 5;
}

.image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.ad-card:hover .image-container img {
    transform: scale(1.08);
}

/* Badge stack — flex column inside image, auto-stacks any combo of badges */
.badge-stack {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 4px;
    pointer-events: none;
}

/* Shared badge base */
.badge-urgent {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 7px 2px 5px;
    border-radius: 999px;
    font-size: 9.5px;
    font-weight: 800;
    line-height: 1.5;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    box-shadow: 0 1px 3px rgba(0,0,0,0.18);
    width: fit-content;
    backdrop-filter: blur(4px);
}

.badge-urgent {
    background: rgba(220, 38, 38, 0.88);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.18);
}

/* Per-type card highlights */
.ad-card.is-top {
    border-color: rgba(217, 119, 6, 0.45);
    box-shadow: 0 0 0 1.5px rgba(217,119,6,0.18), 0 2px 8px rgba(217,119,6,0.14);
}
.ad-card.is-urgent {
    border-color: rgba(220, 38, 38, 0.35);
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.10), 0 1px 3px rgba(0,0,0,0.06);
}
/* Like Button */
.like-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(4px);
}

.like-btn i {
    font-size: 18px;
}

.like-btn.liked {
    background: white;
    color: #ef4444;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Details */
.ad-details {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-grow: 1;
}

.price {
    color: var(--price-color) !important; /* Theme-aware high contrast green */
    font-size: 19px !important;
    font-weight: 900 !important;
    margin-bottom: 2px;
    display: flex;
    align-items: baseline;
    gap: 4px;
    letter-spacing: -0.5px; /* Modern tight look */
}

.price .currency {
    font-size: 11px !important;
    font-weight: 700 !important;
    color: var(--text-muted) !important;
    text-transform: uppercase !important;
    opacity: 0.9 !important;
}

.title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.4;
    height: 20px !important; /* Forces 1 line height */
    overflow: hidden !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 1 !important; /* Specifically only 1 line */
    line-clamp: 1 !important;
    -webkit-box-orient: vertical !important;
    margin-bottom: 8px;
}

.breed {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
}

/* Meta */
.meta {
    margin-top: auto;
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-top: 8px;
    border-top: 1px solid color-mix(in srgb, var(--border-color), transparent 50%);
}

.meta span {
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

.meta i {
    font-size: 14px;
    opacity: 0.8;
}

/* =========================================================================================== */

/* Details Page Specifics */
.details-page {
    background: white;
}

.details-header {
    position: absolute;
    top: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 15px;
    z-index: 10;
}

.details-header button {
    background: rgba(0, 0, 0, 0.4);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    backdrop-filter: blur(5px);
}

.image-gallery {
    width: 100%;
    height: 350px;
    position: relative;
    background: #eee;
}

.image-gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-count {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
}

.details-content {
    padding: 20px;
}

.price-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.main-price {
    color: var(--primary);
    font-size: 24px;
    font-weight: 900;
}

.negotiable {
    color: var(--secondary);
    font-weight: 600;
    font-size: 14px;
}

.ad-title {
    font-size: 18px;
    line-height: 1.4;
    margin-bottom: 10px;
}

.location-date {
    color: var(--text-muted);
    font-size: 13px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.divider {
    border: none;
    border-top: 1px solid #f0f0f0;
    margin: 20px 0;
}

.specs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.spec-item {
    display: flex;
    flex-direction: column;
}

.spec-item .label {
    font-size: 12px;
    color: var(--text-muted);
}

.spec-item .value {
    font-size: 15px;
    font-weight: 600;
}

.description p {
    line-height: 1.6;
    color: #555;
    margin-top: 10px;
}

.seller-card {
    background: var(--bg-light);
    padding: 15px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 25px;
}

.seller-info {
    display: flex;
    gap: 12px;
    align-items: center;
}

.avatar {
    width: 45px;
    height: 45px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
}


/* =================================================================================================== */

.simple-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.simple-header h2 {
    font-size: 18px;
    font-weight: 700;
}

.simple-header button {
    background: none;
    border: none;
    font-size: 24px;
}

.post-form {
    padding: 20px;
}

.upload-section {
    margin-bottom: 25px;
}

.upload-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.upload-box {
    border: 2px dashed #ddd;
    border-radius: 15px;
    height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--text-muted);
}

.video-box {
    border-color: var(--primary);
    color: var(--primary);
    background: #e8f5e9;
}

.upload-box i {
    font-size: 32px;
}

.upload-box span {
    font-size: 13px;
    font-weight: 600;
}

.upload-hint {
    font-size: 12px;
    color: #e67e22;
    margin-top: 10px;
    font-weight: 500;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #444;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px;
    border: 1px solid #ddd;
    border-radius: 12px;
    font-size: 16px;
    /* Prevents iOS zoom-in on focus */
    outline: none;
}

.form-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 10px;
    align-items: center;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    margin-top: 5px;
}

.submit-btn {
    width: 100%;
    background: var(--primary);
    color: white;
    border: none;
    padding: 18px;
    border-radius: 15px;
    font-size: 18px;
    font-weight: 800;
    box-shadow: 0 5px 15px rgba(39, 174, 96, 0.3);
}

/* ==================================================================== */
/* --- ASOSIY NAVIGATSIYA PANELI (PASTKI) --- */
.nav-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    /* Balandlikni oshirdik (Kattalar uchun qulay) */
    height: 66px;
    background: rgba(18, 18, 18, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    justify-content: space-around;
    align-items: center;
    /* Elementlarni markazlash */
    padding-bottom: env(safe-area-inset-bottom);
    /* iPhone-lar uchun xavfsiz joy */
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    z-index: 2000;
    transition: transform 0.3s ease-in-out;
}

.nav-bar.hide {
    transform: translateY(100%);
}

/* Har bir menyu tugmasi */
.nav-item {
    color: #a0a0a0;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    transition: color 0.2s ease-in-out, transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
    -webkit-tap-highlight-color: transparent;
}

/* Click / tap press effect */
.nav-item:active {
    transform: scale(0.82);
    color: #08c42e;
}

/* Aktiv holatdagi tugma */
.nav-item.active {
    color: #08c42e;
}

/* Ikonkalar */
.nav-item i {
    font-size: 26px;
    margin-bottom: 2px;
    transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-item:active i {
    transform: scale(0.85);
}

/* Tugma ostidagi yozuvlar */
.nav-item span {
    font-size: 11px;
    font-weight: 800;
    text-transform: none;
    letter-spacing: 0.3px;
}

/* --- MARKAZIY "SOTISH" TUGMASI (KATTALASHTIRILGAN) --- */
.nav-main-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: -38px;
    /* Yuqoriga ko'tarish darajasi */
    z-index: 2001;
    flex: 1.2;
    /* Markaziy tugma uchun ko'proq joy */
}

.nav-main-btn {
    width: 58px;
    height: 58px;
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 32px;
    /* Plus belgisi kattaroq */
    border: 4px solid #000;
    /* Qalinroq chegara - fondan ajratadi */
    box-shadow: 0 10px 25px rgba(46, 204, 113, 0.5);
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.nav-main-btn:active {
    transform: scale(0.9);
}

.nav-main-label {
    font-size: 12px;
    /* Kattaroq yozuv */
    font-weight: 900;
    margin-top: 6px;
    color: #2ecc71;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.8);
}

/* --- QUICK MENU --- */
body.quick-menu-open {
    overflow: hidden;
}

.quick-menu-overlay {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(1000px 460px at 50% 115%, rgba(46, 204, 113, 0.24), transparent 55%),
        rgba(3, 8, 18, 0.52);
    backdrop-filter: blur(10px) saturate(120%);
    -webkit-backdrop-filter: blur(10px) saturate(120%);
    display: none;
    z-index: 2100;
    align-items: flex-end;
    justify-content: center;
    padding: 10px 12px calc(108px + env(safe-area-inset-bottom));
}

.quick-menu-overlay.active {
    display: flex;
}

.quick-menu-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    z-index: 1;
}

.quick-menu-items {
    display: grid;
    width: min(100%, 460px);
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0 0 0;
}

.q-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.20);
    border-radius: 18px;
    padding: 14px 10px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    transform: translateY(12px);
    opacity: 0;
    transition: transform .22s ease, opacity .22s ease, border-color .2s ease, background .2s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.26);
}

.quick-menu-overlay.active .q-item {
    transform: translateY(0);
    opacity: 1;
}

.q-item:hover,
.q-item:active {
    border-color: rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.20);
}

.q-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 22px;
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    box-shadow: 0 10px 24px rgba(39, 174, 96, 0.3);
    flex-shrink: 0;
}

.q-item-reel .q-icon {
    background: linear-gradient(135deg, #7c5cff, #5a3ff0);
    box-shadow: 0 10px 24px rgba(90, 63, 240, 0.3);
}

.q-content {
    min-width: 0;
    flex: 0;
    text-align: center;
}

.q-title {
    display: block;
    font-size: 13px;
    font-weight: 900;
    color: #fff;
    line-height: 1.25;
}

.q-arrow {
    display: none;
}

#plus-icon {
    transition: transform 0.3s ease;
}

.nav-main-btn {
    border: 6px solid var(--card-bg);
    cursor: pointer;
    outline: none;
}

/* --- Bottom Navigation Badge --- */
.icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dot-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    background: #FF416C;
    border-radius: 50%;
    border: 2px solid #000; /* Contrast with dark background */
    box-shadow: 0 0 10px rgba(255, 65, 108, 0.4);
    animation: dot-pulse 2s infinite;
}

@keyframes dot-pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 65, 108, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 10px rgba(255, 65, 108, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 65, 108, 0); }
}

.nav-item:active .icon-wrapper i {
    transform: scale(0.85);
}


/* ============================================================
   DESKTOP IMPROVEMENTS  ≥1024 px
   ============================================================ */
@media (min-width: 1024px) {

    /* --- Global typography --------------------------------- */
    *,
    body {
        font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif !important;
    }

    /* --- Page background / column stacking --------------- */
    body {
        flex-direction: column;
        background: var(--bg-page, #eef2f7) !important;
    }

    body.dark-theme,
    body[data-theme="dark"] {
        background: #0d1117 !important;
    }

    /* --- Layout ------------------------------------------- */
    .main-container {
        max-width: 1440px;
        width: 100%;
        margin: 0 auto;
        grid-template-columns: 270px 1fr;
        gap: 24px;
        padding: 24px 28px 48px;
        align-items: start;
    }

    /* --- Desktop header: card style (not green blob) ------ */
    .main-header {
        background: var(--card-bg) !important;
        border: 1px solid var(--border-color) !important;
        box-shadow: 0 2px 16px var(--shadow) !important;
        padding: 14px 20px 14px !important;
        top: 24px !important;
        border-radius: 20px !important;
        margin-bottom: 18px !important;
    }

    .top-row {
        color: var(--text-main) !important;
        margin-bottom: 12px;
    }

    .location-trigger {
        background: var(--bg-light) !important;
        color: var(--text-main) !important;
        border: 1px solid var(--border-color);
        font-size: 13px;
    }

    .logo {
        color: var(--primary) !important;
        letter-spacing: -0.5px;
    }

    .logo span {
        color: var(--accent) !important;
    }

    .notif-link {
        color: var(--text-main);
    }

    /* Override notification icon from white-on-green → dark-on-white */
    .notif-icon {
        background: var(--bg-light) !important;
        border: 1.5px solid var(--border-color) !important;
    }

    .notif-icon i {
        color: var(--text-main) !important;
    }

    .notif-link:hover .notif-icon {
        border-color: var(--primary) !important;
        background: rgba(5, 150, 105, 0.08) !important;
    }

    /* --- Search bar --------------------------------------- */
    .search-bar {
        border: 1.5px solid var(--border-color) !important;
        background: var(--bg-light) !important;
        height: 46px;
        border-radius: 14px;
        transition: border-color 0.2s, box-shadow 0.2s;
    }

    .search-bar:focus-within {
        border-color: var(--primary) !important;
        box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.1);
    }

    .search-bar input {
        color: var(--text-main);
        background: transparent;
        font-size: 15px;
    }

    .search-bar i {
        color: var(--text-muted);
    }

    .filter-icon-btn {
        height: 46px;
        width: 46px;
        border: 1.5px solid var(--border-color) !important;
        background: var(--bg-light) !important;
        border-radius: 14px !important;
        color: var(--primary) !important;
        transition: border-color 0.2s, background 0.2s;
    }

    .filter-icon-btn:hover {
        border-color: var(--primary) !important;
        background: rgba(5, 150, 105, 0.07) !important;
    }

    /* --- Category section: wrap grid on desktop ----------- */
    .category-section {
        background: transparent !important;
        padding: 0 0 18px !important;
    }

    .category-scroll {
        flex-wrap: wrap !important;
        overflow-x: visible !important;
        gap: 10px 12px !important;
        padding: 0 !important;
    }

    .cat-item {
        min-width: unset !important;
        transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    }

    .cat-item:hover .icon-box {
        transform: translateY(-3px);
        box-shadow: 0 8px 20px var(--shadow) !important;
        border-color: var(--primary) !important;
    }

    .icon-box {
        width: 56px !important;
        height: 56px !important;
        border-radius: 16px !important;
        font-size: 22px !important;
    }

    .cat-item p {
        font-size: 11px !important;
        font-weight: 600 !important;
    }

    /* --- Ad grid ------------------------------------------ */
    .ads-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 18px;
        padding: 0;
    }

    /* --- Ad cards: taller, better hover ------------------- */
    .image-container {
        height: 185px;
    }

    .ad-card {
        border-radius: 18px;
        transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1),
                    box-shadow 0.22s cubic-bezier(0.4, 0, 0.2, 1),
                    border-color 0.22s ease;
        cursor: pointer;
    }

    .ad-card:hover {
        transform: translateY(-6px);
        box-shadow: 0 20px 44px rgba(0, 0, 0, 0.13), 0 4px 12px rgba(0, 0, 0, 0.06) !important;
        border-color: rgba(5, 150, 105, 0.25) !important;
    }

    .ad-card:active {
        transform: translateY(-2px) !important;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1) !important;
    }

    .ad-card:hover .image-container img {
        transform: scale(1.05) !important;
    }

    .ad-details {
        padding: 14px 16px 16px;
        gap: 5px;
    }

    .price {
        font-size: 20px !important;
        margin-bottom: 3px;
    }

    .title {
        font-size: 13px;
        margin-bottom: 6px;
    }

    .meta {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px 14px;
        font-size: 11px;
        padding-top: 10px;
    }

    /* Like button: larger target on desktop */
    .like-btn {
        width: 36px;
        height: 36px;
    }

    .like-btn:hover {
        background: rgba(255, 255, 255, 0.9) !important;
        color: #ef4444 !important;
        transform: scale(1.1);
    }

    /* --- Feed section ------------------------------------- */
    .feed-section {
        min-width: 0;
        width: 100%;
    }

    /* --- Mobile-only elements hidden ---------------------- */
    .mobile-only {
        display: none !important;
    }

    .desktop-only {
        display: block !important;
    }

    /* ── Desktop header: single-row layout ─────────────────
       [Location]  [Search ──────────────]  [Filter]  [Bell]
       ───────────────────────────────────────────────────── */
    .main-header .header-content {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    /* Flatten top-row children into the flex row */
    .main-header .top-row {
        display: contents;
    }

    /* Logo is redundant — sidebar already has it */
    .main-header .logo {
        display: none !important;
    }

    /* Ordering: location(1) → search(2) → bell(3) */
    .main-header .location-trigger {
        order: 1;
        flex-shrink: 0;
        border-radius: 12px;
        padding: 10px 14px;
        font-size: 13px;
        font-weight: 600;
        white-space: nowrap;
        max-width: 160px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .main-header .search-wrapper {
        order: 2;
        flex: 1;
        min-width: 0;
        margin: 0 !important;
    }

    .main-header .notif-link {
        order: 3;
        flex-shrink: 0;
    }

    .main-header .notif-icon {
        width: 40px !important;
        height: 40px !important;
        border-radius: 12px !important;
    }

    /* Filter dropdown: rounded corners, max-width matches header */
    .filter-collapse {
        border-radius: 20px !important;
        border-top-left-radius: 20px !important;
        border-top-right-radius: 20px !important;
        top: calc(100% + 8px) !important;
        padding: 20px 24px 24px !important;
        max-height: 80vh !important;
    }

    .btn-apply {
        border-radius: 12px !important;
        font-size: 15px !important;
        padding: 14px 20px !important;
    }

}


/* --- Extra wide (1280 px): show right sidebar ------------- */
@media (min-width: 1280px) {
    .main-container {
        grid-template-columns: 270px 1fr 300px;
        max-width: 1600px;
    }
}

/* --- Very wide (1480 px): 4-col ad grid ------------------- */
@media (min-width: 1480px) {
    .main-container {
        padding: 28px 40px 56px;
    }

    .ads-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }

    .image-container {
        height: 200px;
    }
}

