/* ============================================
   SAVEUZ - Asosiy CSS Fayl
   ============================================ */

/* CSS O'zgaruvchilar */
:root {
    --primary: #FF7D33;
    /* Orange from image */
    --primary-hover: #E66A20;
    --bg-color: #F8F9FB;
    /* Light grayish background */
    --text-main: #1A1A1A;
    --text-muted: #8E8E93;
    --border-color: #E5E5EA;
    --bg-light: #FFFFFF;
    --bg-gray: #F2F2F7;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --header-height: 70px;
}

/* Reset va Asosiy Stillar */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
}


/* ============================================
   HEADER STILLARI (Uzum Style)
   ============================================ */

/* Top Header */
.top-header {
    background-color: #F4F5F5;
    height: 36px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
}

.top-header-content {
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.top-left,
.top-right {
    display: flex;
    align-items: center;
    gap: 20px;
}


.location-selector {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: var(--text-main);
}

.location-selector:hover {
    color: var(--primary);
}

.top-link {
    text-decoration: none;
    color: var(--text-muted);
    transition: color 0.2s;
}

.top-link:hover {
    color: var(--primary);
}

.lang-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    margin-left: 10px;
}

.lang-option {
    color: var(--text-muted);
    font-weight: 500;
}

.lang-option.active {
    color: var(--text-main);
    font-weight: 700;
}

.lang-divider {
    color: #ccc;
}

/* Location Dropdown */
.location-selector {
    position: relative;
    padding: 8px 0;
}

.location-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    width: 200px;
    z-index: 1100;
    display: none;
    padding: 10px 0;
    margin-top: 5px;
}

.location-dropdown.active {
    display: block;
    animation: slideDown 0.2s ease;
}

/* Location Hint Tooltip */
.location-hint {
    position: absolute;
    top: calc(100% + 15px);
    left: 0;
    background: var(--primary);
    color: white;
    padding: 8px 15px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(224, 49, 55, 0.3);
    z-index: 1200;
    display: none;
    pointer-events: none;
    animation: floatHint 2s infinite ease-in-out;
}

.location-hint.active {
    display: block;
}

.location-hint-arrow {
    position: absolute;
    top: -6px;
    left: 15px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid var(--primary);
}

@keyframes floatHint {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-5px);
    }
}

