/* Компактные стили для таблицы товаров */

.product_list__items {
    font-size: 14px;
    margin-bottom: 30px;
    overflow-x: auto;
}

.product_list__items table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    min-width: 1000px; /* Увеличено для более широкой колонки названия */
    border-radius: 0;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    table-layout: fixed; /* Фиксированная ширина колонок */
}

/* Заголовки таблицы */
.product_list__items thead {
    background: #f8f8f8;
}

.product_list__items thead div {
    background: transparent;
}

.product_list__items thead td {
    padding: 8px 6px;
    font-weight: 700;
    font-size: 14px !important;
    color: #000;
    text-align: right !important;
    vertical-align: middle;
    border-bottom: 1px solid #e8e8e8;
    background: #f8f8f8;
    white-space: normal; /* Разрешаем перенос текста */
    word-wrap: break-word;
    line-height: 1.3;
}

/* Заголовок цены остается справа (уже настроен) */
.product_list__items thead td.td-product-price-header {
    text-align: right !important;
}

.product_list__items thead td div {
    font-weight: 700;
    color: #000;
    text-align: right !important;
}

/* Заголовок цены остается справа */
.product_list__items thead td.td-product-price-header div {
    text-align: right !important;
}

.product_list__items thead td:first-child {
    padding-left: 8px;
}

.product_list__items thead tr:first-child td:first-child {
    border-top-left-radius: 0;
}

.product_list__items thead tr:first-child td:last-child {
    border-top-right-radius: 0;
}

/* Колонка с фото - самая узкая */
.td-product-img {
    width: 70px !important;
    min-width: 70px !important;
    max-width: 70px !important;
    padding: 6px 4px !important;
    text-align: right;
    vertical-align: middle;
}

.td-product-img div {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 40px;
    height: 40px;
    margin-left: auto;
}

.td-product-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Колонка с названием - самая широкая */
.td-product-title,
td.td-product-title,
.product_list__items thead td.td-product-title,
.product_list__items thead td:nth-child(2),
.product_list__items tbody td.td-product-title,
.product_list__items tbody td:nth-child(2) {
    padding: 8px 12px !important;
    text-align: right !important;
    vertical-align: middle;
    min-width: 400px !important;
    width: auto !important; /* Занимает оставшееся пространство */
}

.td-product-title a {
    color: #333;
    text-decoration: none;
    font-size: 13px;
    line-height: 1.4;
    transition: color 0.2s ease;
}

.td-product-title a:hover {
    color: #f0cf4c;
    text-decoration: underline;
}

/* Колонки с параметрами - одинаковой ширины */
.td-product-atribit {
    padding: 8px 6px !important;
    text-align: right;
    vertical-align: middle;
    font-size: 12px;
    color: #555;
    white-space: normal; /* Разрешаем перенос текста */
    word-wrap: break-word;
    width: 120px !important;
    min-width: 120px !important;
    max-width: 120px !important;
}

/* Колонка с ценой - самая узкая */
.td-product-price {
    width: 120px !important;
    min-width: 120px !important;
    max-width: 120px !important;
    padding: 8px 6px !important;
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
}

/* Заголовок колонки цены - выравнивание вправо */
.td-product-price-header {
    width: 120px !important;
    min-width: 120px !important;
    max-width: 120px !important;
    padding: 8px 6px !important;
    text-align: right;
    vertical-align: middle;
    white-space: normal; /* Разрешаем перенос текста */
    word-wrap: break-word;
}

.td-product-price-header div {
    text-align: right;
}

.td-product-price a {
    color: #333;
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s ease;
}

.td-product-price a:hover {
    color: #f0cf4c;
    text-decoration: underline;
}

/* Компактная структура card-line__right внутри таблицы */
.td-product-price .card-line__right {
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    min-width: auto;
    width: 100%;
}

.td-product-price .card-line__right-inner {
    width: 100%;
    display: flex;
    justify-content: flex-end;
}

.td-product-price .card-line__right-price {
    text-align: right;
}

.td-product-price .card-line__price-current {
    font-size: 12px;
    font-weight: 700;
    color: #000;
    line-height: 1.2;
    text-align: right;
}

.td-product-price .card-line__buy {
    padding: 5px 12px;
    font-size: 11px;
    width: auto;
    min-width: 70px;
    text-align: center;
}

.td-product-price .card-line__buy span {
    font-size: 11px;
}

/* Строки товаров */
.product_list__items tbody tr {
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.2s ease;
    background-color: #fff;
}

.product_list__items tbody tr:hover {
    background-color: #f8f9fa;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.product_list__items tbody tr:last-child {
    border-bottom: none;
}

