@import url('https://fonts.googleapis.com/css2?family=PT+Sans:wght@400;700&display=swap');

@import url('https://fonts.googleapis.com/css2?family=PT+Serif:wght@400;700&display=swap');

.container {
    font-family: 'PT Serif', serif;
    background-color: rgb(237, 237, 237);
}

.top a {
    color: rgb(64, 64, 64);
    text-decoration: none;
    font-size: 32px;
    font-family: 'PT Sans';
    width: 205px;
}

.top {
    display: flex;
    justify-content: space-between; /* разделяем на две группы */
    align-items: center;
    padding: 15px 0px;
    background: #ffffff;
    border-radius: 8px;
    border-bottom: 2px solid #000000;
    height: 100px;
    margin-bottom: 30px;

}

.logo {
    padding-left: 50px;
    max-height: 150px;
    max-width: 150px;
    transition: all 0.5s ease;
}

.logo:hover{
    transform: scale(1.1);
}


.info {
    display: flex;
    gap: 0px;
    padding-left:50px;
    justify-content: space-between; /* равные расстояния */
}

.dropdown {
    position: relative;
    display: inline-block;
}

.top .register{
    display: flex;
    justify-content: flex-end;
    padding-right: 50px;
    cursor: pointer;
    font-family: 'PT Serif', serif;
    font-size: 32px;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 100px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 100;
    left: -10px;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
}

.dropdown-menu a {
    display: block;
    padding: 10px 20px;
    color: #333;
    text-decoration: none;
    transition: background 0.2s;
    font-family: 'PT Serif', serif;
    font-size: 16px;
}

.dropdown-menu a:hover {
    background: #f5f5f5;
    font-family: 'PT Serif', serif;
    font:16px;
}

.dropdown-menu hr {
    margin: 5px 0;
    border: none;
    border-top: 1px solid #eee;
}

.search-form {
    display: flex;
    justify-content: center;           /* Ставим в ряд */
    gap: 0;                  /* Убираем промежуток */
    width: 100%;             /* На всю ширину */
    max-width: 50px;        /* Или нужная ширина */
    margin: 0 auto;          /* Центрирование */
}

.search-input {
    flex: 1;                 /* Растягивается на всю доступную ширину */
    padding: 10px 15px;
    border: 2px solid #2d2929;
    border-right: 2px solid #000000;      /* Убираем правую границу */
    border-radius: 30px 0 0 30px;  /* Скругление только слева */
    font-size: 16px;
    outline: none;
}

.search-input:focus {
    border-color: #000000;
}

.search-btn {
    padding: 10px 20px;
    background: #ffffff;
    color: #454e55;
    border: 2px solid #1c1e20;
    border-left: none;       /* Убираем левую границу */
    border-radius: 0 30px 30px 0;  /* Скругление только справа */
    font-size: 16px;
    cursor: pointer;
    white-space: nowrap;     /* Текст не переносится */
    font-family: 'PT Serif', serif;
    font-size: 16px;
}

.search-btn:hover {
    background: #ffffff;
    border-color: #464242;
    color:rgb(0, 0, 0);
}

.search-form {
    display: flex;
    justify-content: center;           /* Ставим в ряд */
    gap: 0;                  /* Убираем промежуток */
    width: 100%;             /* На всю ширину */
    max-width: 50px;        /* Или нужная ширина */
    margin: 0 auto;          /* Центрирование */
}

.search-input {
    flex: 1;                 /* Растягивается на всю доступную ширину */
    padding: 10px 15px;
    border: 2px solid #2d2929;
    border-right: 2px solid #000000;      /* Убираем правую границу */
    border-radius: 30px 0 0 30px;  /* Скругление только слева */
    font-size: 16px;
    outline: none;
}

.search-input:focus {
    border-color: #000000;
}