.location-item {
    padding: 8px 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.location-item:hover {
    background: var(--bg-gray);
    color: var(--primary);
}

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

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: white;
    width: 100%;
    max-width: 500px;
    border-radius: var(--radius-xl);
    padding: 40px;
    position: relative;
    box-shadow: var(--shadow-lg);
    display: none;
    animation: modalIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-content.active {
    display: block;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-header h2 {
    margin-bottom: 15px;
}

.benefits-list {
    list-style: none;
    margin: 20px 0;
}

.benefits-list li {
    padding: 8px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.benefits-list li::before {
    content: '✓';
    color: var(--primary);
    font-weight: 700;
}

.app-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.app-store-btn img {
    height: 40px;
}

header {
    background: #FFFFFF;
    padding: 0;
    display: block;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 70px;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    width: 100%;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 110px;
    /* Fine-tuned gap to move catalog slightly left */
}

.logo {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.auth-logo {
    height: 60px;
    width: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.logo-icon {
    background: var(--primary);
    color: white;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 1.2rem;
}

.btn-download-app {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #7000ff;
    /* Uzum Purple */
    color: white !important;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    height: 40px;
    box-shadow: 0 4px 10px rgba(112, 0, 255, 0.15);
}

.btn-download-app:hover {
    background: #5d00d6;
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(112, 0, 255, 0.25);
}

.btn-download-app svg {
    stroke: white;
}

.btn-catalog {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 125, 51, 0.1);
    color: var(--primary);
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    height: 40px;
    position: relative;
    overflow: hidden;
    margin-right: 20px;
}

.btn-catalog:hover,
.btn-catalog.active {
    background: rgba(255, 125, 51, 0.2);
}

.delivery-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-left: auto;
    /* Push to right on mobile if container is flex */
}

.location-current-wrap {
    display: flex;
    align-items: center;
    gap: 5px;
}

.chevron-down {
    color: var(--text-muted);
}

.catalog-icon-wrapper {
    position: relative;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-default,
.icon-active {
    position: absolute;
    top: 0;
    left: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Default State */
.icon-default {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.icon-active {
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
}

/* Active State */
.btn-catalog.active .icon-default {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}

.btn-catalog.active .icon-active {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.header-center {
    flex: 1;
    max-width: 700px;
}

/* Categories Page Custom Header */
.categories-header {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 40px;
}

.market-promo-card {
    background: #F4F5F5;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 800px;
    height: 150px;
    padding: 25px;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    transition: all 0.2s ease;
    border: none;
}

.market-promo-card:hover {
    background: #EBECEC;
    transform: translateY(-2px);
}

.market-promo-title {
    color: var(--text-main);
    font-size: 1.1rem;
    font-weight: 500;
}

.market-promo-bottom {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.market-promo-count {
    color: var(--primary);
    font-weight: 600;
    font-size: 1rem;
}

.market-promo-arrow {
    width: 36px;
    height: 36px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.4rem;
    transition: all 0.2s ease;
}

.market-promo-card:hover .market-promo-arrow {
    transform: translateX(3px);
}

/* Market Sections */
.market-row {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    gap: 15px;
    padding-bottom: 10px;
    -webkit-overflow-scrolling: touch;
    /* For smooth scrolling on iOS */
}

/* Hide scrollbar for cleaner look */
.market-row::-webkit-scrollbar {
    display: none;
}

/* Market / Brand Card Styling */
.brand-card {
    text-decoration: none;
    background: #ffffff;
    border: none;
    border-radius: 16px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    padding-bottom: 60px;
    /* Added to make space for button */
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    min-height: 220px;
    justify-content: flex-start;
    /* Changed from space-between */
    gap: 8px;
    /* Added gap */
    position: relative;
    /* Added for absolute button */
}

.brand-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.brand-image {
    width: 100%;
    aspect-ratio: 3 / 2;
    /* Shallower rectangle instead of square */
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    /* Removed #f1f3f5 to match category cards */
    border-radius: 12px;
    overflow: hidden;
    padding: 0;
    /* No padding to let image fill the square */
    margin-bottom: 8px;
    /* Reduced from 12px */
}

.brand-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Fill the square block like in reference */
}

.brand-card:hover .brand-image img {
    transform: scale(1.1);
}

.brand-info {
    padding: 0;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 15px;
    flex: 1;
}

.brand-name {
    font-weight: 700;
    font-size: 1rem;
    /* Reduced from 1.15rem */
    color: var(--text-main);
    line-height: 1.2;
    margin-bottom: 2px;
}

.brand-desc {
    font-size: 0.8rem;
    /* Reduced from 0.85rem */
    color: var(--text-muted);
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.brand-action {
    display: none !important;
}

.brand-card:hover .brand-action {
    background: #f8f9fa;
    border-color: var(--primary);
    color: var(--primary);
}

/* Strelka animatsiyasi */
.brand-card:hover .brand-action svg {
    transform: translateX(5px);
}

.brand-card:hover .brand-action svg line {
    stroke-dasharray: 20;
    stroke-dashoffset: 0;
    transform: scaleX(1.4);
    transform-origin: right;
    transition: all 0.3s ease;
}

.catalog-chevron {
    display: none;
    /* Chevronni yashiramiz */
}

.brand-divider {
    width: 100%;
    height: 1px;
    background-color: #f0f0f0;
    margin: 5px 0;
}

@media (max-width: 768px) {
    .brand-divider {
        display: none !important;
    }
}

.brand-action svg {
    transition: transform 0.3s ease;
}

.brand-action svg line {
    transition: all 0.3s ease;
}

.brand-hours {
    display: block;
    /* Show info again */
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Desktop styles for markets */
@media (min-width: 992px) {
    .market-row {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        /* Increased to 5 to make cards smaller */
        gap: 15px;
        overflow: visible;
        padding: 5px;
    }

    .brand-card {
        width: auto;
        min-width: 0;
    }

    /* Faqat 1 qator ko'rsatish (5 ta) - faqat asosiy sahifadagi market-row uchun */
    .market-row .brand-card:nth-child(n+6) {
        display: none;
    }
}


@media (max-width: 992px) {
    .market-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .market-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .categories-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .market-promo-card {
        width: 100%;
    }
}

.search-main {
    flex: 1;
    max-width: 600px;
    display: flex;
    background: #F2F4F7;
    border-radius: 12px;
    overflow: visible;
    /* Important: allow dropdown to show */
    height: 48px;
    border: 1px solid transparent;
    position: relative;
    transition: all 0.2s ease;
}

.search-main:focus-within {
    background: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(255, 125, 51, 0.1);
}

.search-main input {
    flex: 1;
    border: none;
    padding: 0 20px;
    font-size: 0.95rem;
    outline: none;
    color: var(--text-main);
    border-bottom-left-radius: 12px;
    border-top-left-radius: 12px;
}

.search-main input::placeholder {
    color: var(--text-muted);
}

.search-main button {
    border: none;
    background: #F4F4F4;
    width: 60px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all 0.2s ease;
    border-left: 1px solid var(--border-color);
    border-bottom-right-radius: 12px;
    border-top-right-radius: 12px;
}

.search-main button:hover {
    background: #EBEBEB;
    color: var(--text-main);
}

#mobileBackBtn {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 44px;
    border: none;
    background: transparent;
    padding: 0 5px;
    color: var(--text-main);
    cursor: pointer;
    flex-shrink: 0;
}

.header-action-icon {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #E03137;
    /* Uzum Red */
    color: white !important;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    z-index: 10;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 25px;
}

.header-action {
    display: flex;
    flex-direction: row;
    align-items: center;
    text-decoration: none;
    color: var(--text-main);
    font-size: 1rem;
    font-weight: 500;
    gap: 8px;
    transition: color 0.2s ease;
}

.header-action svg {
    color: var(--text-main);
    transition: color 0.2s ease;
}

.header-action:hover {
    color: var(--primary);
}

.header-action:hover svg {
    color: var(--primary);
}

/* Eski classlarni o'chirish yoki yashirish */
.mobile-menu-btn,
.nav-links,
.search-mini {
    display: none;
}

/* ============================================
   MAIN CONTENT
   ============================================ */

main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Umumiy section */
section {
    padding: 25px 0;
    width: 100%;
    position: relative;
}

.search-results-title {
    font-size: 1.5rem;
}

/* ============================================
   FOOTER
   ============================================ */

footer {
    background: #f4f5f5;
    border-top: 1px solid #e5e5e5;
    color: var(--text-main);
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 20px;
}

h2 {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.3;
}

h3 {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.4;
}

.text-primary {
    color: var(--primary);
}

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

/* ============================================
   UTILITY CLASSES
   ============================================ */

.container {
    width: 100%;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
    padding-bottom: 10px;
}

.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.mt-lg {
    margin-top: 30px;
}

.mt-xl {
    margin-top: 60px;
}

.mt-xxl {
    margin-top: 100px;
}

.text-center {
    text-align: center;
}

.mb-lg {
    margin-bottom: 30px;
}

.gap-sm {
    gap: 10px;
}

.gap-md {
    gap: 20px;
}

.gap-lg {
    gap: 30px;
}

.mt-sm {
    margin-top: 10px;
}

.mt-md {
    margin-top: 20px;
}

.mt-lg {
    margin-top: 40px;
}

.mb-sm {
    margin-bottom: 10px;
}

.mb-md {
    margin-bottom: 20px;
}

.mb-lg {
    margin-bottom: 40px;
}

/* ============================================
   CATALOG DROPDOWN
   ============================================ */

.catalog-dropdown {
    position: fixed;
    top: 106px;
    /* Matched to 70px header + 36px top-header */
    left: 0;
    width: 100%;
    height: calc(100vh - 106px);
    z-index: 990;
    /* Just below header z-index */
    display: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.catalog-dropdown.active {
    display: block;
    opacity: 1;
}

/* Scroll state for catalog */
header.header-scrolled+.catalog-dropdown,
.header-scrolled~.catalog-dropdown {
    top: 70px;
    /* Only main header visible */
}

.catalog-dropdown::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    z-index: 1;
}

.catalog-container {
    position: relative;
    z-index: 2;
    background: white;
    width: 95%;
    max-width: 900px;
    /* Eniga kamaytirildi */
    margin: 0 auto;
    padding: 25px 30px 10px;
    /* Desktop padding qaytarildi */
    height: auto;
    /* Balandlik kontentga qarab */
    max-height: 85vh;
    /* Juda ko'p bo'lib ketmasligi uchun */
    min-height: auto;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border-radius: 0 0 30px 30px;
}

/* Agar ekran juda keng bo'lsa, orqa fonni to'ldirish uchun wrap kerak bo'lsa */
.catalog-wrapper {
    background: white;
    width: 100%;
    position: relative;
    z-index: 2;
}

.catalog-sidebar {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    /* Eni qisqargani uchun 4 ta ustun */
    gap: 15px;
    padding-bottom: 30px;
}

@media (max-width: 768px) {
    .catalog-sidebar {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 10px;
    }
}

.catalog-sidebar::-webkit-scrollbar {
    width: 4px;
}

.catalog-sidebar::-webkit-scrollbar-thumb {
    background: var(--primary);
    /* Branded scrollbar */
    border-radius: 4px;
}


/* Filter Sidebar Styles */
.category-layout {
    gap: 30px;
    padding: 5px 0;
    align-items: flex-start;
}

.filter-sidebar {
    width: 250px;
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    position: sticky;
    top: 90px;
    flex-shrink: 0;
}

.filter-group {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.filter-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.filter-title {
    font-weight: 600;
    margin-bottom: 15px;
    display: block;
    color: var(--text-main);
}

.price-inputs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.price-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.9rem;
}

.btn-filter {
    width: 100%;
    padding: 10px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-filter:hover {
    background: var(--primary-hover);
}

/* Scroll to Top Button */
#scrollTopBtn {
    display: none;
    /* Hidden by default */
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999;
    /* Ensure it's on top */
    border: none;
    outline: none;
    background-color: var(--primary);
    /* Primary orange */
    color: white;
    cursor: pointer;
    padding: 0;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(255, 125, 51, 0.3);
    transition: all 0.3s ease;
    width: 56px;
    /* Slightly larger like the image */
    height: 56px;
    align-items: center;
    justify-content: center;
}

#scrollTopBtn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(255, 125, 51, 0.5);
}

#scrollTopBtn svg {
    width: 28px;
    height: 28px;
    stroke-width: 2.5;
}

.sort-container {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
    align-items: center;
    gap: 10px;
}

.sort-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    outline: none;
    cursor: pointer;
    background: #fff;
}

/* Responsive Filters */
@media (max-width: 768px) {
    .category-layout {
        flex-direction: column;
    }

    .filter-sidebar {
        width: 100%;
        position: static;
        margin-bottom: 20px;
    }
}

.catalog-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px 10px;
    background: #f8f9fa;
    border-radius: 15px;
    text-decoration: none;
    color: var(--text-main);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    border: 1px solid transparent;
}

.catalog-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.catalog-item:hover {
    background: white;
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
    border-color: rgba(224, 49, 55, 0.1);
}

.catalog-item.active {
    background: #f0f0f0;
    /* Light gray active, NOT orange */
    color: var(--text-main);
    /* Keep black text */
    font-weight: 600;
    box-shadow: none;
    /* Remove shadow */
}

/* Parent span inside header containing icon and text */
.catalog-item-header>span:first-child {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Previous selector was .catalog-item span:first-child which might fail if structure changed */
/* But main.js structure: .catalog-item-header > span > .catalog-item-icon + text */

.catalog-item .catalog-item-icon {
    width: 44px;
    height: 44px;
    background: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    color: var(--primary);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
}

/* Specific fix: If item is active, icon bg remains white */
.catalog-item.active .catalog-item-icon {
    color: var(--primary);
    /* Icon becomes brand color */
}

.catalog-item:hover .catalog-item-icon {
    background: var(--primary);
    color: white;
    transform: rotate(-5deg) scale(1.1);
}

/* Mobile Catalog List Styling */
@media (max-width: 768px) {
    .catalog-container {
        padding: 0px;
    }

    .catalog-sidebar {
        gap: 8px;
        /* Oradagi masofani kamaytirish */
    }

    .catalog-item {
        flex-direction: row;
        align-items: center;
        text-align: left;
        padding: 8px 10px;
        /* Bo'yini kamaytirish */
        min-height: auto;
    }

    .catalog-item-header {
        justify-content: flex-start;
    }

    .catalog-item .catalog-item-icon {
        width: 32px;
        /* Ikonkani kichraytirish */
        height: 32px;
        margin-bottom: 0;
        margin-right: 10px;
        /* Matn bilan oraliqni kamaytirish va chapga yaqinlashish */
    }

    .catalog-item-header span {
        font-size: 0.95rem;
        font-weight: 500;
        text-align: left;
    }
}



.catalog-content {
    display: none;
    /* Bo'sh bo'limni yashiramiz */
}

.catalog-content h3 {
    font-size: 1.5rem;
    /* Matched to reference header size (visually check) */
    font-weight: 800;
    margin-bottom: 25px;
    color: #000;
    padding-bottom: 0;
    border-bottom: none;
    /* Reference doesn't show line */
    line-height: 1.2;
}

.catalog-sub-grid {
    column-count: 3;
    column-gap: 40px;
    height: auto;
    padding-bottom: 20px;
}

.catalog-sub-column {
    break-inside: avoid;
    margin-bottom: 30px;
    display: inline-block;
    /* Fix for column fitting */
    width: 100%;
}

.catalog-sub-title {
    /* Style for group headers if they existed */
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 12px;
    display: block;
    color: var(--text-main);
}

.catalog-sub-item {
    display: block;
    color: #555;
    /* Soft gray like reference */
    text-decoration: none;
    font-size: 0.95rem;
    margin-bottom: 8px;
    transition: all 0.2s ease;
    font-weight: 400;
}

.catalog-sub-item:hover {
    color: var(--primary);
    transform: translateX(3px);
}

.catalog-sub-more {
    color: var(--primary);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    margin-top: 10px;
    display: inline-block;
}


/* Search Dropdown (Auto-complete) */
.search-main {
    position: relative;
    /* Ensure relative for absolute dropdown */
}

.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 0 0 16px 16px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
    z-index: 1001;
    display: none;
    max-height: 450px;
    overflow-y: auto;
    margin-top: 5px;
    /* Gap from input */
    border: 1px solid #eee;
    padding: 10px 0;
}

.search-dropdown.active {
    display: block;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    gap: 12px;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
    color: inherit;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: #f5f7f9;
}

.search-result.brand-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Fill the square as in the reference */
    mix-blend-mode: normal;
    transition: transform 0.3s ease;
}

.search-result-image {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 4px;
    background: #f4f4f4;
}

.search-result-info {
    flex: 1;
}

.search-result-title {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 2px;
}

.search-result-price {
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 600;
}

.search-result-category {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.search-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-right: 18px;
}

.search-history-clear-all {
    background: none;
    border: none;
    color: #8B8E99;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s;
}

.search-history-clear-all:hover {
    color: var(--primary);
}

.search-history-list {
    margin-bottom: 15px;
}

.search-history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 18px;
    cursor: pointer;
    transition: background 0.2s;
}

.search-history-item:hover {
    background: #f5f7f9;
}

.history-item-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.history-icon {
    color: #abb0b9;
    flex-shrink: 0;
}

.history-query {
    font-size: 0.9rem;
    color: #1f2026;
}

.remove-history-item {
    background: none;
    border: none;
    color: #abb0b9;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 10px;
    line-height: 1;
    transition: color 0.2s;
}

.remove-history-item:hover {
    color: #1f2026;
}

.search-section-title {
    padding: 12px 18px 8px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #8B8E99;
    letter-spacing: 0.8px;
}

.search-popular-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 18px 20px;
}

.search-tag {
    padding: 6px 14px;
    background: #f2f4f7;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #1f2026;
    text-decoration: none;
    transition: all 0.2s;
}

.search-tag:hover {
    background: #e5e8ed;
    color: var(--primary);
}

.search-clear {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #d1d5db;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    margin-right: 10px;
    padding: 0;
    line-height: 1;
}

.search-clear:hover {
    background: #9ca3af;
}

.search-result-image-wrap {
    width: 44px;
    height: 44px;
    background: #f8f8f8;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.search-result-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.search-result-icon {
    width: 40px;
    height: 40px;
    background: #f4f4f4;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-result-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.loading-spinner-sm {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 5px;
}

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

.catalog-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    opacity: 0.5;
}

