* { margin: 0; padding: 0; box-sizing: border-box; }
html { 
    touch-action: pan-x pan-y; 
    width: 100%;
}
body { 
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; 
    color: #1a1a1a; 
    background: #f5f5f5; 
    -webkit-tap-highlight-color: transparent;
    width: 100%;
    position: relative;
}
/* Only hide overflow-x on mobile to prevent horizontal scroll */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }
}
.container { max-width: 1400px; margin: 0 auto; padding: 0 20px; }

/* Header with search */
.page-header { 
    background: white; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); 
    position: sticky; 
    top: 0; 
    z-index: 1000;
    min-height: 72px; /* Prevent layout shift */
}
.header-content { 
    padding: 20px 0; 
    display: flex; 
    align-items: center; 
    gap: 30px;
    min-height: 72px; /* Match header min-height */
}
.logo { text-decoration: none; display: flex; align-items: center; }

/* Logo responsive display */
.logo img { 
    display: block;
    object-fit: contain;
}
/* Desktop logo - visible by default */
img.logo-desktop { 
    display: block; 
    width: 130px;
    height: 32px;
}
/* Mobile logo - hidden by default */
img.logo-mobile { 
    display: none;
}
.search-box { flex: 1; position: relative; }
.search-input { width: 100%; padding: 12px 20px 12px 50px; border: 2px solid #e5e7eb; border-radius: 8px; font-size: 16px; }
.search-input:focus { outline: none; border-color: #2563eb; }
.search-btn { display: none; } /* Hide search button */
.search-icon { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: #9ca3af; pointer-events: none; }
.search-camera { display: none; } /* Hide camera icon - no photo search yet */
.mobile-search-placeholder { display: none; } /* Hide mobile search placeholder on desktop */
/* Post Buy Request Button styles moved to header.css */

/* Breadcrumb - Desktop */
.breadcrumb { padding: 8px 0; font-size: 14px; color: #6b7280; }
.breadcrumb a { color: #2563eb; text-decoration: none; }

/* Mobile Breadcrumb */
.mobile-breadcrumb {
    padding: 8px 0 4px 0;
    background: white;
    border-bottom: 1px solid #f0f0f0;
    margin-top: 0; /* Default no margin for desktop */
}

.mobile-breadcrumb-wrapper {
    position: relative;
    overflow: hidden;
}

.mobile-breadcrumb-wrapper::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 30px;
    background: linear-gradient(to right, rgba(255,255,255,0), rgba(255,255,255,1));
    pointer-events: none;
    z-index: 1;
}

.mobile-breadcrumb-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 4px;
    margin-left: -4px;
    margin-right: -4px;
    padding-left: 4px;
    padding-right: 30px;
}

.mobile-breadcrumb-scroll::-webkit-scrollbar {
    display: none;
}

.mobile-breadcrumb-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 16px;
    text-decoration: none;
    color: #495057;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.mobile-breadcrumb-item:hover {
    background: #e9ecef;
    border-color: #dee2e6;
    color: #343a40;
    text-decoration: none;
}

.mobile-breadcrumb-item.home {
    background: #e3f2fd;
    border-color: #bbdefb;
    color: #1976d2;
}

.mobile-breadcrumb-item.home:hover {
    background: #bbdefb;
    border-color: #90caf9;
}

.mobile-breadcrumb-item.current {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
    cursor: default;
}

.mobile-breadcrumb-item svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.mobile-breadcrumb-item span {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Mobile Subcategories */
.mobile-subcategories-wrapper {
    position: relative;
    margin-top: 8px;
    overflow: hidden;
}

.mobile-subcategories-wrapper::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 30px;
    background: linear-gradient(to right, rgba(255,255,255,0), rgba(255,255,255,1));
    pointer-events: none;
    z-index: 1;
}

.mobile-subcategories-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 4px;
    margin-left: -4px;
    margin-right: -4px;
    padding-left: 4px;
    padding-right: 30px;
}

.mobile-subcategories-scroll::-webkit-scrollbar {
    display: none;
}

.mobile-subcat-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 20px;
    text-decoration: none;
    color: #856404;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.mobile-subcat-btn:hover {
    background: #ffeaa7;
    border-color: #ffd93d;
    color: #533f03;
    text-decoration: none;
}

.mobile-subcat-btn .subcat-count {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-left: 2px;
}

/* Simple header section */
.simple-header {
    padding: 30px 0 20px 0;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 0;
}
.category-title {
    font-size: 2rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 12px 0;
}
.category-stats {
    font-size: 0.9375rem;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 12px;
}
.category-stats .stat-item {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
}
.category-stats .stat-item strong {
    font-weight: 600;
    color: #374151;
}
.category-stats .stat-separator {
    color: #d1d5db;
}

/* Desktop View Tabs */
.desktop-view-tabs {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 0;
    margin-bottom: 8px;
}

.desktop-tabs-wrapper {
    display: grid;
    grid-template-columns: 240px 1fr auto;
    gap: 24px;
    align-items: center;
}

.desktop-category-h1 {
    font-size: 1.25rem;
    font-weight: 500;
    color: #111827;
    margin: 0;
    white-space: nowrap;
}

.desktop-tabs {
    display: flex;
    gap: 0;
    flex-shrink: 0;
}

.desktop-view-controls {
    justify-self: end;
}

.desktop-tab {
    padding: 16px 24px;
    background: none;
    border: none;
    font-size: 16px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
}

.desktop-tab:hover {
    color: #374151;
}

.desktop-tab.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

.desktop-tab-count {
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: normal;
}

.desktop-tab.active .desktop-tab-count {
    background: #dbeafe;
    color: #2563eb;
}

.desktop-view-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

.sort-dropdown {
    padding: 8px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
}





/* Subcategories inline */
.subcategories-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.subcategory-tag {
    display: inline-block;
    padding: 6px 16px;
    background: #f3f4f6;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 400;
    text-decoration: none;
    border-radius: 16px;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    white-space: nowrap;
}
.subcategory-tag:hover {
    background: #e5e7eb;
    color: #111827;
    text-decoration: none;
}

/* Suppliers strip */
    /* Mobile Category Header */
    .mobile-category-header { 
        background: white; 
        padding: 16px 0 20px 0; 
        margin-bottom: 0;
        position: relative;
    }
.mobile-category-header h1 { 
    font-size: 1.5rem; 
    font-weight: 600; 
    margin-bottom: 8px; 
    line-height: 1.3;
    color: #1a1a1a;
}
.mobile-stats { 
    font-size: 0.875rem; 
    color: #6b7280; 
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.mobile-stats .stat-divider { 
    color: #d1d5db; 
}

/* Mobile Product Types */
.mobile-product-types-wrapper {
    position: relative;
    margin-top: 12px;
    overflow: hidden;
}
.mobile-product-types-wrapper::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 40px;
    background: linear-gradient(to right, rgba(255,255,255,0), rgba(255,255,255,1));
    pointer-events: none;
    z-index: 1;
}
.mobile-product-types { 
    display: flex; 
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
    padding-bottom: 4px;
    margin-left: -10px;
    margin-right: -10px;
    padding-left: 10px;
    padding-right: 20px; /* Extra padding for gradient */
}
.mobile-product-types::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}
.mobile-type-btn { 
    display: inline-flex; 
    align-items: center; 
    gap: 4px;
    padding: 8px 14px; 
    background: #f3f4f6; 
    border: 1px solid #e5e7eb; 
    border-radius: 20px; 
    text-decoration: none; 
    color: #374151; 
    font-size: 0.875rem; 
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}
.mobile-type-btn:hover { 
    background: #e5e7eb; 
    border-color: #d1d5db; 
}
.mobile-type-btn.selected { 
    background: #2563eb; 
    color: white; 
    border-color: #2563eb; 
}
.mobile-type-btn .type-count { 
    font-size: 0.75rem; 
    opacity: 0.8; 
}
.mobile-type-btn.selected .type-count { 
    opacity: 0.9; 
}