.search-btn {
    padding: 10px 20px;
    background: #ffffff;
    color: #454e55;
    border: 2px solid #1c1e20;
    border-left: none;       /* Убираем левую границу */
    border-radius: 0 30px 30px 0;  /* Скругление только справа */
    font-size: 16px;
    cursor: pointer;
    white-space: nowrap;     /* Текст не переносится */
}

.search-btn:hover {
    background: #ffffff;
    border-color: #464242;
    color:rgb(0, 0, 0);
}


.page-header {
    margin-top: 30px;
    display: flex;
    align-items: center;
    flex-direction: column;
    background-color: rgb(237, 237, 237);
    border-top: 2px solid #000000;
    border-bottom: 2px solid #000000;
}


.catalogContainer {
    padding: 15px 40px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    background-color: rgb(237, 237, 237);
}

.pagination-container {
    display: flex;
    align-items: center;
    flex-direction: column; 
}

.pagination-info {
    display: flex;
    align-items: center;
    flex-direction: column;
}

.pagination-container {
    color: rgb(64, 64, 64);
    text-decoration: none;
    font-family: 'PT Sans';
}

.pagination-container a{
    color: rgb(64, 64, 64);
    text-decoration: none;
    font-family: 'PT Sans';
}

.filterForm {
    display: flex;
    flex-direction: row;
    gap: 40px;               /* Расстояние между группами */
    align-items: flex-start;
    justify-content: center
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.group-inputs {
    display: flex;
    flex-direction: column;  /* Чекбоксы в колонку */
    gap: 8px;                /* Расстояние между чекбоксами */
}

.group-inputs label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.group-title {
    margin: 0;               /* Убираем отступы у заголовка */
    font-size: 16px;
    font-weight: bold;
}

.filterForm button[type="submit"] {
    background: transparent;
    border: 2px solid #000000;
    color: #000000;
    border-radius: 6px;
    padding: 10px 28px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
}

.filterForm button[type="submit"]:hover {
    background: #ffffff;
    color: rgb(59, 55, 55);
}

.product-card img {
    border-radius: 20px;
    border: 3px solid #000000;
    transition: all 0.5s ease;
}

.product-card img:hover {
    transform: scale(1.05);
}

.product-card button {
    font-size: 18px;
    padding:5px;
    font-family: 'PT Serif', serif;
    background-color: #000000;
    color: #ffffff;
    border-radius: 10px;
    cursor:pointer;
    transition: all 0.5s ease;
}

.product-card button:hover {
    background-color: #555;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    transform: scale(1.05);
}

.product-card p {
    color: rgb(81,81,81);
    opacity: 80%;
}

/* ==========================================================================
   СТИЛИ ДЛЯ ГОРИЗОНТАЛЬНОЙ ПАНЕЛИ ФИЛЬТРОВ (БЕЗ ИЗМЕНЕНИЯ СТАРЫХ КАРТОЧЕК)
   ========================================================================== */

.filter-top-bar {
    background-color: #ffffff;
    border: 2px solid #000000;
    border-radius: 0px;
    padding: 15px 20px;
    margin-bottom: 35px; /* Отступ до начала сетки товаров */
    width: 100%;
    box-sizing: border-box;
}

.horizontal-filter-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.filter-selectors-row {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
}

/* Колонки опций внутри фильтра */
.filter-dropdown-bucket {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    min-width: 160px;
}

.bucket-label {
    font-family: 'PT Sans', sans-serif;
    font-weight: bold;
    font-size: 14px;
    color: #000;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #000;
    padding-bottom: 3px;
    margin-bottom: 5px;
}

.bucket-checkboxes {
    max-height: 100px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bucket-checkboxes label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'PT Sans', sans-serif;
    font-size: 14px;
    color: #333;
    cursor: pointer;
}

.bucket-checkboxes input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: #000;
}

/* Переключатель наличия */
.filter-toggle-bucket {
    display: flex;
    align-items: center;
    margin-top: 20px;
    min-width: 200px;
}

.toggle-switch-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-family: 'PT Sans', sans-serif;
    font-weight: bold;
    font-size: 14px;
}