.product_list__items tbody tr:last-child td:first-child {
    border-bottom-left-radius: 0;
}

.product_list__items tbody tr:last-child td:last-child {
    border-bottom-right-radius: 0;
}

.product_list__items tbody td {
    padding: 8px 4px;
    text-align: right !important;
    vertical-align: middle;
    font-size: 13px;
}

/* Первая колонка (фото) - выравнивание вправо */
.product_list__items tbody td:nth-child(1),
.product_list__items tbody td.td-product-img {
    text-align: right !important;
}

/* Колонка с названием - выравнивание вправо */
.product_list__items tbody td.td-product-title {
    text-align: right !important;
}

/* Колонки с параметрами - выравнивание вправо */
.product_list__items tbody td.td-product-atribit,
.product_list__items tbody td.td-filter {
    text-align: right !important;
}

/* Колонка цены остается справа (уже настроена) */
.product_list__items tbody td.td-product-price {
    text-align: right !important;
}

/* Стили для фильтров в заголовках - одинаковой ширины */
.td-filter {
    width: 120px !important;
    min-width: 120px !important;
    max-width: 120px !important;
    text-align: right;
}

/* Адаптивность */
@media (max-width: 1200px) {
    .td-product-title {
        min-width: 300px !important;
    }
    
    .td-product-atribit {
        font-size: 12px;
        padding: 10px 8px !important;
    }
}

@media (max-width: 992px) {
    .product_list__items {
        overflow-x: scroll;
    }
    
    .product_list__items table {
        min-width: 1100px; /* Увеличено для более широкой колонки названия */
    }
    
    .td-product-img {
        width: 60px;
        min-width: 60px;
        max-width: 60px;
        padding: 8px 10px !important;
    }
    
    .td-product-img div {
        width: 40px;
        height: 40px;
    }
    
    .td-product-title {
        min-width: 250px !important;
        padding: 10px 12px !important;
    }
    
    .td-product-title a {
        font-size: 13px;
    }
    
    .td-product-atribit {
        font-size: 12px;
        padding: 10px 6px !important;
    }
    
    .td-filter {
        width: 100px !important;
        min-width: 100px !important;
        max-width: 100px !important;
    }
    
    .td-filter__label {
        font-size: 12px;
    }
}

@media (max-width: 768px) {
    .product_list__items {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .product_list__items table {
        min-width: 600px;
        width: 100%;
    }
    
    .product_list__items thead td {
        padding: 10px 8px;
        font-size: 12px;
    }
    
    .td-product-img {
        width: 60px;
        min-width: 60px;
        max-width: 60px;
        padding: 8px 6px !important;
    }
    
    .td-product-img div {
        width: 50px;
        height: 50px;
    }
    
    .td-product-img img {
        max-width: 50px;
        max-height: 50px;
    }
    
    .td-product-title {
        min-width: 200px !important;
        padding: 10px 8px !important;
    }
    
    .td-product-title a {
        font-size: 13px;
        line-height: 1.4;
    }
    
    .td-product-price {
        width: 100px;
        min-width: 100px;
        max-width: 100px;
        padding: 10px 8px !important;
        text-align: left;
    }
    
    .td-product-price-header {
        width: 100px;
        min-width: 100px;
        max-width: 100px;
        padding: 10px 8px !important;
        text-align: right;
    }
    
    .td-product-price-header div {
        text-align: right;
    }
    
    .td-product-price a {
        font-size: 13px;
        white-space: nowrap;
    }
    
    .product_list__items tbody tr {
        border-bottom: 1px solid #f0f0f0;
    }
    
    .product_list__items tbody td {
        padding: 10px 8px;
        font-size: 13px;
    }
    
    .product_list__items tfoot td {
        padding: 16px 8px;
    }
}

@media (max-width: 576px) {
    /* Карточки для маленьких экранов */
    .product_list__items tbody tr.ms2_product {
        padding: 12px;
        margin-bottom: 12px;
    }
    
    .product_list__items tbody tr.ms2_product .td-product-img div {
        max-width: 150px;
    }
    
    .product_list__items tbody tr.ms2_product .td-product-img img {
        max-height: 150px;
    }
    
    .product_list__items tbody tr.ms2_product .td-product-title a {
        font-size: 14px;
    }
    
    .product_list__items tbody tr.ms2_product .td-product-price a {
        padding: 10px 20px;
        font-size: 14px;
        width: 100%;
        text-align: center;
    }
}

/* Футер таблицы */
.product_list__items tfoot {
    background: transparent;
}

.product_list__items tfoot td {
    padding: 20px 10px;
    text-align: center;
    border-top: 1px solid #e8e8e8;
}

