/* Каталог товаров - основные стили */

* {
    padding: 0;
    margin: 0;
    font-family: Arial, sans-serif;
    font-weight: 400;
    letter-spacing: -.03em;
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
}

body {
    --wp--preset--color--black: #000000;
    --wp--preset--color--white: #ffffff;
    --woocommerce: #7F54B3;
    --wc-green: #7ad03a;
    --wc-red: #a00;
    --wc-orange: #ffba00;
    --wc-blue: #2ea2cc;
    --wc-primary: #7F54B3;
    --wc-primary-text: white;
    --wc-secondary: #e9e6ed;
    --wc-secondary-text: #515151;
    --wc-highlight: #b3af54;
    --wc-content-bg: #fff;
    --wc-subtext: #767676;
    
    font-family: Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
    font-weight: 400;
    letter-spacing: -.03em;
}

/* Хедер */
.header {
    background: #1d1d1b;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

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

.logo {
    font-size: 36px;
    font-weight: bold;
    color: #ffffff;
    text-decoration: none;
    letter-spacing: -1px;
}

/* Поиск */
.search-box {
    flex: 1;
    max-width: 400px;
    margin: 0 40px;
}

.search-input {
    width: 100%;
    padding: 12px 20px;
    border: 1px solid #444;
    border-radius: 25px;
    font-size: 14px;
    transition: all 0.3s;
    background: #2a2a28;
    color: #fff;
}

.search-input::placeholder {
    color: #999;
}

.search-input:focus {
    outline: none;
    border-color: #666;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.1);
}

/* Информационные карточки */
.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
    max-width: 1200px;
    margin: 0 auto;
}

.info-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: white;
    border-radius: 8px;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.info-icon {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.info-icon svg {
    width: 32px;
    height: 32px;
    stroke: #1d1d1b;
    fill: none;
    stroke-width: 1.5;
}

.info-content h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #1d1d1b;
}

.info-content p {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

/* Каталог */
.catalog-header {
    padding: 20px 0 20px;
    background: transparent;
    margin-bottom: 20px;
}

.catalog-title {
    font-size: 28px;
    font-weight: 300;
    margin-bottom: 10px;
}

.product-count {
    color: #666;
    font-size: 14px;
}

.catalog-layout {
    display: flex;
    gap: 30px;
}

/* Боковая панель фильтров */
.sidebar {
    width: 260px;
    flex-shrink: 0;
    background: white;
    padding: 20px;
    border-radius: 8px;
    height: auto;
    min-height: fit-content;
}

/* Wrapper для контента - на десктопе просто контейнер */
.sidebar-content {
    display: block;
}

.filter-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e5e5;
}

.filter-section:last-child {
    border-bottom: none;
}

.filter-title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 15px;
    letter-spacing: 0.5px;
    color: #555;
}

.filter-options {
    list-style: none;
    list-style-type: none;
    margin: 0;
    padding: 0;
}

.filter-options.compact {
    max-height: 150px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #ddd transparent;
}

.filter-options.compact::-webkit-scrollbar {
    width: 4px;
}

.filter-options.compact::-webkit-scrollbar-track {
    background: transparent;
}

.filter-options.compact::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 2px;
}

.filter-options.compact::-webkit-scrollbar-thumb:hover {
    background: #bbb;
}

