.products-page {
    background: #ffffff;
    min-height: 100vh;
    color: #000000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin-top: 15px;
}

.products-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Фоновое изображение платформы */
.platform-header {
    margin-bottom: -5px;
}

.platform-top {
    position: relative;
    height: 230px;
    overflow: hidden;
    border-radius: 12px;
}

.platform-top-img {
    width: 100%;
    height: 100%;
}

.platform-top-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.platform-default-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
}

.platform-panel {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: -40px;
    padding: 0 20px;
    position: relative;
    z-index: 2;
}

.platform-panel-img {
    width: 120px;
    height: 120px;
    border-radius: 12px;
    border: 4px solid white;
    background: white;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.platform-panel-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.platform-default-icon {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
}

.platform-panel-title {
    flex: 1;
}

.platform-title {
    font-size: 2rem;
    font-weight: 700;
    color: #000;
    margin: 0;
}

.platform-description {
    font-size: 1.1rem;
    color: #666;
    margin: 5px 0 0 0;
    margin-bottom: -32px;
}

/* Десктопные категории */
.products-desktop-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 30px;
    padding: 20px 0;
    border-bottom: 1px solid #e5e5e5;
}

.products-desktop-category-btn {
    padding: 14px 22px;
    background: #f4f4f7;
    border-radius: 15px;
    color: #000;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.products-desktop-category-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

/* Верхняя панель */
.products-top-panel {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    padding: 15px 0;
}

.products-search-left {
    flex: 1;
    min-width: 300px;
    max-width: 400px;
}

.products-header {
    flex: 2;
    text-align: center;
    min-width: 200px;
}

.products-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 350px;
    justify-content: flex-end;
}

/* Поисковая форма */
.products-search-form {
    display: flex;
    align-items: center;
    width: 100%;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 12px;
    color: #6c757d;
    z-index: 2;
    pointer-events: none;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
}

.products-search-input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
    background: #f8f9fa;
    color: #000;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.products-search-input:focus {
    outline: none;
    border-color: #007bff;
    background: white;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

/* Стили для выпадающих списков */
.product-status-dropdown {
    position: relative;
    display: inline-block;
}

.status-dropdown-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 8px 12px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 140px;
    height: 36px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.status-dropdown-btn:hover {
    border-color: #d1d5db;
    background: #e9ecef;
}

.status-dropdown-btn svg {
    transition: transform 0.2s;
    flex-shrink: 0;
}

.status-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    min-width: 100%;
    max-height: 300px;
    overflow-y: auto;
}

.status-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.status-dropdown-item {
    display: block;
    padding: 10px 12px;
    font-size: 14px;
    color: #374151;
    text-decoration: none;
    transition: all 0.2s;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    white-space: nowrap;
    text-align: left;
}

.status-dropdown-item:last-child {
    border-bottom: none;
}

.status-dropdown-item:hover {
    background: #f9fafb;
    color: #111827;
}

.status-dropdown-item.active {
    background: #f0f9ff;
    color: #0369a1;
    font-weight: 500;
}

/* Кнопка характеристик */
.products-characteristics-btn {
    padding: 8px 12px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
    height: 36px;
    white-space: nowrap;
    min-width: 140px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.products-characteristics-btn:hover {
    border-color: #d1d5db;
    background: #e9ecef;
}

/* Информация о результатах */
.products-results-info {
    background: #f8f9fa;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid #e5e5e5;
}

.products-results-info p {
    margin: 4px 0;
    color: #6c757d;
    font-size: 14px;
}

.products-results-info strong {
    color: #000;
}
/* Сетка товаров */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); /* Изменено с 250px на 200px */
    gap: 20px;
    margin-bottom: 40px;
}

/* Десктоп - 5 товаров в ряд */
@media (min-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
}

/* Планшет - 3-4 товара */
@media (min-width: 768px) and (max-width: 1199px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
}