.catalog-placeholder svg {
    margin-bottom: 20px;
    width: 64px;
    height: 64px;
}



/* Favorites Button Animation */
.btn-favorite,
.btn-favorite-toggle {
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color 0.2s;
}

/* Back Button */
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    background: none;
    border: none;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 10px;
    padding: 8px 0;
    transition: all 0.2s ease;
}

.btn-back:hover {
    color: var(--primary);
    transform: translateX(-5px);
    /* Move left on hover */
}



.btn-back svg {
    width: 24px;
    height: 24px;
    stroke-width: 2.5;
}

.btn-favorite:hover,
.btn-favorite-toggle:hover {
    transform: scale(1.1);
    background-color: #fff0f0 !important;
    /* Light red tint on hover */
    border-color: #E03137 !important;
}

.btn-favorite:active,
.btn-favorite-toggle:active {
    transform: scale(0.95);
}

.btn-favorite.active svg,
.btn-favorite-toggle.active svg {
    fill: #E03137;
    stroke: #E03137;
    /* Filled heart when active */
    animation: heartPulse 0.3s ease-in-out;
}

@keyframes heartPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3);
    }

    100% {
        transform: scale(1);
    }
}

/* ============================================
   BILDIRISHNOMALAR (TOASTS)
   ============================================ */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: white;
    color: #1f2026;
    padding: 12px 20px;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 260px;
    max-width: 400px;
    pointer-events: auto;
    animation: toastIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transition: all 0.3s ease;
}