.toggle-switch-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #000;
}

/* Нижняя панель управления внутри фильтра */
.filter-actions-row {
    display: flex;
    align-items: center;
    gap: 20px;
    border-top: 1px solid #ddd;
    padding-top: 10px;
}

.filter-apply-btn {
    background: #000000;
    color: #ffffff;
    border: 2px solid #000000;
    padding: 8px 24px;
    font-family: 'PT Sans', sans-serif;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-apply-btn:hover {
    background: #ffffff;
    color: #000000;
}

.filter-reset-link {
    font-family: 'PT Sans', sans-serif;
    font-size: 14px;
    color: #666;
    text-decoration: underline;
}

.filter-reset-link:hover {
    color: #ff0000;
}

.no-products {
    text-align: center;
    padding: 50px 0;
    font-family: 'PT Sans', sans-serif;
    font-size: 16px;
    width: 100%;
}

/* Скроллбары для чекбоксов */
.bucket-checkboxes::-webkit-scrollbar {
    width: 4px;
}
.bucket-checkboxes::-webkit-scrollbar-thumb {
    background: #000;
}

/* Окно корзины*/

/* --- Стили для модального окна корзины --- */
.cart-modal {
    display: none; 
    position: fixed; 
    z-index: 2000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    overflow: auto; 
    background-color: rgba(0,0,0,0.6); 
    font-family: 'PT Sans', sans-serif;
}

.cart-modal-content {
    background-color: #fefefe;
    margin: 7% auto; 
    padding: 25px;
    border: 1px solid #888;
    width: 80%; 
    max-width: 750px;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
}

.cart-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #eee;
    padding-bottom: 12px;
}

.cart-modal-header h2 {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    color: #222;
}

.close-cart-btn {
    color: #aaa;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.close-cart-btn:hover {
    color: #ff4d4d;
}

.cart-modal-body {
    padding: 15px 0;
    max-height: 380px;
    overflow-y: auto;
}

.empty-cart-msg {
    text-align: center;
    color: #777;
    font-size: 18px;
    padding: 30px 0;
}

/* Элемент строки товара */
.cart-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid #eee;
    gap: 15px;
}

.cart-item-img {
    width: 65px;
    height: 65px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.cart-item-details {
    flex: 2;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cart-item-name {
    font-weight: bold;
    font-size: 16px;
    color: #111;
}

.cart-item-meta {
    font-size: 13px;
    color: #555;
}

.cart-item-article {
    font-size: 12px;
    color: #999;
}

.cart-item-qty {
    flex: 0.8;
    text-align: center;
    font-weight: bold;
    font-size: 15px;
    color: #333;
}

.cart-item-price {
    flex: 1;
    text-align: right;
    font-weight: bold;
    font-size: 16px;
    color: #28a745;
}

.cart-item-remove-btn {
    background: none;
    border: none;
    color: #999;
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
    padding: 0 10px;
}

.cart-item-remove-btn:hover {
    color: #ff4d4d;
    transform: scale(1.15);
}

/* Нижняя часть окна */
.cart-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 2px solid #eee;
    padding-top: 20px;
    margin-top: 10px;
}

.cart-total {
    font-size: 22px;
    font-weight: bold;
    color: #222;
}

#cart-total-price {
    color: #28a745;
}

.checkout-btn {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 12px 28px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 30px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    font-family: 'PT Serif', serif;
}

.checkout-btn:hover {
    background-color: #218838;
    transform: scale(1.03);
}

/* --- Позиционирование иконки корзины в шапке --- */
.header-user-block {
    display: flex;
    align-items: center;
    gap: 25px; /* Расстояние между иконкой корзины и профилем */
    padding-right: 50px; /* Отступ от правого края экрана */
}

.header-cart-link {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: auto !important;         /* Сбрасываем глобальную ширину ссылок в 205px */
    font-size: 26px !important;     /* Аккуратный размер иконки */
    color: rgb(64, 64, 64) !important;
    transition: color 0.2s ease, transform 0.2s ease;
    cursor: pointer;
}