/* Телефон - 2 товара в ряд */
@media (max-width: 767px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .products-image {
        height: 140px; /* Немного уменьшим высоту изображения */
    }
    
    .products-info {
        padding: 12px;
    }
    
    .products-title {
        font-size: 14px;
    }
    
    .products-description {
        font-size: 12px;
        line-height: 1.3;
    }
    
    .products-price {
        font-size: 16px;
    }
    
    .product-characteristics-preview {
        display: none; /* Скрываем характеристики на телефоне для экономии места */
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .products-image {
        height: 180px; 
    }
    
    .products-info {
        padding: 16px;
    }
}

.products-card {
    background: white;
    padding: 0;
    cursor: pointer;
    overflow: hidden;
}

.products-image {
    position: relative;
    margin-bottom: 0;
    height: 180px;
    overflow: hidden;
    background: #f8f9fa;
    border-radius: 10px;
}

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

.products-image-placeholder {
    width: 100%;
    height: 100%;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #6c757d;
}

.products-info {
    color: #000;
    padding: 2px;
    margin-top: 5px;

}

.products-category {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.products-title {
    font-size: 16px;
    line-height: 1.3;
    font-weight: 500;
    color: #000;
}

/* Характеристики товара */
.product-characteristics-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin: 10px 0;
}

.product-characteristic-tag {
    background: #e3f2fd;
    color: #1976d2;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
}

.product-characteristic-more {
    background: #f8f9fa;
    color: #666;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
}

.products-description {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 12px;
    line-height: 1.4;
}

.products-meta {

}

.products-seller-info {
    font-size: 13px;
    color: #6c757d;
    margin-bottom: 8px;
}

.products-seller-name {
    color: #007bff;
    font-weight: 500;
}

.products-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #6c757d;
}

.products-stars {
    display: flex;
    gap: 1px;
}

.products-star {
    color: #dee2e6;
    font-size: 14px;
}

.products-star.filled {
    color: #ffc107;
}

.products-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.products-price {
    font-size: 18px;
    font-weight: 600;
    color: #000;
}

/* Пагинация */
.products-pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 40px;
}

.products-page-link {
    padding: 8px 12px;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    color: #000;
    text-decoration: none;
    font-size: 14px;
    transition: none;
}

.products-page-link.current {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

/* Нет товаров */
.products-no-products {
    text-align: center;
    padding: 60px 20px;
    grid-column: 1 / -1;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e5e5e5;
}

.products-no-products-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    color: #6c757d;
}

.products-no-products h3 {
    margin: 0 0 12px 0;
    color: #000;
    font-size: 1.5rem;
    font-weight: 600;
}

.products-no-products p {
    margin: 0 0 20px 0;
    color: #6c757d;
    font-size: 1rem;
}

.products-btn {
    display: inline-block;
    padding: 12px 24px;
    background: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    transition: none;
}

/* Модальное окно характеристик */
.characteristics-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    padding: 20px;
}

.characteristics-modal.show {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.characteristics-modal-content {
    background: white;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: overlay;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.characteristics-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e5e5e5;
    flex-shrink: 0;
}

.characteristics-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #000;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.characteristics-blocks {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    padding-bottom: 0;
}

.characteristic-group {
    margin-bottom: 25px;
}