.toast.removing {
    transform: translateX(120%);
    opacity: 0;
}

.toast-icon {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid #FF7D33;
    color: #FF7D33;
    flex-shrink: 0;
}

.toast-icon svg {
    width: 16px;
    height: 16px;
}

.toast-content {
    flex: 1;
}

.toast-message {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1f2026;
}

@keyframes toastIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}



/* Recommendations Section */
.recommendations-section {
    padding: 20px 0;
    border-top: 1px solid var(--border-color);
}

.recommendations-section .section-header {
    margin-bottom: 25px;
}

.recommendations-grid-4 {
    display: grid;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 25px;
}

.btn-load-more {
    background: #f2f4f7;
    border: none;
    color: var(--text-main);
    padding: 16px 60px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
    width: auto;
    min-width: 300px;
}

.btn-load-more:hover {
    background: #e5e8ed;
    transform: translateY(-2px);
}

.btn-load-more:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

@media (max-width: 1200px) {
    .recommendations-grid-4 {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .recommendations-grid-4 {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* ============================================
   BUTTON STYLES (Desktop)
   ============================================ */
.section-link,
.section-link-red {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #FFF5F5;
    /* Very light red */
    color: #E03137 !important;
    /* Brand Red */
    padding: 10px 24px;
    border-radius: 50px;
    /* Pill shape */
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.section-link:hover,
.section-link-red:hover {
    background-color: #FFE0E0;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(224, 49, 55, 0.1);
}

/* ============================================
   MOBILE MARKET CARDS OVERRIDES
   ============================================ */
@media (max-width: 480px) {

    /* Hide view store button */
    .brand-action {
        display: none !important;
    }

    .brand-card {
        min-height: 180px !important;
        /* Reduced height (was ~220px) */
        padding: 10px !important;
    }

    .brand-image {
        aspect-ratio: 4 / 3 !important;
        /* Taller image (was 3/2) */
        margin-bottom: 15px !important;
    }

    .brand-info {
        gap: 8px !important;
        /* Increased gap between texts */
    }

    /* Smaller favorite button */
    .brand-card .btn-favorite-toggle {
        width: 28px !important;
        height: 28px !important;
        top: 8px !important;
        right: 8px !important;
        padding: 4px !important;
    }

    .brand-card .btn-favorite-toggle svg {
        width: 16px !important;
        height: 16px !important;
    }
}

/* ============================================
   MOBILE PRODUCT CARDS OVERRIDES
   ============================================ */
@media (max-width: 480px) {

    /* Hide 'View Prices' button */
    .product-card-action {
        display: none !important;
    }

    /* Smaller favorite button */
    .product-card .btn-favorite-toggle {
        width: 28px !important;
        height: 28px !important;
        top: 8px !important;
        right: 8px !important;
        padding: 4px !important;
    }

    .product-card .btn-favorite-toggle svg {
        width: 16px !important;
        height: 16px !important;
    }

    /* Compact card padding */
    .product-card {
        padding: 10px !important;
        min-height: auto !important;
        /* Allow height to adjust */
    }

    .product-price-section {
        margin-bottom: 0 !important;
        /* Remove bottom margin since button is gone */
    }
}

/* Market Page Custom Width - Fix for narrow display */
.market-custom-container {
    max-width: 1400px;
    width: 95%;
    margin: 0 auto;
    /* Center it */
    padding: 0 15px;
}

/* Ensure content inside takes full width */
.market-custom-container .market-header-card {
    width: 100% !important;
}

/* Reverting to 5 columns as requested, but ensuring it fills the new container width */
.market-custom-container .product-grid {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 20px;
}

@media (max-width: 1200px) {
    .market-custom-container .product-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

/* Fix for Catalog Sidebar Clutter on Desktop */
@media (min-width: 992px) {
    .catalog-sub-list {
        display: none !important;
    }
}

/* ============================================
   LANGUAGE MODAL
   ============================================ */
.lang-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.lang-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    width: 90%;
    max-width: 400px;
    border-radius: 24px;
    padding: 24px;
    z-index: 10001;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    animation: modalSlideUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.lang-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.lang-modal-header h3 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
}

.lang-modal-close {
    background: #f4f5f5;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
}

.lang-modal-close:hover {
    background: #eee;
}

.lang-options-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lang-option-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.lang-option-item:hover {
    background: #f1f3f5;
    transform: translateY(-2px);
}

.lang-option-item.active {
    background: #fff5f0;
    border-color: var(--primary);
}

.lang-flag {
    width: 30px;
    height: 20px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.lang-name {
    flex: 1;
    font-weight: 600;
    font-size: 1.05rem;
}

.lang-check {
    color: var(--primary);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translate(-50%, -40%);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

@media (max-width: 480px) {
    .lang-modal {
        bottom: 20px;
        top: auto;
        transform: translateX(-50%);
        width: 95%;
        animation: mobileSlideUp 0.3s ease-out;
    }

    @keyframes mobileSlideUp {
        from {
            transform: translate(-50%, 100%);
        }

        to {
            transform: translate(-50%, 0);
        }
    }
}

/* ============================================
   MANDATORY LOGIN OVERLAY
   ============================================ */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.login-overlay.active {
    display: flex;
    opacity: 1;
}

.login-overlay-content {
    background: white;
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    text-align: center;
    max-width: 400px;
    width: 90%;
    transform: translateY(20px);
    animation: fadeInUp 0.5s forwards 0.2s;
    opacity: 0;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Desktop uchun kategoriya va do'kon kartochkalaridagi animatsiyali tugmalar */
@media (min-width: 992px) {

    .category-card,
    .shop-card {
        position: relative;
        overflow: hidden;
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }

    .category-card:hover,
    .shop-card:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-lg);
    }

    .category-card .enter-button,
    .shop-card .enter-button {
        position: absolute;
        bottom: -50px;
        left: 0;
        width: 100%;
        background: linear-gradient(135deg, var(--primary), var(--primary-hover));
        color: white;
        text-align: center;
        padding: 12px 0;
        font-weight: 600;
        font-size: 0.9rem;
        transition: bottom 0.3s ease-in-out, background 0.3s ease;
        cursor: pointer;
        border: none;
        text-decoration: none;
        display: block;
    }

    .category-card:hover .enter-button,
    .shop-card:hover .enter-button {
        bottom: 0;
    }

    .category-card .enter-button:hover,
    .shop-card .enter-button:hover {
        background: linear-gradient(135deg, var(--primary-hover), var(--primary));
    }
}

.login-icon {
    width: 80px;
    height: 80px;
    background: #FFF5F5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: var(--primary);
}

.login-overlay h2 {
    font-size: 1.8rem;
    color: var(--text-main);
    margin-bottom: 10px;
    font-weight: 700;
}

.login-overlay p {
    color: var(--text-muted);
    margin-bottom: 30px;
    font-size: 1rem;
}

.btn-primary-large {
    display: block;
    width: 100%;
    padding: 16px;
    background: var(--primary);
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
    border-radius: 12px;
    text-decoration: none;
    transition: background 0.2s;
}

.btn-primary-large:hover {
    background: var(--primary-hover);
}

/* Blur Effect for Main Content */
.blur-content {
    filter: blur(5px);
    pointer-events: none;
    user-select: none;
    transition: filter 0.8s ease;
}