.suppliers-strip { background: #fef3c7; padding: 20px; border-radius: 12px; margin-bottom: 30px; }
.suppliers-content { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    overflow-x: auto; 
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: #d1d5db #f3f4f6;
    padding-bottom: 8px;
}
.suppliers-content::-webkit-scrollbar { 
    height: 6px; 
}
.suppliers-content::-webkit-scrollbar-track { 
    background: #f3f4f6; 
    border-radius: 3px; 
}
.suppliers-content::-webkit-scrollbar-thumb { 
    background: #d1d5db; 
    border-radius: 3px; 
}
.suppliers-content::-webkit-scrollbar-thumb:hover { 
    background: #9ca3af; 
}
.supplier-badge { 
    display: flex; 
    align-items: center; 
    gap: 4px; 
    background: white; 
    padding: 8px 16px; 
    border-radius: 8px; 
    white-space: nowrap; 
    flex-shrink: 0;
    transition: all 0.2s ease;
}
.supplier-badge:hover { background: #f3f4f6; transform: translateY(-1px); box-shadow: 0 2px 4px rgba(0,0,0,0.1); }

/* Category cards */
.quick-categories { margin-bottom: 30px; }
.quick-categories h2 { font-size: 1.125rem; margin-bottom: 16px; }
.category-cards-wrapper { position: relative; }
.category-cards { display: flex; gap: 12px; overflow-x: auto; padding: 0 10px 10px 10px; scroll-behavior: smooth; scrollbar-width: thin; }
.category-cards::-webkit-scrollbar { height: 8px; }
.category-cards::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 4px; }
.category-cards::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }
.category-cards::-webkit-scrollbar-thumb:hover { background: #9ca3af; }
.scroll-btn { position: absolute; top: 50%; transform: translateY(-50%); background: white; border: 1px solid #e5e7eb; border-radius: 50%; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 2px 4px rgba(0,0,0,0.1); z-index: 10; transition: all 0.3s; font-size: 16px; color: #6b7280; }
.scroll-btn:hover { background: #f3f4f6; box-shadow: 0 4px 8px rgba(0,0,0,0.15); color: #374151; }
.scroll-btn.left { left: -16px; }
.scroll-btn.right { right: -16px; }
.scroll-btn.hidden { opacity: 0; pointer-events: none; }
.cat-card { background: white; border-radius: 8px; overflow: hidden; cursor: pointer; transition: all 0.3s; border: 2px solid transparent; text-decoration: none; color: inherit; display: flex; flex-direction: column; width: 200px; flex-shrink: 0; padding: 12px; }
.cat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 16px rgba(0,0,0,0.1); border-color: #2563eb; }
.cat-card.active { border-color: #2563eb; background: #eff6ff; }
.cat-header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.cat-icon { width: 40px; height: 40px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: #f3f4f6; border-radius: 8px; overflow: hidden; }
.cat-icon img { width: 100%; height: 100%; object-fit: cover; }
.cat-icon svg { width: 24px; height: 24px; color: #6b7280; }
.cat-title { flex: 1; min-width: 0; }
.cat-name { font-weight: 600; margin-bottom: 2px; word-wrap: break-word; overflow-wrap: break-word; font-size: 0.85rem; line-height: 1.2; color: #1f2937; }
.cat-count { color: #6b7280; font-size: 0.7rem; }
.cat-subcats { font-size: 0.65rem; color: #6b7280; line-height: 1.4; word-wrap: break-word; overflow-wrap: break-word; hyphens: auto; padding-top: 8px; border-top: 1px solid #e5e7eb; }
.cat-subcats .subcat-link { color: #4b5563; text-decoration: none; transition: color 0.2s; }
.cat-subcats .subcat-link:hover { color: #2563eb; text-decoration: underline; }

/* Main content */
.main-content { 
    display: grid; 
    grid-template-columns: 240px 1fr; 
    gap: 24px; 
    margin-top: 12px; 
    min-height: calc(100vh - 200px);
    align-items: start;
}

.main-content main {
    min-width: 0;
    overflow: hidden;
}

/* Filters */
.filters { 
    background: white; 
    border-radius: 12px; 
    padding: 16px; 
    min-height: calc(100vh - 120px);
    position: sticky; 
    top: 100px; 
    height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    z-index: 90;
}
/* Loading indicator for auto-submit - only for desktop */
.filters-loading {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: none;
}
.filters.is-loading .filters-loading {
    display: block;
}
/* Hide loading indicator in mobile filters */
.filters-mobile .filters-loading {
    display: none !important;
}
.filters form {
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}
.filter-sections-wrapper {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 8px;
    padding-right: 10px;
    margin-right: -10px;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}
.filter-sections-wrapper::-webkit-scrollbar { 
    width: 0px;
    background: transparent;
    transition: width 0.2s ease;
}
.filters:hover .filter-sections-wrapper,
.filter-sections-wrapper:hover {
    scrollbar-width: thin; /* Firefox */
    -ms-overflow-style: auto; /* IE and Edge */
}
.filters:hover .filter-sections-wrapper::-webkit-scrollbar,
.filter-sections-wrapper:hover::-webkit-scrollbar { 
    width: 6px;
    transition: width 0.2s ease;
}
.filters:hover .filter-sections-wrapper::-webkit-scrollbar-track,
.filter-sections-wrapper:hover::-webkit-scrollbar-track { 
    background: #f1f1f1; 
    border-radius: 3px; 
}
.filters:hover .filter-sections-wrapper::-webkit-scrollbar-thumb,
.filter-sections-wrapper:hover::-webkit-scrollbar-thumb { 
    background: #d1d5db; 
    border-radius: 3px; 
}
.filters:hover .filter-sections-wrapper::-webkit-scrollbar-thumb:hover,
.filter-sections-wrapper:hover::-webkit-scrollbar-thumb:hover { 
    background: #9ca3af; 
}
.filter-section { 
    margin-bottom: 16px; 
    padding-bottom: 16px; 
    border-bottom: 1px solid #e5e7eb; 
    position: relative;
}
/* Auto-apply hint - removed per user request */
/* .filters::before {
    content: 'Filters apply automatically';
    position: absolute;
    top: -8px;
    right: 16px;
    font-size: 0.7rem;
    color: #9ca3af;
    background: white;
    padding: 0 6px;
    z-index: 1;
} */
.filter-section:last-child { border-bottom: none; margin-bottom: 8px; }
/* Visual indicator for scrollable content */
.filter-content:not(.collapsed)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 8px;
    height: 20px;
    background: linear-gradient(to bottom, transparent, white);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 1;
}
.filter-content.has-scroll:not(.collapsed)::after {
    opacity: 1;
}
/* Hide gradient when scrolled to bottom */
.filter-content.scrolled-bottom:not(.collapsed)::after {
    opacity: 0;
}
.filter-title { font-weight: 600; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; user-select: none; font-size: 0.9rem; }
.filter-title:hover { color: #2563eb; }
.filter-title-text { display: flex; align-items: center; gap: 6px; }
.filter-more-indicator { 
    font-size: 0.7rem; 
    color: #9ca3af; 
    font-weight: 400;
}
.filter-title .arrow { transition: transform 0.3s; font-size: 0.75rem; }
.filter-title.collapsed .arrow { transform: rotate(-90deg); }
.filter-content { 
    max-height: 145px; /* Точно 5 позиций */
    overflow-y: auto; 
    overflow-x: hidden; 
    transition: all 0.3s ease-out;
    scrollbar-width: none; /* Firefox - скрыт по умолчанию */
    -ms-overflow-style: none; /* IE and Edge */
    position: relative;
    padding-right: 8px;
    margin-right: -8px;
}
.filter-content:hover {
    scrollbar-width: thin; /* Firefox - показать при наведении */
    -ms-overflow-style: auto; /* IE and Edge */
}
.filter-content.collapsed { max-height: 0; margin-bottom: 0; overflow: hidden; }
.filter-content::-webkit-scrollbar { 
    width: 0px; 
    transition: width 0.2s;
}
.filter-content:hover::-webkit-scrollbar { 
    width: 4px;
}
.filter-content::-webkit-scrollbar-track { 
    background: #f1f1f1; 
    border-radius: 2px; 
}
.filter-content::-webkit-scrollbar-thumb { 
    background: #d1d5db; 
    border-radius: 2px; 
}
.filter-content::-webkit-scrollbar-thumb:hover { 
    background: #9ca3af; 
}
.filter-more-categories { margin-top: 6px; }
.filter-section a { text-decoration: none; font-size: 0.85rem; }
.filter-section a:hover { text-decoration: underline; }

/* Category hierarchy styles */
.category-hierarchy {
    padding: 5px 0;
    position: relative;
}
/* Breadcrumb container */
.hierarchy-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

/* Parent categories */
.hierarchy-parent {
    display: flex;
    align-items: center;
    padding: 4px 0;
    font-size: 0.8125rem;
    color: #6b7280;
    text-decoration: none;
    transition: all 0.15s ease;
    position: relative;
}
.hierarchy-parent:not(:first-child) {
    margin-left: 16px;
}
.hierarchy-parent:hover {
    color: #2563eb;
    text-decoration: none;
}
.hierarchy-parent .hierarchy-arrow {
    font-size: 0.875rem;
    color: #9ca3af;
    margin-right: 4px;
    font-weight: 300;
}

/* Visual connector between breadcrumb items */
.hierarchy-parent:not(:first-child)::before {
    content: '›';
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    color: #e5e7eb;
    font-size: 1rem;
}

/* Current category */
.hierarchy-current {
    padding: 10px 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #111827;
    margin: 8px 0;
    padding-left: 28px;
    position: relative;
    background-color: #f9fafb;
    border-radius: 6px;
    margin-left: -8px;
    margin-right: -8px;
    padding-left: 36px;
    padding-right: 8px;
}
.hierarchy-current::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background: #2563eb;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

/* Child categories section */
.hierarchy-children {
    margin: 12px 0 16px 0;
    padding-left: 16px;
    position: relative;
}

/* Vertical line for children */
.hierarchy-children::before {
    content: '';
    position: absolute;
    left: 6px;
    top: -8px;
    bottom: 8px;
    width: 1px;
    background: #e5e7eb;
}

.hierarchy-child {
    padding: 6px 0 6px 24px;
    margin-bottom: 2px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: #4b5563;
    text-decoration: none;
    transition: all 0.15s ease;
    position: relative;
}

/* Horizontal connector for each child */
.hierarchy-child::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 18px;
    height: 1px;
    background: #e5e7eb;
}

.hierarchy-child:hover {
    color: #2563eb;
    background-color: #f3f4f6;
    margin-left: -8px;
    margin-right: -8px;
    padding-left: 32px;
    padding-right: 8px;
    border-radius: 4px;
}

.hierarchy-count {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-left: 8px;
    font-weight: 500;
}

/* Link to all categories */
.hierarchy-all {
    display: flex;
    align-items: center;
    margin-top: 16px;
    padding: 8px 0;
    border-top: 1px solid #e5e7eb;
    font-size: 0.875rem;
    color: #6b7280;
    text-decoration: none;
    transition: all 0.15s ease;
}
.hierarchy-all:hover {
    color: #2563eb;
    text-decoration: none;
}
.hierarchy-all .hierarchy-arrow {
    font-size: 0.9rem;
    color: #9ca3af;
    margin-right: 6px;
    font-weight: 300;
}

.filter-option { 
    display: flex; 
    align-items: center; 
    padding: 5px 0; 
    font-size: 0.85rem; 
    transition: background-color 0.2s;
    border-radius: 4px;
    padding-left: 4px;
    padding-right: 4px;
    margin: 0 -4px;
}
.filter-option:hover { 
    background-color: #f3f4f6; 
}
.filter-option input { 
    margin-right: 6px; 
    width: 14px; 
    height: 14px; 
    cursor: pointer; 
    accent-color: #2563eb;
    transition: transform 0.2s;
}
.filter-option input:checked {
    transform: scale(1.1);
}
.filter-option label { 
    flex: 1; 
    cursor: pointer; 
    line-height: 1.3; 
    user-select: none;
}
.filter-count { color: #6b7280; font-size: 0.75rem; }
/* Desktop only filter button wrapper */
.filters:not(.filters-mobile) .apply-filters-btn-wrapper {
    display: none; /* Hidden since we're using auto-submit on desktop */
}
.apply-filters-btn { 
    width: 100%; 
    padding: 10px; 
    background: #2563eb; 
    color: white; 
    border: none; 
    border-radius: 6px; 
    font-weight: 600; 
    cursor: pointer; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: all 0.2s;
    font-size: 0.9rem;
}
.apply-filters-btn:hover {
    background: #1d4ed8;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Products */
.products-section { 
    background: white; 
    border-radius: 12px; 
    padding: 24px; 
    min-height: calc(100vh - 200px);
}
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; flex-wrap: wrap; gap: 16px; }
.section-title { font-size: 1.5rem; font-weight: 600; }
.view-options { display: flex; gap: 12px; align-items: center; }
.view-btn { padding: 8px 16px; border: 1px solid #e5e7eb; background: white; border-radius: 6px; cursor: pointer; }
.view-btn.active { background: #2563eb; color: white; border-color: #2563eb; }
.sort-select { padding: 8px 16px; border: 1px solid #e5e7eb; border-radius: 6px; background: white; }


/* Mobile View Toggle */
.mobile-view-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    color: #6b7280;
}
.mobile-view-toggle:hover {
    color: #374151;
}
.mobile-view-toggle:active {
    transform: scale(0.95);
}
.mobile-view-toggle svg {
    display: block;
    stroke: currentColor;
    width: 20px;
    height: 20px;
}

/* Mobile Filter Button in Header */
.mobile-filter-btn-header {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    color: #6b7280;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}
.mobile-filter-btn-header:hover {
    color: #374151;
}
.mobile-filter-btn-header:active {
    transform: scale(0.95);
}
.mobile-filter-btn-header svg {
    display: block;
    stroke: currentColor;
    width: 18px;
    height: 18px;
}

.filter-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ef4444;
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    padding: 0 5px;
    margin-left: 4px;
}


.products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.product-card { border: 1px solid #e5e7eb; border-radius: 12px; overflow: hidden; transition: all 0.3s; cursor: pointer; background: white; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.product-card:hover { box-shadow: 0 8px 16px rgba(0,0,0,0.1); transform: translateY(-2px); }
@media (max-width: 768px) {
    .product-card:active { transform: scale(0.98); transition: transform 0.1s; }
}
.product-image { width: 100%; height: 180px; background: #ffffff; position: relative; display: flex; align-items: center; justify-content: center; color: #9ca3af; border-bottom: 1px solid #e5e7eb; padding: 12px; }
.product-image img { max-width: 100%; max-height: 100%; object-fit: contain; }
.product-badge { position: absolute; top: 10px; right: 10px; background: #ef4444; color: white; padding: 5px 14px; border-radius: 6px; font-size: 0.75rem; font-weight: 600; box-shadow: 0 2px 4px rgba(0,0,0,0.1); z-index: 5; transition: all 0.3s; }
.product-badge.new { background: #10b981; }
.product-info { padding: 16px; }
.product-name { font-weight: 600; margin-bottom: 8px; line-height: 1.4; height: 2.8em; overflow: hidden; font-size: 0.95rem; color: #1a1a1a; }
.product-price-range { font-size: 1.25rem; font-weight: 700; color: #111827; margin-bottom: 12px; }
.product-price-range .currency { font-size: 0.9rem; color: #6b7280; font-weight: 600; }
.product-specs { font-size: 0.8rem; color: #6b7280; margin-bottom: 10px; min-height: 40px; line-height: 1.4; }
.product-specs div { margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.product-supplier { font-size: 0.75rem; color: #6b7280; font-weight: 400; margin-bottom: 8px; }
.product-footer { display: flex; justify-content: space-between; align-items: center; }
.product-moq { font-size: 0.75rem; color: #6b7280; font-weight: 500; }
.quote-btn { background: #2563eb; color: white; border: none; padding: 8px 20px; border-radius: 20px; font-size: 0.8rem; cursor: pointer; font-weight: 600; transition: all 0.2s; text-decoration: none !important; display: inline-block; }
.quote-btn:hover { background: #1d4ed8; text-decoration: none !important; }
a.quote-btn { text-decoration: none !important; }
a.quote-btn:hover { text-decoration: none !important; }
a.quote-btn:focus { text-decoration: none !important; }
a.quote-btn:active { text-decoration: none !important; }
a.quote-btn:visited { text-decoration: none !important; }

/* Suppliers Grid */
.suppliers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.supplier-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s;
    cursor: pointer;
}

.supplier-card:hover {
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.supplier-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.supplier-avatar {
    width: 56px;
    height: 56px;
    background: #eff6ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 600;
    color: #2563eb;
    flex-shrink: 0;
}

.supplier-info {
    flex: 1;
}

.supplier-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: #1a1a1a;
}

.supplier-location {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #6b7280;
    font-size: 0.85rem;
}

.supplier-location svg {
    width: 14px;
    height: 14px;
    stroke: #6b7280;
}

.supplier-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
    padding: 16px 0;
    border-top: 1px solid #f3f4f6;
    border-bottom: 1px solid #f3f4f6;
}

.supplier-stats .stat {
    text-align: center;
}

.supplier-stats .stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 4px;
}

.supplier-stats .stat-label {
    font-size: 0.75rem;
    color: #6b7280;
}

.supplier-tags {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.supplier-tags .tag {
    padding: 4px 12px;
    background: #f0fdf4;
    color: #059669;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.contact-supplier-btn {
    width: 100%;
    padding: 10px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.contact-supplier-btn:hover {
    background: #1d4ed8;
}

/* Made-in-China Style Suppliers View */
#suppliersView {
    display: flex;
    gap: 20px;
    width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

.suppliers-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    overflow-x: hidden;
}

.mic-supplier-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    gap: 20px;
    transition: all 0.3s;
}

.mic-supplier-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.mic-supplier-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mic-supplier-header {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.mic-supplier-name {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.mic-supplier-name a {
    color: #0066cc;
    text-decoration: none;
}

.mic-supplier-name a:hover {
    text-decoration: underline;
}

.mic-audited-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #52c41a;
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.mic-supplier-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

    .mic-detail-row {
        display: flex;
        font-size: 14px;
        line-height: 1.5;
        flex-wrap: wrap;
        gap: 8px;
    }

.mic-detail-label {
    color: #666;
    min-width: 120px;
}

.mic-detail-value {
    color: #333;
    flex: 1;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.mic-supplier-actions {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

/* Hide mobile actions on desktop */
.mic-supplier-actions-mobile {
    display: none !important;
}

.mic-contact-btn, .mic-chat-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.mic-contact-btn {
    background: #ff6b35;
    color: white;
}

.mic-contact-btn:hover {
    background: #e55a26;
}

.mic-chat-btn {
    background: white;
    color: #666;
    border: 1px solid #ddd;
}

.mic-chat-btn:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

.mic-supplier-right {
    width: 360px;
}

.mic-product-showcase {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.mic-showcase-item {
    text-align: center;
    text-decoration: none;
    display: block;
    transition: all 0.2s;
    width: 100%;
    max-width: 110px;
}

a.mic-showcase-item:hover {
    transform: translateY(-2px);
}

a.mic-showcase-item:hover .mic-showcase-image {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

a.mic-showcase-item .mic-showcase-title {
    color: #333;
}

.mic-showcase-image {
    width: 120px;
    height: 120px;
    background: #f5f5f5;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 6px;
}

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

.mic-showcase-title {
    font-size: 12px;
    color: #333;
    line-height: 1.4;
    max-height: 36px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-top: 4px;
    font-weight: 500;
}

/* Sidebar */
.mic-sidebar {
    width: 220px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.mic-sidebar-section {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 14px;
}

.mic-sidebar-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin: 0 0 10px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
}

.mic-hot-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mic-hot-item {
    color: #666;
    text-decoration: none;
    font-size: 13px;
    padding: 3px 0;
    transition: color 0.2s;
}

.mic-hot-item:hover {
    color: #0066cc;
}

.mic-hot-item.more-link {
    color: #0066cc;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
}

/* Pagination */
.pagination { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 40px; }
.pagination a, .pagination span { padding: 8px 12px; border: 1px solid #e5e7eb; border-radius: 6px; text-decoration: none; color: #374151; }
.pagination a:hover { background: #f3f4f6; }
.pagination span.current { background: #2563eb; color: white; border-color: #2563eb; }

/* SEO Content */
.category-content { background: white; border-radius: 12px; padding: 32px; margin-top: 30px; }
.content-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 30px; }
.content-section h3 { margin-bottom: 16px; }
.content-section ul { list-style: none; }
.content-section li { padding: 8px 0; padding-left: 24px; position: relative; }
.content-section li:before { content: "✓"; position: absolute; left: 0; color: #10b981; font-weight: bold; }

/* Help widget */
.help-widget { position: fixed; bottom: 30px; right: 30px; z-index: 100; }
.help-btn { background: #2563eb; color: white; width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 4px 12px rgba(0,0,0,0.2); font-size: 24px; }

/* RTL Support */
.rtl-content { direction: rtl; }
.rtl-content .breadcrumb { direction: ltr; text-align: right; }

/* Mobile Breadcrumb RTL */
.rtl-content .mobile-breadcrumb { direction: rtl; }
.rtl-content .mobile-breadcrumb-wrapper::after {
    right: auto;
    left: 0;
    background: linear-gradient(to left, rgba(255,255,255,0), rgba(255,255,255,1));
}
.rtl-content .mobile-breadcrumb-scroll { direction: ltr; }
.rtl-content .mobile-breadcrumb-item { direction: rtl; }
.rtl-content .mobile-subcategories-wrapper::after {
    right: auto;
    left: 0;
    background: linear-gradient(to left, rgba(255,255,255,0), rgba(255,255,255,1));
}
.rtl-content .mobile-subcategories-scroll { direction: ltr; }
.rtl-content .mobile-subcat-btn { direction: rtl; }
.rtl-content .main-content { direction: rtl; }
.rtl-content .product-card { direction: rtl; }
.rtl-content .filter-option { direction: rtl; }
.rtl-content .filter-option input { margin-right: 0; margin-left: 8px; }
/* .rtl-content .mobile-nav-items { direction: rtl; } - removed */
.rtl-content .filters-mobile-header { direction: rtl; }
.rtl-content .filters-mobile { left: -100%; right: auto; }
.rtl-content .filters-overlay.active .filters-mobile { left: 0; right: auto; }
.rtl-content .help-widget { left: 30px; right: auto; }
.rtl-content .product-footer { direction: rtl; }
.rtl-content .stat-item { direction: rtl; }
.rtl-content .category-link { direction: rtl; display: inline-block; }
.rtl-content .mobile-category-header { direction: rtl; }
.rtl-content .mobile-stats { direction: rtl; }
.rtl-content .mobile-product-types-wrapper { direction: rtl; }
.rtl-content .mobile-product-types-wrapper::after { 
    right: auto;
    left: 0;
    background: linear-gradient(to left, rgba(255,255,255,0), rgba(255,255,255,1));
}
.rtl-content .mobile-product-types { direction: ltr; }
.rtl-content .mobile-type-btn { direction: rtl; }
.rtl-content .mobile-sort-header { direction: rtl; }
.rtl-content .mobile-sort-option { text-align: right; }
.rtl-content .mobile-filter-btn-header { direction: rtl; }
.rtl-content .mobile-filter-btn-header svg { margin-right: 0; margin-left: 4px; }

/* Mobile filter button - removed from bottom left */

/* Mobile Search Modal */
.search-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    z-index: 1100;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    /* Prevent zoom */
    touch-action: manipulation;
}

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

/* Prevent text selection and zoom in modal */
.search-modal * {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

/* Allow text selection only in input */
.search-modal-input {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
}

/* Prevent double-tap zoom on all clickable elements in modal */
.search-modal button,
.search-modal a,
.search-modal .search-category-card,
.search-modal .trending-tag {
    touch-action: manipulation;
}

.search-modal-header {
    position: sticky;
    top: 0;
    background: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.search-modal-back {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #374151;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-modal-back svg {
    width: 24px;
    height: 24px;
}

.search-modal-input-wrapper {
    flex: 1;
    position: relative;
}

.search-modal-input {
    width: 100%;
    padding: 10px 40px 10px 40px;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    background: #f5f5f5;
    font-size: 16px; /* Changed to 16px to prevent zoom on iOS */
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.search-modal-input:focus {
    background: white;
    border-color: #2563eb;
}

/* Prevent zoom on iOS when focusing input */
@media (max-width: 768px) {
    .search-modal-input {
        font-size: 16px !important;
    }
}

/* Visual hint for input focus */
.search-modal.active .search-modal-input {
    animation: pulseInput 1s ease-in-out;
}

@keyframes pulseInput {
    0%, 100% {
        border-color: #e5e7eb;
    }
    50% {
        border-color: #2563eb;
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    }
}

.search-modal-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: #9ca3af;
    pointer-events: none;
}

.search-modal-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: #e5e7eb;
    border: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #6b7280;
    font-size: 14px;
    line-height: 1;
}

.search-modal-input:not(:placeholder-shown) ~ .search-modal-clear {
    display: flex;
}

.search-modal-content {
    padding: 16px;
}

.search-section {
    margin-bottom: 24px;
}

.search-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.search-clear-all {
    font-size: 0.875rem;
    color: #6b7280;
    text-decoration: none;
    font-weight: 400;
}

.recent-searches {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.recent-search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #374151;
    text-decoration: none;
    font-size: 0.95rem;
    padding: 4px 0;
}

.recent-search-item svg {
    width: 16px;
    height: 16px;
    color: #9ca3af;
    flex-shrink: 0;
}

.search-categories {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 16px;
}

.search-category-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px 8px;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

.search-category-card:active {
    transform: scale(0.98);
    background: #f3f4f6;
}

.search-category-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 8px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.search-category-icon img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.search-category-icon svg {
    width: 24px;
    height: 24px;
    color: #6b7280;
}

.search-category-name {
    font-size: 0.75rem;
    font-weight: 500;
    color: #374151;
    line-height: 1.2;
}

.search-category-count {
    font-size: 0.7rem;
    color: #6b7280;
    margin-top: 2px;
}

.search-trending {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.trending-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: 16px;
    text-decoration: none;
    color: #92400e;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s;
}

.trending-tag:active {
    transform: scale(0.95);
    background: #fde68a;
}

.trending-tag svg {
    width: 14px;
    height: 14px;
    color: #d97706;
}

/* Mobile filter overlay */
.filters-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1050; /* Above header (100) but below search modal (1100) */
    opacity: 0;
    transition: opacity 0.3s;
    overflow: hidden; /* Prevent scroll on overlay */
}

.filters-overlay.active {
    opacity: 1;
}

.filters-mobile {
    position: fixed;
    right: -100%;
    top: 0;
    width: 85%;
    max-width: 380px;
    height: 100%;
    background: white;
    overflow: hidden;
    transition: right 0.3s;
    z-index: 1051; /* Above overlay */
    box-shadow: -2px 0 8px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
}

.filters-overlay.active .filters-mobile {
    right: 0;
}

.filters-mobile-header {
    position: sticky;
    top: 0;
    background: white;
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.filters-mobile-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}

.filters-mobile-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #374151;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.filters-mobile-close:hover {
    background: #f3f4f6;
}

/* Mobile View Tabs and Controls */
.mobile-view-tabs {
    display: none;
    background: white;
    border-bottom: none;
    position: sticky;
    top: 80px; /* Below fixed header */
    z-index: 90; /* Lower than header (100) */
}

.view-tabs-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
}

.view-tabs {
    display: flex;
    flex: 1;
    gap: 0;
    margin-right: 10px;
}

.view-tab {
    position: relative;
    flex: 1;
    padding: 14px 16px 12px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    font-size: 0.95rem;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: color 0.2s, background 0.2s, border-bottom-color 0.2s;
    white-space: nowrap;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
}

.view-tab:hover {
    color: #374151;
    background: #f9fafb;
}

.view-tab.active {
    color: #111827;
    font-weight: 600;
    border-bottom-color: #2563eb;
    background: transparent;
}

/* Ensure border is visible on mobile */
@media (max-width: 768px) {
    .view-tab {
        border-bottom-width: 3px;
    }
}

.view-tab-text {
    display: inline-block;
    vertical-align: middle;
    pointer-events: none;
}

.view-tab-count {
    display: inline-block;
    vertical-align: middle;
    margin-left: 4px;
    font-size: 0.85rem;
    color: #6b7280;
    font-weight: 400;
    pointer-events: none;
}

.view-tab.active .view-tab-count {
    color: #4b5563;
    font-weight: 500;
}

.view-controls {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
    align-items: center;
}

/* Mobile navigation - removed per user request */
/*
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 100;
    padding: 10px 0;
}

.mobile-nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px;
    color: #6b7280;
    text-decoration: none;
    font-size: 0.75rem;
}

.mobile-nav-item.active {
    color: #2563eb;
}
*/

/* Base styles for responsive elements */
.mobile-only {
    display: none !important;
}

.desktop-only {
    display: block;
}

/* Responsive */
@media (max-width: 768px) {
    .main-content { 
        grid-template-columns: 1fr; 
        width: 100%;
        overflow-x: hidden;
        gap: 0;
        margin: 0;
        padding: 0;
        min-width: 100%;
    }
    .filters { display: none; }
    .desktop-only { display: none !important; }
    .mobile-only { display: block !important; }
    .desktop-category-h1 { display: none !important; }
    .mobile-view-tabs { display: block !important; }
    .scroll-btn { display: none; }
    .header-content { 
        gap: 10px; 
        padding: 12px 0;
        flex-wrap: wrap;
    }
    .logo { 
        flex-shrink: 0;
        margin-right: 10px;
    }
    .logo img { height: 28px; }
    .post-request-btn { display: none; }
    .search-box { 
        display: block !important;
        flex: 1;
        min-width: 0;
        position: relative;
    }
    .search-input {
        padding: 10px 15px 10px 45px;
        font-size: 14px;
        border: 1px solid #e5e7eb;
        background: #f5f5f5;
    }
    .search-icon {
        left: 15px;
        width: 18px;
        height: 18px;
    }
    /* .mobile-nav { display: block; } - removed */
    .help-widget { bottom: 30px; } /* Adjusted after removing mobile nav */
    .container { padding: 0 8px; }
    .simple-header { padding: 20px 0 15px 0; }
    .category-title { font-size: 1.5rem; }
    .category-stats { font-size: 0.875rem; }
    .section-header { 
        flex-direction: column; 
        align-items: flex-start; 
        gap: 12px;
    }
    .section-header .subcategories-inline {
        order: 1;
        width: 100%;
    }
    .section-header .view-options {
        order: 2;
    }
    .section-title { font-size: 1.25rem; }
    .view-options { width: 100%; justify-content: space-between; }
    .view-btn { display: none !important; }
    .sort-select { width: 100%; }
    .products-grid { 
        grid-template-columns: repeat(2, 1fr); 
        gap: 8px; 
        margin: 0;
        padding: 0;
        width: 100%;
    }
    .suppliers-strip { 
        margin-bottom: 20px; 
        padding: 16px 4px; 
        margin-left: -4px;
        margin-right: -4px;
        width: calc(100% + 8px);
        box-sizing: border-box;
    }
    .suppliers-content { 
        justify-content: flex-start; 
        gap: 8px;
        padding-bottom: 10px;
    }
    .supplier-badge { 
        padding: 6px 12px; 
        font-size: 0.85rem;
        min-width: max-content;
    }
    .breadcrumb { font-size: 12px; padding: 10px 0; }
    
    /* Mobile Breadcrumb Adjustments */
    .mobile-breadcrumb {
        padding: 6px 0 2px 0;
        margin-top: 8px; /* Space for fixed tabs (48px) + tiny gap (2px) */
    }
    
    .mobile-breadcrumb-item {
        padding: 5px 10px;
        font-size: 0.75rem;
    }
    
    .mobile-breadcrumb-item span {
        max-width: 100px;
    }
    
    .mobile-subcat-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .mobile-subcategories-wrapper {
        margin-top: 6px;
    }
}

@media (max-width: 768px) {
    .container { padding: 0 4px; }
    
    /* Subcategories mobile styles */
    .subcategories-inline {
        gap: 6px;
        width: 100%;
        justify-content: flex-start;
    }
    .subcategory-tag {
        padding: 5px 12px;
        font-size: 0.8125rem;
    }
    
    .header-content {
        padding: 10px 0;
        min-height: 60px; /* Smaller for mobile */
    }
    
    .logo { 
        flex-shrink: 0;
    }
    
    /* Switch logos on mobile */
    img.logo-desktop { 
        display: none; 
    }
    img.logo-mobile { 
        display: block;
        width: 40px;
        height: 24px;
    }
    
    .search-box {
        width: 100%;
        order: 2;
        margin-top: 8px;
    }
    
    .search-input {
        display: none !important; /* Hide real input on mobile */
    }
    
    /* Mobile search placeholder */
    .mobile-search-placeholder {
        display: block !important;
        width: 100%;
        padding: 8px 12px 8px 40px;
        font-size: 16px; /* Changed to 16px to match input and prevent zoom */
        background: #fafafa;
        border-radius: 20px;
        border: 1px solid transparent;
        position: relative;
        cursor: pointer;
        color: #9ca3af;
        text-align: left;
        -webkit-tap-highlight-color: rgba(0,0,0,0);
        touch-action: manipulation; /* Prevent double-tap zoom */
        -webkit-user-select: none;
        user-select: none;
    }
    
    .mobile-search-placeholder:active {
        background: #f0f0f0;
    }
    
    .search-icon {
        left: 12px;
        width: 16px;
        height: 16px;
    }
    
    /* Mobile Category Header specific styles */
    .mobile-category-header { 
        padding: 12px 0 16px 0; 
        margin-bottom: 0; /* Remove margin to products section */
        background: white;
        border-bottom: 1px solid #e5e7eb;
    }
    
    /* Mobile Products Section */
    .products-section {
        background: #f5f5f5; /* Match body background */
        padding: 0;
        border-radius: 0;
        min-height: auto;
        margin-top: 0;
        width: calc(100% + 8px);
        overflow-x: hidden;
        margin-left: -4px;
        margin-right: -4px;
        padding-left: 4px;
        padding-right: 4px;
        box-sizing: border-box;
    }
    .section-header {
        display: none !important; /* Hide section header on mobile since controls moved to top */
    }
    .mobile-category-header h1 { 
        font-size: 1.25rem; 
        margin-bottom: 6px;
    }
    .mobile-stats { 
        font-size: 0.8rem; 
        margin-bottom: 12px;
    }
    .mobile-product-types-wrapper {
        margin-top: 10px;
    }
    .mobile-product-types { 
        gap: 6px;
        margin-left: -8px;
        margin-right: -8px;
        padding-left: 8px;
        padding-right: 16px;
    }
    .mobile-type-btn { 
        padding: 6px 12px; 
        font-size: 0.8rem; 
        border-radius: 16px;
    }
    .mobile-type-btn .type-count { 
        font-size: 0.7rem; 
    }
    
    /* Hide quote button on mobile */
    .quote-btn {
        display: none !important;
    }
    /* Remove sort dropdown on mobile */
    .sort-select { display: none !important; }
    .section-title { display: none !important; }
    
    /* Make section header full width */
    .section-header {
        justify-content: flex-end;
        padding: 8px 8px;
        display: flex;
        width: 100%;
    }
    
    /* Products grid flush to edges */
    .products-grid {
        margin-top: 0;
    }
    
    /* Suppliers grid on mobile */
    .suppliers-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .supplier-card {
        padding: 16px;
    }
    
    .supplier-header {
        gap: 12px;
    }
    
    .supplier-avatar {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
    
    .supplier-name {
        font-size: 1rem;
    }
    
    .supplier-stats .stat-value {
        font-size: 1.1rem;
    }
    
    .category-cards { 
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        overflow-x: visible;
        padding: 0;
    }
    .cat-card { width: 100%; padding: 10px; }
    .cat-header { gap: 8px; }
    .cat-icon { width: 32px; height: 32px; }
    .cat-icon svg { width: 20px; height: 20px; }
    .cat-name { font-size: 0.75rem; }
    .cat-count { font-size: 0.65rem; }
    .cat-subcats { font-size: 0.6rem; padding-top: 6px; }
    
    /* Mobile product grid optimization */
    .products-grid { 
        grid-template-columns: repeat(2, 1fr); 
        gap: 6px; 
        padding: 0;
    }
    
    /* Enhanced mobile product card design */
    .product-card { 
        border-radius: 10px; 
        border: 1px solid #f0f0f0;
        box-shadow: 0 2px 4px rgba(0,0,0,0.04);
        position: relative;
        overflow: hidden;
    }
    .product-card:hover { 
        box-shadow: 0 4px 12px rgba(0,0,0,0.08); 
        transform: translateY(-1px);
    }
    .product-image { 
        height: 150px; 
        padding: 10px; 
        background: #fafafa;
        border-bottom: 1px solid #f0f0f0;
    }
    .product-badge { 
        padding: 3px 8px; 
        font-size: 0.65rem; 
        top: 8px; 
        right: 8px; 
        border-radius: 4px;
        font-weight: 500;
    }
    .product-info { 
        padding: 10px 10px 4px 10px; 
    }
    .product-name { 
        font-size: 0.8rem; 
        height: 2.4em; 
        margin-bottom: 6px; 
        font-weight: 500;
        line-height: 1.2;
        color: #2c3e50;
    }
    .product-price-range { 
        font-size: 1rem; 
        margin-bottom: 6px; 
        font-weight: 700;
        color: #ff4757;
        text-shadow: 0 1px 2px rgba(0,0,0,0.05);
    }
    .product-price-range .currency { 
        font-size: 0.75rem; 
        color: #7f8c8d;
    }
    .product-specs { 
        font-size: 0.65rem; 
        margin-bottom: 6px; 
        color: #7f8c8d;
        line-height: 1.3;
    }
    .product-specs div { margin-bottom: 2px; }
    .product-supplier { 
        font-size: 0.65rem; 
        margin-bottom: 3px; 
        color: #95a5a6;
    }
    .product-footer { 
        display: flex;
        justify-content: flex-start;
        align-items: center;
        gap: 6px;
    }
    .product-moq { 
        font-size: 0.65rem; 
        color: #7f8c8d;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        flex: 1;
    }
    /* Quote button removed on mobile */
    .pagination { gap: 4px; margin-top: 24px; }
    .pagination a, .pagination span { padding: 6px 10px; font-size: 0.85rem; }
    .category-content { padding: 20px; margin-top: 20px; }
    .quick-categories h2 { font-size: 1.1rem; margin-bottom: 12px; }
    .page-header { 
        position: fixed; 
        width: 100%;
        background: white;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        z-index: 1000; /* Ensure header stays above all content */
    }
    body { padding-top: 100px; padding-bottom: 20px; } /* Adjusted padding after removing mobile nav */
    
    /* Adjust sticky positions */
    .mobile-view-tabs { 
        top: 60px; /* Adjusted for mobile header */
        position: fixed;
        left: 0;
        right: 0;
        width: 100%;
    }
    .mobile-category-header { 
        position: relative; /* Changed from sticky to prevent gap */
        z-index: 1; /* Lower z-index to not overlap filters */
        margin-top: 0; /* Removed margin */
    }
}

@media (max-width: 480px) {
    .container { padding: 0 3px; }
    .search-input {
        padding: 7px 10px 7px 35px;
        font-size: 13px;
    }
    .search-btn {
        display: none; /* Hide search button */
    }
    .search-icon {
        left: 10px;
        width: 14px;
        height: 14px;
    }
    
    /* Ensure exactly 2 columns on small screens including iPhone */
    .products-grid { 
        grid-template-columns: repeat(2, 1fr); 
        gap: 5px; 
    }
    
    /* Compact design for small screens */
    .product-card {
        border-radius: 8px;
    }
    .product-image { 
        height: 130px; 
        padding: 8px;
    }
    .product-badge {
        padding: 2px 6px;
        font-size: 0.6rem;
        top: 6px;
        right: 6px;
    }
    .product-info {
        padding: 8px 8px 2px 8px;
    }
    .product-name {
        font-size: 0.75rem;
        height: 2.2em;
        margin-bottom: 4px;
    }
    .product-price-range {
        font-size: 0.9rem;
        margin-bottom: 4px;
    }
    .product-price-range .currency {
        font-size: 0.7rem;
    }
    .product-specs {
        font-size: 0.6rem;
        margin-bottom: 4px;
    }
    .product-supplier {
        font-size: 0.6rem;
        margin-bottom: 2px;
    }
    .product-moq {
        font-size: 0.6rem;
    }
    /* Quote button removed on mobile */
    
    /* Other optimizations */
    .cat-card { font-size: 0.7rem; padding: 8px; }
    .cat-icon { width: 28px; height: 28px; }
    .cat-icon svg { width: 18px; height: 18px; }
    .cat-name { font-size: 0.7rem; }
    .supplier-badge { padding: 6px 12px; font-size: 0.75rem; }
    .pagination { flex-wrap: wrap; justify-content: center; }
    .section-header { margin-bottom: 12px; }
    .section-title { font-size: 1.1rem; }
}

/* Enhanced mobile product card visual improvements */
@media (max-width: 768px) {
    /* Full width mobile layout */
    body {
        margin: 0;
        width: 100%;
        position: relative;
    }
    
    .container {
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    /* Product grid full width utilization */
    .products-section {
        margin: 0;
        padding: 0 3px;
        box-sizing: border-box;
        width: calc(100% + 6px);
        margin-left: -3px;
        margin-right: -3px;
    }
    
    /* Product card shadow and hover effects */
    .product-card {
        transition: all 0.2s ease;
        -webkit-tap-highlight-color: rgba(0,0,0,0.05);
    }
    
    .product-card:active {
        transform: scale(0.985);
        box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    }
    
    /* Price styling like Alibaba */
    .product-price-range {
        display: flex;
        align-items: baseline;
        gap: 4px;
        flex-wrap: wrap;
    }
    
    /* Make images more appealing */
    .product-image {
        position: relative;
        overflow: hidden;
    }
    
    .product-image img {
        transition: transform 0.3s ease;
    }
    
    .product-card:hover .product-image img {
        transform: scale(1.05);
    }
    
    /* Quote button removed on mobile */
    
    /* Supplier text improvements */
    .product-supplier {
        font-weight: 500;
    }
    
    /* MOQ styling */
    .product-moq {
        /* Remove emoji to save space */
    }
    
    /* Better spacing and visual hierarchy */
    .product-info {
        display: flex;
        flex-direction: column;
    }
    
    .product-footer {
        /* Remove margin-top: auto to avoid extra space */
    }
    
    /* Badge improvements */
    .product-badge {
        text-transform: uppercase;
        letter-spacing: 0.5px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    .product-badge.new {
        background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    }
    
    /* Specs improvements */
    .product-specs {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    /* Ensure 2 columns on all devices */
    .products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        width: 100%;
        margin: 0;
        padding: 0;
    }
    
    /* Made-in-China style on mobile */
    #suppliersView {
        flex-direction: column;
        width: calc(100% + 8px);
        overflow-x: hidden;
        margin-left: -4px;
        margin-right: -4px;
        padding-left: 4px;
        padding-right: 4px;
        box-sizing: border-box;
    }
    
    .mic-sidebar {
        display: none;
    }
    
    .mic-supplier-card {
        flex-direction: column;
        padding: 16px;
        gap: 16px;
        width: 100%;
        box-sizing: border-box;
        display: flex;
    }
    
    /* Hide desktop actions on mobile */
    .mic-supplier-left .mic-supplier-actions {
        display: none;
    }
    
    /* Show mobile actions */
    .mic-supplier-actions-mobile {
        display: flex !important;
        gap: 10px;
        margin-top: 8px;
        width: 100%;
    }
    
    .mic-supplier-actions-mobile .mic-contact-btn,
    .mic-supplier-actions-mobile .mic-chat-btn {
        flex: 1;
        justify-content: center;
        padding: 10px 12px;
    }
    
    .suppliers-list {
        width: 100%;
        padding: 0;
        margin: 0;
    }
    
    .mic-supplier-right {
        width: 100%;
    }
    
    .mic-product-showcase {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        width: 100%;
        overflow: hidden;
    }
    
    .mic-showcase-image {
        width: 100%;
        aspect-ratio: 1;
        max-width: 120px;
        margin: 0 auto;
    }
    
    .mic-detail-label {
        min-width: 80px;
        font-size: 13px;
        flex-shrink: 0;
    }
    
    .mic-detail-value {
        font-size: 13px;
    }
    
    .mic-supplier-actions {
        flex-wrap: wrap;
    }
    
    .mic-contact-btn, .mic-chat-btn {
        flex: 1;
        min-width: 0;
        font-size: 13px;
        padding: 8px 12px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* iPhone specific adjustments */
@media (max-width: 414px) {
    /* iPhone 6/7/8 Plus */
    .products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
    
    /* Make filter button more compact on small screens */
    .mobile-filter-btn-header {
        padding: 6px 10px;
    }
    .mobile-filter-btn-header span {
        font-size: 0.8rem;
    }
    .mobile-filter-btn-header svg {
        width: 16px;
        height: 16px;
    }
}

@media (max-width: 375px) {
    /* iPhone 6/7/8/SE */
    .products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 4px;
    }
}

/* Loading overlay */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.9);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e5e7eb;
    border-top: 3px solid #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mobile Filter Buttons */
.filter-buttons-wrapper {
    display: flex !important;
    gap: 10px;
    padding: 16px 20px !important;
    background: white;
    border-top: 1px solid #f0f0f0;
    position: relative;
    bottom: 0;
    z-index: 10;
    margin-top: auto; /* Push to bottom */
    flex-shrink: 0; /* Don't shrink */
    min-height: auto !important;
}

.filter-reset-btn,
.filter-done-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 22px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    outline: none;
}

.filter-reset-btn {
    background: #ffffff;
    color: #374151;
    border: 1px solid #e5e7eb;
}

.filter-reset-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.filter-reset-btn:active {
    transform: scale(0.98);
}

.filter-done-btn {
    background: #ea580c;
    color: white;
    border: 1px solid #ea580c;
    box-shadow: 0 2px 4px rgba(234, 88, 12, 0.15);
}

.filter-done-btn:hover {
    background: #dc2626;
    border-color: #dc2626;
    box-shadow: 0 4px 8px rgba(220, 38, 38, 0.2);
}

.filter-done-btn:active {
    transform: scale(0.98);
}

/* Update mobile filter styles for cleaner look */
.filters-mobile .filter-section {
    margin-bottom: 0;
    padding: 16px 0;
    border-bottom: 1px solid #f3f4f6;
}

.filters-mobile .filter-section:last-child {
    border-bottom: none;
}

/* Ensure filters form uses full height */
.filters-mobile > form {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0; /* Allow flex to work properly */
}

/* Ensure buttons are always visible at bottom */
@media (max-width: 768px) {
    .filters-mobile .filter-buttons-wrapper {
        position: sticky !important;
        bottom: 0 !important;
        background: white !important;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.1) !important;
    }
}

.filters-mobile .filter-title {
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: #111827;
    padding: 0;
    cursor: default;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-title-more {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #6b7280;
    font-size: 0.8rem;
    font-weight: 400;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.filter-title-more:hover {
    color: #4b5563;
}

.filter-title-more svg {
    width: 14px;
    height: 14px;
    transition: transform 0.2s;
}

.filter-title-more.expanded svg {
    transform: rotate(180deg);
}

/* Hide count numbers in mobile tabs to save space for Filter button */
@media (max-width: 768px) {
    .view-tab-count {
        display: none !important;
    }
}

.filters-mobile .filter-title .arrow {
    display: none;
}

.filters-mobile .filter-content {
    max-height: none;
    overflow: visible;
}

.filters-mobile .filter-content.collapsed {
    display: none;
}

/* Button style filters for mobile */
.filter-buttons-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    position: relative;
    max-height: 80px; /* Оптимальная высота для полного отображения 2 строк кнопок */
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.filter-buttons-grid.expanded {
    max-height: none;
}

.filter-buttons-grid.three-columns {
    /* Same flex layout for consistency */
    max-height: 80px; /* Оптимальная высота для полного отображения 2 строк кнопок */
}

.filter-buttons-grid.three-columns.expanded {
    max-height: none;
}

.filter-buttons-grid.three-columns .filter-button {
    padding: 6px 10px;
    font-size: 0.75rem;
    min-height: 30px;
}

.filter-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 0.8rem;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    min-height: 34px;
    flex: 0 0 auto; /* Размер по содержимому */
    white-space: nowrap;
}

.filter-button:hover {
    background: #f9fafb;
}

.filter-button.selected {
    background: white;
    border-color: #ef4444;
    color: #ef4444;
}

.filter-button.selected::after {
    content: '';
    position: absolute;
    bottom: 6px;
    right: 6px;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 0 10px 10px;
    border-color: transparent transparent #ef4444 transparent;
}

.filter-button input[type="checkbox"] {
    display: none;
}

.filter-button-label {
    display: inline-block;
    text-align: center;
    pointer-events: none;
}


/* Hide old checkbox style in mobile filters */
.filters-mobile .filter-option {
    display: none !important;
}

/* Fix for mobile filter section */
.filters-mobile .filter-sections-wrapper {
    padding-bottom: 16px; /* Small padding at bottom */
    scrollbar-width: thin; /* Firefox */
    -ms-overflow-style: auto; /* IE and Edge */
}
.filters-mobile .filter-sections-wrapper::-webkit-scrollbar {
    width: 4px;
}
.filters-mobile .filter-sections-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
}
.filters-mobile .filter-sections-wrapper::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 2px;
}

/* Improve button touch feedback */
@media (max-width: 768px) {
    button, .quote-btn, .apply-filters-btn, .cat-card {
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }
    
    button:active, .quote-btn:active, .apply-filters-btn:active {
        transform: scale(0.95);
    }
}
/* Subcategories Horizontal Scroll */
.subcategories-scroll-wrapper {
    position: relative;
    margin: 0 -20px;
    padding: 0 20px;
}

.subcategories-horizontal-scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 10px 0;
    scroll-behavior: smooth;
}

.subcategories-horizontal-scroll::-webkit-scrollbar {
    display: none;
}

.subcategory-card-horizontal {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    padding: 12px;
    min-width: 120px;
    max-width: 140px;
    transition: all 0.2s ease;
}

.subcategory-card-horizontal:hover {
    transform: translateY(-2px);
}

.subcategory-image-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: white;
    border: 2px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.subcategory-card-horizontal:hover .subcategory-image-circle {
    border-color: #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.subcategory-image-circle img {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.subcategory-image-circle svg {
    color: #9ca3af;
}

.subcategory-name {
    font-size: 13px;
    font-weight: 500;
    color: #1a1a1a;
    text-align: center;
    line-height: 1.3;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.subcategory-count {
    font-size: 11px;
    color: #6b7280;
    text-align: center;
}

.subcategories-scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: white;
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
    font-size: 20px;
    color: #6b7280;
}

.subcategories-scroll-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #374151;
}

.subcategories-scroll-btn.left {
    left: 0;
}

.subcategories-scroll-btn.right {
    right: 0;
}

@media (max-width: 768px) {
    .subcategories-scroll-wrapper {
        margin: 0;
        padding: 0;
    }
    
    .subcategories-scroll-btn {
        display: none !important;
    }
    
    .subcategory-card-horizontal {
        min-width: 100px;
        max-width: 100px;
    }
    
    .subcategory-image-circle {
        width: 64px;
        height: 64px;
    }
    
    .subcategory-image-circle img {
        width: 48px;
        height: 48px;
    }
}

/* Inline Subcategories with Circles */
.subcategories-inline-scroll-wrapper {
    position: relative;
    margin: 0 -4px 16px -4px;
}

.subcategories-inline {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 8px 4px;
    scroll-behavior: smooth;
}

.subcategories-inline::-webkit-scrollbar {
    display: none;
}

.subcategory-circle-link {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    gap: 8px;
    min-width: 90px;
    max-width: 100px;
}

.subcategory-circle {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: white;
    border: 2px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: all 0.2s ease;
}

.subcategory-circle-link:hover .subcategory-circle {
    border-color: #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
    transform: translateY(-2px);
}

.subcategory-circle img {
    width: 52px;
    height: 52px;
    object-fit: contain;
}

.subcategory-circle svg {
    color: #9ca3af;
}

.subcategory-circle-label {
    font-size: 12px;
    font-weight: 500;
    color: #374151;
    text-align: center;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 32px;
}

.subcategory-circle-link:hover .subcategory-circle-label {
    color: #2563eb;
}

.subcat-scroll-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: white;
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
    font-size: 18px;
    color: #6b7280;
}

.subcat-scroll-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #374151;
}

.subcat-scroll-btn.left {
    left: -8px;
}

.subcat-scroll-btn.right {
    right: -8px;
}

@media (max-width: 768px) {
    .subcategories-inline-scroll-wrapper {
        margin: 0 0 12px 0;
    }
    
    .subcat-scroll-btn {
        display: none !important;
    }
    
    .subcategory-circle-link {
        min-width: 80px;
        max-width: 85px;
    }
    
    .subcategory-circle {
        width: 60px;
        height: 60px;
    }
    
    .subcategory-circle img {
        width: 45px;
        height: 45px;
    }
    
    .subcategory-circle-label {
        font-size: 11px;
    }
}

/* Buy Request Card - занимает место 2 товаров в grid */
.buy-request-card {
    grid-column: span 2;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 20px;
    color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.buy-request-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.buy-request-title-block {
    flex: 1;
}

.buy-request-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
    color: white;
    line-height: 1.3;
}

.buy-request-subtitle {
    font-size: 14px;
    opacity: 0.95;
    font-weight: 400;
}

.buy-request-badge {
    background: #ef4444;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.buy-request-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.buy-request-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.buy-request-field label {
    font-size: 13px;
    font-weight: 600;
    opacity: 0.95;
}

.buy-request-field input,
.buy-request-field select {
    padding: 10px 12px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.95);
    color: #1f2937;
}

.buy-request-field input::placeholder {
    color: #9ca3af;
}

.buy-request-field input:focus,
.buy-request-field select:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

.buy-request-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    padding: 4px 0;
    align-items: center;
}

.buy-request-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 400;
    white-space: nowrap;
}

.buy-request-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: white;
    flex-shrink: 0;
}

.buy-request-checkbox span {
    user-select: none;
}

.buy-request-other {
    display: inline-flex;
    align-items: center;
    flex: 1;
    min-width: 200px;
}

.buy-request-other-input {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.95);
    color: #1f2937;
    transition: all 0.2s;
    min-width: 150px;
}

.buy-request-other-input::placeholder {
    color: #9ca3af;
    font-style: italic;
}

.buy-request-other-input:focus {
    outline: 2px solid white;
    outline-offset: 2px;
    background: rgba(255, 255, 255, 1);
}

.buy-request-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.buy-request-submit {
    background: #f97316;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.buy-request-submit:hover {
    background: #ea580c;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.buy-request-submit:active {
    transform: translateY(0);
}

/* Popular Categories Card - занимает место 2 товаров в grid */
.popular-categories-card {
    grid-column: span 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    min-height: 380px;
}

.popular-left {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    padding: 24px;
    color: white;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.popular-title {
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
}

.popular-in {
    font-size: 18px;
    font-weight: 600;
}

.popular-badge {
    background: linear-gradient(90deg, #fbbf24 0%, #f59e0b 100%);
    color: #78350f;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    align-self: flex-start;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.popular-badge::after {
    content: '›';
    font-size: 24px;
}

.popular-top-products {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: auto;
}

.popular-product-item {
    position: relative;
    aspect-ratio: 1;
}

.popular-product-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    color: #78350f;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.popular-product-image {
    display: block;
    width: 100%;
    height: 100%;
    background: white;
    border-radius: 50%;
    padding: 8px;
    box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.5);
    transition: transform 0.2s;
}

.popular-product-image:hover {
    transform: scale(1.05);
}

.popular-product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

.popular-product-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #d1d5db;
}

.popular-right {
    background: #fef2f2;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    max-height: 380px;
    /* Тонкий скроллбар */
    scrollbar-width: thin;
    scrollbar-color: #dc2626 #fecaca;
}

.popular-right::-webkit-scrollbar {
    width: 6px;
}

.popular-right::-webkit-scrollbar-track {
    background: #fecaca;
}

.popular-right::-webkit-scrollbar-thumb {
    background: #dc2626;
    border-radius: 3px;
}

.popular-right::-webkit-scrollbar-thumb:hover {
    background: #b91c1c;
}

/* Внутренний контейнер для padding */
.popular-right-inner {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.popular-searches-title {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
    flex-shrink: 0;
}

.popular-searches-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.popular-search-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: white;
    border-radius: 8px;
    color: #1f2937;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.popular-search-item:hover {
    background: #dc2626;
    color: white;
    transform: translateX(4px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.popular-search-item svg {
    flex-shrink: 0;
    opacity: 0.5;
}

.popular-search-item:hover svg {
    opacity: 1;
}

/* Mobile адаптация для блока Popular Categories */
@media (max-width: 768px) {
    .popular-categories-card {
        grid-column: 1 / -1;
        grid-template-columns: 1fr;
        min-height: auto;
    }
    
    .popular-left {
        padding: 20px;
        gap: 12px;
    }
    
    .popular-title {
        font-size: 20px;
    }
    
    .popular-in {
        font-size: 16px;
    }
    
    .popular-badge {
        font-size: 16px;
        padding: 8px 16px;
    }
    
    .popular-top-products {
        gap: 8px;
    }
    
    .popular-product-badge {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    
    .popular-right {
        max-height: none;
        overflow-y: visible;
    }
    
    .popular-right-inner {
        padding: 20px;
    }
    
    .popular-searches-title {
        font-size: 16px;
    }
    
    .popular-search-item {
        padding: 10px 14px;
        font-size: 14px;
    }
}

/* Mobile адаптация для блока Buy Request */
@media (max-width: 768px) {
    .buy-request-card {
        grid-column: 1 / -1; /* Занимает всю ширину на мобильных */
        padding: 16px;
        gap: 12px;
    }
    
    .buy-request-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .buy-request-badge {
        align-self: flex-start;
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .buy-request-title {
        font-size: 16px;
        margin-bottom: 2px;
    }
    
    .buy-request-subtitle {
        font-size: 12px;
    }
    
    .buy-request-form {
        gap: 8px;
    }
    
    .buy-request-field {
        gap: 4px;
    }
    
    .buy-request-field label {
        font-size: 12px;
    }
    
    .buy-request-field input,
    .buy-request-field select {
        padding: 8px 10px;
        font-size: 13px;
    }
    
    .buy-request-checkboxes {
        gap: 8px 12px;
    }
    
    .buy-request-checkbox {
        font-size: 12px;
    }
    
    .buy-request-other {
        width: 100%;
        min-width: 100%;
        flex-direction: column;
        align-items: stretch;
    }
    
    .buy-request-other-input {
        width: 100%;
        min-width: 100%;
        padding: 8px 10px;
        font-size: 13px;
    }
    
    .buy-request-row {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    
    .buy-request-submit {
        padding: 10px 20px;
        font-size: 14px;
        margin-top: 0;
    }
}