.filter-options.sizes {
    max-height: none;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

ol, ul {
    padding-left: 24px;
    margin-bottom: 14px;
    box-sizing: border-box;
}

.header ul {
    display: flex;
    align-items: center;
    list-style-type: none;
    margin: 0;
    padding: 0;
}

.filter-option {
    margin-bottom: 10px;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.filter-checkbox input {
    width: 16px;
    height: 16px;
    margin-right: 10px;
    cursor: pointer;
    accent-color: #1d1d1b;
}

.filter-checkbox label {
    cursor: pointer;
    font-size: 14px;
    flex: 1;
}

.filter-count {
    color: #999;
    font-size: 12px;
    margin-left: 5px;
}

/* Фильтр цен */
.price-filter {
    display: flex;
    gap: 10px;
    align-items: center;
}

.price-input {
    width: 70px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.apply-price-btn {
    padding: 8px 12px;
    background: #1d1d1b;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.apply-price-btn:hover {
    background: #2a2a28;
}

.clear-filters {
    background: white;
    border: 1px solid #ddd;
    padding: 10px 15px;
    font-size: 14px;
    cursor: pointer;
    margin-top: 20px;
    width: 100%;
    border-radius: 4px;
    transition: all 0.2s;
}

.clear-filters:hover {
    background: #f5f5f5;
}

/* Размеры как кнопки */
.filter-options.sizes .filter-option {
    margin: 0;
}

.filter-options.sizes .filter-checkbox {
    display: inline-block;
    margin: 0;
}

.filter-options.sizes .filter-checkbox input {
    display: none;
}

.filter-options.sizes .filter-checkbox label {
    display: inline-block;
    padding: 6px 10px;
    background: #f8f8f8;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
    min-width: 35px;
    text-align: center;
}

.filter-options.sizes .filter-checkbox input:checked + label {
    background: #1d1d1b;
    color: white;
    border-color: #1d1d1b;
}

.filter-options.sizes .filter-checkbox label:hover {
    background: #e0e0e0;
}

.filter-options.sizes .filter-checkbox input:checked + label:hover {
    background: #2a2a28;
}

/* Плавающая панель активных фильтров */
.active-filters {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(29, 29, 27, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    z-index: 1000;
    max-width: calc(100vw - 40px);
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.active-filters-content {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.active-filters-title {
    font-weight: 600;
    color: white;
    margin-right: 10px;
    font-size: 14px;
}

.active-filters-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
}

.filter-tag {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    padding: 6px 10px;
    border-radius: 16px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.filter-tag-remove {
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 10px;
}

.filter-tag-remove:hover {
    background: rgba(255,255,255,0.4);
}

.clear-all-filters-btn {
    background: rgba(220, 53, 69, 0.8);
    color: white;
    border: 1px solid rgba(220, 53, 69, 0.5);
    padding: 8px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
    backdrop-filter: blur(5px);
}

.clear-all-filters-btn:hover {
    background: rgba(220, 53, 69, 1);
    border-color: #dc3545;
}

/* Панель сортировки */
.sort-bar {
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sort-select {
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

/* Контейнер товаров */
.products-container {
    flex: 1;
    margin-bottom: 100px; /* Отступ для плавающей панели */
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

/* Состояния загрузки и ошибок */
.loading {
    text-align: center;
    padding: 50px;
    font-size: 18px;
    color: #666;
    grid-column: 1 / -1;
}

.error {
    text-align: center;
    padding: 50px;
    color: #d32f2f;
    grid-column: 1 / -1;
}

.loader {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #1d1d1b;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

/* Подвал */
.footer {
    background: #1d1d1b;
    color: #fff;
    padding: 60px 0 30px;
    margin-top: 80px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h3 {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 20px;
    color: #fff;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section li {
    margin-bottom: 12px;
}

.footer-section a {
    color: #999;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: #fff;
}

.footer-contact {
    color: #999;
    font-size: 14px;
    line-height: 1.6;
}

.footer-contact strong {
    color: #fff;
    display: block;
    margin-bottom: 5px;
}

.footer-hours {
    background: #2a2a28;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.footer-hours h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #fff;
}

.footer-hours p {
    font-size: 13px;
    color: #999;
    margin: 5px 0;
}

.footer-bottom {
    border-top: 1px solid #333;
    padding-top: 30px;
    text-align: center;
    color: #666;
    font-size: 13px;
}

/* Кнопка открытия фильтров для мобильных */
.mobile-filters-btn {
    display: none;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 12px 20px;
    background: #1d1d1b;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 15px;
    transition: background 0.3s;
}

.mobile-filters-btn:hover {
    background: #2a2a28;
}

.mobile-filters-btn svg {
    stroke: white;
}

/* Кнопка закрытия фильтров для мобильных */
.filters-close-btn {
    display: none;
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: #f5f5f5;
    border: none;
    border-radius: 50%;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #333;
    transition: all 0.3s;
    z-index: 10;
}

.filters-close-btn:hover {
    background: #e0e0e0;
    transform: rotate(90deg);
}

/* Overlay для мобильных фильтров */
.mobile-filters-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    animation: fadeIn 0.3s ease;
}

.mobile-filters-overlay.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Адаптивность */
@media (max-width: 768px) {
    /* Показываем кнопку открытия фильтров */
    .mobile-filters-btn {
        display: flex;
    }

    /* Показываем кнопку закрытия в sidebar */
    .filters-close-btn {
        display: block;
        position: fixed;
        top: 15px;
        right: 15px;
    }

    .catalog-layout {
        flex-direction: column;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        background: #ffffff !important;
        z-index: 1001;
        transition: left 0.3s ease;
        box-shadow: 2px 0 20px rgba(0,0,0,0.2);
        padding: 0;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    .sidebar.active {
        left: 0;
    }

    /* Кнопка закрытия внутри sidebar */
    .sidebar .filters-close-btn {
        position: absolute;
        top: 15px;
        right: 15px;
        z-index: 10;
    }

    /* Скроллируемый контейнер внутри sidebar */
    .sidebar-content {
        flex: 1;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        padding: 60px 20px 30px 20px;
    }

    /* Убираем ограничения высоты у вложенных элементов */
    .sidebar .filter-options.compact {
        max-height: none !important;
        overflow: visible !important;
    }

    .sidebar .filter-section {
        overflow: visible !important;
    }

    /* Блокируем прокрутку body когда фильтры открыты */
    body.filters-open {
        overflow: hidden !important;
        position: fixed;
        width: 100%;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .search-box {
        margin: 20px 0 0 0;
        max-width: 100%;
    }

    .active-filters {
        bottom: 10px;
        left: 10px;
        right: 10px;
        transform: none;
        max-width: none;
        padding: 12px 15px;
    }

    .active-filters-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .active-filters-tags {
        width: 100%;
        justify-content: flex-start;
    }
}