/* Эффект при наведении на корзину */
.header-cart-link:hover {
    color: #28a745 !important;     /* Окрашивается в зеленый бренд-цвет */
    transform: scale(1.15);        /* Слегка увеличивается */
}

/* Корректировка кнопки Профиль/Регистрация, чтобы она не съезжала */
.header-user-block .register {
    width: auto !important;        /* Убираем жесткую ширину */
    white-space: nowrap;           /* Защита от переноса текста */
    padding: 0;
    margin: 0;
}

/* =====================================================
   АДАПТИВНЫЙ ДИЗАЙН
   ===================================================== */

/* --- Планшет (до 1024px) --- */
@media (max-width: 1024px) {
    .top {
        padding: 12px 24px;
        height: auto;
        flex-wrap: wrap;
        gap: 12px;
    }

    .logo { padding-left: 0; }

    .info { padding-left: 0; gap: 20px; }
    .info a, .top a { font-size: 22px; width: auto; }

    .search-form { max-width: 280px; }

    .top .register { padding-right: 0; font-size: 22px; }

    .catalogContainer {
        grid-template-columns: repeat(3, 1fr);
    }

    .filter-selectors-row {
        flex-wrap: wrap;
        gap: 10px;
    }
}

/* --- Мобильный (до 768px) --- */
@media (max-width: 768px) {
    /* Шапка: вертикальная компоновка */
    .top {
        flex-direction: column;
        align-items: flex-start;
        padding: 16px;
        gap: 12px;
        height: auto;
    }

    .logo {
        padding-left: 0;
        max-height: 60px;
        max-width: 100px;
    }

    .info {
        padding-left: 0;
        gap: 16px;
        flex-wrap: wrap;
    }
    .info a, .top a { font-size: 18px; width: auto; }

    /* Поиск на всю ширину */
    .search-form {
        max-width: 100%;
        width: 100%;
    }
    .search-input { font-size: 14px; }

    /* Корзина + профиль в ряд */
    .header-cart-link { font-size: 22px !important; }
    .top .register { padding-right: 0; font-size: 20px; }
    .dropdown-menu { left: auto; right: 0; }

    /* Фильтры */
    .filter-top-bar { padding: 12px 16px; }
    .filter-selectors-row {
        flex-direction: column;
        gap: 12px;
    }
    .filter-dropdown-bucket,
    .filter-toggle-bucket { width: 100%; }
    .bucket-checkboxes {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }
    .filter-actions-row {
        flex-direction: column;
        gap: 8px;
    }
    .filter-apply-btn,
    .filter-reset-link { width: 100%; text-align: center; }

    /* Карточки каталога */
    .catalogContainer {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 12px;
    }
    .product-card { padding: 12px; }
    .product-card img { width: 100% !important; height: 160px; object-fit: cover; }
    .product-card h3 { font-size: 14px; }

    /* Заголовок страницы */
    .page-header { padding: 12px 16px 0; }
    .page-header h2 { font-size: 22px; }

    /* Пагинация */
    .pagination { flex-wrap: wrap; gap: 6px; padding: 16px; }

    /* Корзина — модальное окно */
    .cart-modal-content {
        width: 96% !important;
        margin: 4% auto !important;
        padding: 16px !important;
        border-radius: 10px !important;
    }
    .cart-item-row { flex-wrap: wrap; gap: 8px; }
    .cart-item-img { width: 50px; height: 50px; }
    .cart-item-details { flex: 1 1 calc(100% - 65px); }
    .cart-item-qty,
    .cart-item-price { flex: unset; }
}

/* --- Маленький мобильный (до 480px) --- */
@media (max-width: 480px) {
    .catalogContainer {
        grid-template-columns: 1fr;
    }
    .product-card img { height: 200px; }
    .top { padding: 12px; }
    .info a, .top a { font-size: 16px; }
}