/* header/footer в common.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-universal)
}

body {
    background-color: #f9f9f9;
    color: var(--text-color-dark);
    line-height: 1.6;
}

.main_container {
    width: 80%;
    display: flex;
    margin: 0 auto;
    gap: 30px;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    /*padding: 0 10px;*/
}


h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-h)
}

.main_header_h1 {
    width: 100%;
    /* padding: 0px 30px 0px 30px; */
    text-align: center;
    align-items: center; 
    margin-top: 30px;
    margin-bottom: 30px;
    color: #3c3c3c;
    font-family: var(--font-h)
}

/* Панель фильтров (слева) */
.filters-panel {
    width: 280px;
    flex-shrink: 0;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: calc(var(--header-height) + 20px);
    margin-bottom: 30px; 
    align-self: flex-start;
    height: fit-content;

}

.filter-group {
    display: flex;  
    flex-wrap: wrap;       
    gap: 10px;            
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
    color: var(--text-color-dark);
}

.filter-group:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.filter-group_header {
    margin-top: 0;
    width: 100%;
    font-size: 16px;
    color: var(--text-color-dark);
}

.filter-group label {
    display: block;    
    font-size: 14px;
}

.filter-group select, .filter-group input[type="number"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: var(--font-universal);
    color: #3c3c3c;   
}

select {
    appearance: none; /* Убираем стандартную стрелку */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%233c3c3c'%3e%3cpath d='M7 10l5 5 5-5z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center; /* Позиция кастомной стрелки */
    background-size: 16px;
}

.checkbox-label {
    display: flex;         /* Уже есть в вашем коде */
    align-items: center;   /* Выравниваем чекбокс и текст */
    gap: 8px;      /* Убираем отступ снизу (теперь за это отвечает gap) */
    white-space: nowrap;
}

.checkbox-label input[type="checkbox"] {
    margin: 0;
    width: 16px;
    height: 16px;
    flex-shrink: 0; /* Запрещаем сжатие чекбокса */
    cursor: pointer;
}

.filter-buttons {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-button {
    padding: 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.apply {
    background: #005b96;
    color: white;
}

.reset {
    background: white;
    color: #005b96;
}

.apply:hover{
    color: #ff9900;
}

.reset:hover{
    color: #ff9900;
}

/* Основной контент (справа) */
.content {
    flex: 1;
}

/* Категории товаров */
.category {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    overflow: hidden;
}

.category-header {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    background: #e7e7e7;
    border-bottom: 1px solid #ddd;
    justify-content: flex-start;
}

.category-image {
    width: 100px;
    height: 100px;
    object-fit: contain;
    border-radius: 4px;
    margin-right: 20px;
}

.category-title {
    font-size: 18px;
    font-weight: bold;
    margin: 0;
}

.category-description {
    font-size: 14px;
    color: #666;
    margin: 5px 0 0;
}

/* Таблица товаров */
.products-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.products-table th, .products-table td {
    width: 20%;
    padding: 5px 8px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.products-table th {
    vertical-align: middle;
    background: #f9f9f9;
    font-weight: bold;
    color: #444;
}

.products-table td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.products-table tr:hover {
    background: #f5f5f5;
}

.price {
    font-weight: bold;
    color: #005b96;
}

.add-to-cart-btn {
    background-color: #ff9900;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
    width: 100px;
    height: 40px;
    line-height: 24px;
    box-sizing: border-box;
    text-align: center;
    display: inline-block;
    position: relative;
}

.add-to-cart-btn.added {
    background-color: #4CAF50;
    color: transparent; /* Прячем текст */
}
.add-to-cart-btn.added::after {
    content: "✓";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 18px;
    line-height: 1;
}

.add-to-cart-btn:hover {
    background-color: #005b96;
}

/* Адаптивность */
@media (max-width: 988px) {
    .main_container {
        flex-direction: column;
    }

    .filters-panel {
        width: 100%;
        position: static;
        margin-bottom: 20px;
    }

    .category-header {
        /* flex-direction: column; */
        text-align: left;
    }

    .category-image {
        padding: 16px;
        margin-right: 0;
        margin-bottom: 10px;
    }

    .products-table {
        display: block;
        width: 100%;
        overflow-x: auto;
    }

    .products-table thead {
        display: table;
        width: 100%;
    }

    .products-table tbody {
        display: table;
        width: 100%;
    }

    .products-table tr {
        /* display: table; */
        width: 100%;
        table-layout: fixed;
    }
}

@media (max-width: 768px) {
    .cart-wrapper {
        margin: 10px 0 0;
        order: 1;
    }

    .category-title {
        font-size: 16px;
    }

    .category-description {
        font-size: 13px;
    }

    .filter-group label,
    .filter-group select,
    .filter-group input[type="number"] {
        font-size: 13px;
    }

    .filter-button {
        font-size: 13px;
    }

    .main_header_h1 h1 {
        font-size: 20px;
    }

    .add-to-cart-btn {
        font-size: 13px;
        padding: 6px 10px;
    }
}

@media (max-width: 588px) {

    .main_container{
        max-width: 70%;
    }

    /*.logo{
        font-size: 1.3rem;
    }*/

    .products-table thead {
        display: none;
    }

    .products-table,
    .products-table tbody,
    .products-table tr,
    .products-table td {
        display: block;
        width: 100%;
    }

    .category-header {
        flex-direction: column;
        text-align: left;
    }

    .products-table tr {
        margin-bottom: 15px;
        background: #fff;
        /* border: 1px solid #ddd; */
        border-radius: 8px;
        padding: 10px;
    }

    .products-table td {
        text-align: left;
        padding: 6px 10px;
        position: relative;
        font-size: 14px;
    }

    .products-table td::before {
        content: attr(data-label);
        font-weight: bold;
        display: block;
        margin-bottom: 4px;
        color: #555;
    }

    .add-to-cart-btn {
        width: 60%;
        box-sizing: border-box;
        padding: 8px 10px;
    }

    .modal-body {
        flex-direction: column;
        text-align: center;
    }

    .modal-text {
        text-align: center;
    }

    .modal-image {
        max-width: 100%;
    }
}


.more-btn {
    margin-top: 8px;
    padding: 6px 12px;
    background-color: #005b96;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.more-btn:hover {
    background-color: #ff9900;
    transform: scale(1.05);
}

.more-btn:active {
    transform: scale(0.97);
}

.category-details {
    background: #f5f5f5;
    padding: 10px 15px;
    border-top: 1px solid #ddd;
}

.modal {
    display: flex;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    justify-content: center;
    align-items: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal.show {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: white;
    border-radius: 8px;
    max-width: 800px;
    width: 100%;
    padding: 20px;
    position: relative;
    box-shadow: 0 2px 15px rgba(0,0,0,0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal.show .modal-content {
    transform: scale(1);
}

.modal-body {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
}

.modal-text {
    flex: 1;
    text-align: left;
}

.modal-text h2 {
    margin-bottom: 10px;
    font-size: 20px;
}

.modal-text p {
    font-size: 14px;
    line-height: 1.5;
    color: #444;
}

.modal-image {
    flex: 1;
    max-width: 350px;
    width: 100%;
    height: auto;
    border-radius: 6px;
}

.modal-close {
    position: absolute;
    right: 15px;
    top: 10px;
    font-size: 24px;
    cursor: pointer;
}

.modal-close:hover {
    color: #ff9900;
}

@media (max-width: 720px) {
    .products-table th, .products-table td {
        font-size: 14px;
    }
}

@media (max-width: 588px) {
    .more-btn {
        display: block; 
        margin: 0 auto;
    }

    .category-title {
        padding: 5px;
    }
}