.characteristic-group h4 {
    font-size: 14px;
    font-weight: 600;
    color: #000;
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.characteristic-values {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.characteristic-block {
    padding: 10px 16px;
    background: #f8f9fa;
    border: 1px solid #e5e5e5;
    border-radius: 15px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    text-align: center;
    user-select: none;
    font-weight: 500;
    white-space: nowrap;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: none;
}

.characteristic-block.selected {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.characteristics-modal-footer {
    padding: 20px;
    border-top: 1px solid #e5e5e5;
    flex-shrink: 0;
    background: white;
    border-radius: 0 0 12px 12px;
}

.show-products-btn {
    width: 100%;
    padding: 15px 20px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}




/* Обертка для категорий с кнопками прокрутки - только десктоп */
@media (min-width: 769px) {
    .products-categories-wrapper {
        position: relative;
        display: flex;
        align-items: center;
        margin-bottom: 30px;
        padding: 20px 0;
        border-bottom: 1px solid #e5e5e5;
        background: #ffffff;
    }

    /* Контейнер для категорий */
    .products-desktop-categories {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 8px;
        padding: 0;
        margin: 0;
        border-bottom: none;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        flex: 1;
    }

    .products-desktop-categories::-webkit-scrollbar {
        display: none;
    }

    .categories-scroll-btn {
        flex-shrink: 0;
        width: 45px;
        height: 45px;
        border-radius: 50%;
        background: white;
        border: 1px solid #dee2e6;
        color: #374151;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s ease;
        margin: 0 5px;
        padding: 0;
        box-shadow: 0 2px 6px rgba(0,0,0,0.1);
        z-index: 10;
    }

    .categories-scroll-btn:hover {
        background: #f8f9fa;
        border-color: #007bff;
        color: #007bff;
        transform: scale(1.05);
    }

    .categories-scroll-btn:active {
        transform: scale(0.95);
    }

    .categories-scroll-btn:disabled {
        opacity: 0.4;
        cursor: not-allowed;
        pointer-events: none;
    }

    .categories-scroll-btn svg {
        width: 20px;
        height: 20px;
    }
}








/* Анимация */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.characteristics-modal-content {
    animation: modalSlideIn 0.3s ease-out;
}

/* Адаптивность для мобильных */
@media (max-width: 768px) {

    .categories-scroll-btn {
        display: none;
    }
    .platform-panel {
        flex-direction: column;
        text-align: center;
        gap: 15px;
        margin-top: -30px;
        padding: 0 15px;
    }
    
    .platform-panel-img {
        width: 100px;
        height: 100px;
    }
    
    .platform-title {
        font-size: 1.5rem;
    }
    
    .platform-description {
        font-size: 0.95rem;
        margin-bottom: 0;
    }
    
    .platform-top {
        height: 150px;
    }
    .products-title {
        font-size: 14px;
    }

    .products-price {
        font-size: 15px;
    }
    
    .products-desktop-categories {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding: 15px 0;
        margin-bottom: 20px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    
    .products-desktop-categories::-webkit-scrollbar {
        display: none;
    }
    
    .products-desktop-category-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
    
    .products-top-panel {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .products-search-left {
        width: 100%;
        max-width: 100%;
        min-width: auto;
        order: 1;
    }
    
    .products-header {
        width: 100%;
        min-width: auto;
        order: 2;
    }
    
    .products-controls {
        width: 100%;
        min-width: auto;
        order: 3;
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 8px;
        overflow: visible;
    }
    
    .status-dropdown-btn,
    .products-characteristics-btn {
        flex: 0;
        min-width: 107px;
        font-size: 13px;
        padding: 8px 10px;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .products-container {
        padding: 0 10px;
    }
    .container {
        padding: 1px;
    }

    .products-image {
        height: 145px;
    }

    .products-info {
        margin-top: 2px;
    }
}

@media (max-width: 480px) {
    .platform-panel {
        margin-top: -25px;
        gap: 10px;
    }
    .products-image {
        height: 135px;
        max-width: 190px;
    }
    
    .platform-panel-img {
        width: 80px;
        height: 80px;
    }
    
    .platform-title {
        font-size: 1.3rem;
        line-height: 1.2;
    }
    
    .platform-description {
        font-size: 0.9rem;
        line-height: 1.3;
    }
    
    .platform-top {
        height: 120px;
    }
    
    .products-controls {
        flex-direction: row;
        align-items: stretch;
        gap: 10px;
        flex-wrap: nowrap;
        overflow: visible;
        flex-wrap: wrap;
        justify-content: flex-start;
    }
    
    .status-dropdown-btn,
    .products-characteristics-btn {
        padding: 7px 8px;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .products-container {
        padding: 0 10px;
    }
}

/* Улучшаем выпадающие меню на маленьких экранах */
@media (max-width: 360px) {
    .status-dropdown-btn,
    .products-characteristics-btn {
        min-width: 120px;
        font-size: 11px;
        padding: 7px 8px;
    }
    
    .status-dropdown-menu {
        min-width: 150px;
        right: 0;
        left: auto;
    }
}

/* Фикс для выпадающих списков */
.product-status-dropdown {
    position: relative;
    z-index: 1000;
}

.status-dropdown-menu {
    z-index: 1001;
}


.loading-indicator {
    text-align: center;
    padding: 30px;
    margin: 20px 0;
}

.loading-indicator .spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

.end-message {
    text-align: center;
    padding: 30px;
    margin: 20px 0;
    color: #666;
    border-top: 1px solid #eee;
}

.load-more-btn {
    display: block;
    width: 100%;
    max-width: 1200px;
    margin: 30px auto;
    padding: 12px 24px;
    background: #3169e3;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
}



.load-more-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

/* Исправляем проблему с z-index для мобильного меню */
#mobile-menu {
    z-index: 999999 !important; /* Супер высокий z-index */
}

#overlay {
    z-index: 999998 !important; /* Чуть ниже меню, но выше всего остального */
}

/* Когда меню открыто, скрываем выпадающие списки */
body.no-scroll .status-dropdown-menu.show,
body.no-scroll .characteristics-modal {
    display: none !important;
}

/* Для самых приоритетных элементов увеличиваем z-index еще больше */
#mobile-menu.active,
#overlay.active {
    z-index: 1000000 !important;
}

/* Убеждаемся, что мобильное меню поверх всего */
#mobile-menu * {
    position: relative;
    z-index: inherit;
}



/* Дополнительно: скрыть выпадающие меню при открытом мобильном меню */
body.no-scroll .product-status-dropdown .status-dropdown-menu {
    visibility: hidden !important;
    opacity: 0 !important;
}





