/* Листинги товарных групп */

/* Общие стили страниц */
.listings-index-page,
.listing-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Хлебные крошки */
.listing-breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #6b7280;
}

.listing-breadcrumbs a {
    color: #667eea;
    text-decoration: none;
}

.listing-breadcrumbs a:hover {
    text-decoration: underline;
}

.listing-breadcrumbs .sep {
    color: #d1d5db;
}

.listing-breadcrumbs .current {
    color: #1f2937;
}

/* Заголовки */
.listings-title,
.listing-title {
    font-size: 32px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 15px;
    line-height: 1.2;
}

/* Информация */
.listings-info,
.listing-info {
    color: #6b7280;
    margin-bottom: 20px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.listing-info span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* Алфавитный фильтр */
.listings-alphabet {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 25px;
    padding: 15px;
    background: #f9fafb;
    border-radius: 10px;
}

.letter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    font-size: 14px;
    font-weight: 500;
    color: #4b5563;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s;
}

.letter-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.letter-btn.active {
    background: #667eea;
    border-color: #667eea;
    color: #fff;
}

/* Сетка групп для индекса */
.listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.listing-group-card {
    display: block;
    padding: 15px 20px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.2s;
}

.listing-group-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.group-card-name {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 5px;
}

.group-card-info {
    font-size: 13px;
    color: #6b7280;
}

/* Фильтры на странице листинга */
.listing-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
    padding: 15px 20px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    margin-bottom: 20px;
}

.filter-group {
    flex: 1;
    min-width: 180px;
}

.filter-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 6px;
}

.listing-filter {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    color: #1f2937;
    cursor: pointer;
    transition: all 0.2s;
}

.listing-filter:hover {
    border-color: #9ca3af;
}

.listing-filter:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.filter-reset {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-reset:hover {
    background: #f9fafb;
    color: #1f2937;
    border-color: #9ca3af;
}

/* Описание группы */
.listing-description {
    padding: 20px;
    background: #f9fafb;
    border-radius: 10px;
    margin-bottom: 25px;
    line-height: 1.7;
    color: #4b5563;
}

/* Сетка товаров */
.listing-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.listing-product-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    text-decoration: none;
    overflow: hidden;
    transition: all 0.2s;
}

.listing-product-card:hover {
    border-color: #667eea;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.15);
    transform: translateY(-3px);
}

.product-card-photo {
    aspect-ratio: 1;
    background: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-card-photo img {
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
}

.product-card-content {
    flex: 1;
    padding: 15px;
}

.product-card-name {
    font-size: 15px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-vendor {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 6px;
}

.product-card-desc {
    font-size: 13px;
    color: #9ca3af;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-top: 1px solid #f3f4f6;
    background: #fafafa;
}

.product-card-price {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
}

.product-card-stock {
    font-size: 13px;
    font-weight: 500;
}

.product-card-stock.in {
    color: #10b981;
}

.product-card-stock.out {
    color: #ef4444;
}

/* Краткое описание */
.listing-short-desc {
    font-size: 16px;
    color: #4b5563;
    line-height: 1.6;
    margin: 0 0 15px;
    padding: 15px 20px;
    background: #f0f9ff;
    border-left: 4px solid #667eea;
    border-radius: 0 8px 8px 0;
}

/* Блок с информацией о товаре */
.listing-info-block {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Характеристики */
.listing-params {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 25px;
}

.listing-params h2 {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 20px;
}

.params-table {
    width: 100%;
    border-collapse: collapse;
}

.params-table tr {
    border-bottom: 1px solid #f3f4f6;
}

.params-table tr:last-child {
    border-bottom: none;
}

.params-table th,
.params-table td {
    padding: 12px 15px;
    text-align: left;
    vertical-align: top;
}

.params-table th {
    font-weight: 600;
    color: #6b7280;
    width: 35%;
    background: #f9fafb;
}

.params-table td {
    color: #1f2937;
}

/* Полное описание */
.listing-full-description {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 25px;
}

.listing-full-description h2 {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 20px;
}

.description-content {
    line-height: 1.8;
    color: #4b5563;
}

.description-content h3,
.description-content h4 {
    color: #1f2937;
    margin: 20px 0 10px;
}

.description-content ul,
.description-content ol {
    margin: 10px 0;
    padding-left: 25px;
}

.description-content li {
    margin: 5px 0;
}

.description-content p {
    margin: 10px 0;
}

/* Инструкция */
.listing-instruction {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 25px;
}

.listing-instruction h2 {
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 20px;
}

.instruction-content {
    line-height: 1.8;
    color: #4b5563;
}

/* Адаптив для таблицы характеристик */
@media (max-width: 640px) {
    .params-table th,
    .params-table td {
        display: block;
        width: 100%;
        padding: 8px 12px;
    }
    
    .params-table th {
        padding-bottom: 4px;
        background: transparent;
    }
    
    .params-table td {
        padding-top: 0;
        padding-bottom: 12px;
    }
    
    .params-table tr {
        border-bottom: 1px solid #e5e7eb;
        padding: 8px 0;
    }
}

/* Пагинация */
.listings-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 30px 0;
}

.page-num,
.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    font-size: 14px;
    font-weight: 500;
    color: #4b5563;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s;
}

.page-num:hover,
.page-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.page-num.active {
    background: #667eea;
    border-color: #667eea;
    color: #fff;
}

.page-dots {
    color: #9ca3af;
    padding: 0 5px;
}

/* Пустые состояния */
.listings-empty,
.listing-no-products {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
    font-size: 16px;
}

/* 404 */
.listing-not-found {
    text-align: center;
    padding: 80px 20px;
}

.listing-not-found h1 {
    font-size: 28px;
    color: #1f2937;
    margin-bottom: 15px;
}

.listing-not-found p {
    color: #6b7280;
    margin-bottom: 15px;
}

.btn-listings,
.btn-catalog {
    display: inline-block;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: #667eea;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s;
    margin: 5px;
}

.btn-listings:hover,
.btn-catalog:hover {
    background: #5a67d8;
}

/* Адаптив */
@media (max-width: 768px) {
    .listings-title,
    .listing-title {
        font-size: 24px;
    }
    
    .listings-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .listing-products-grid {
        grid-template-columns: 1fr;
    }
    
    .listing-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        min-width: 100%;
    }
    
    .filter-reset {
        width: 100%;
    }
    
    .listings-alphabet {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .listings-grid {
        grid-template-columns: 1fr;
    }
    
    .listings-pagination {
        flex-wrap: wrap;
    }
}
