/* =============================================
   WoodMart Custom Product Filter — Стили в стиле референса
   ============================================= */

.wm-filter-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 15px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* === Поисковая строка как на референсе === */
.wm-search-bar {
    display: flex;
    align-items: center;
    background: #f1f3f4;
    border: 1px solid #dadce0;
    border-radius: 9999px;
    padding: 4px 6px 4px 14px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    height: 54px;
}

.wm-search-input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    position: relative;
}

.wm-search-icon {
    position: absolute;
    left: 16px;
    color: #888;
    pointer-events: none;
}

.wm-search-input {
    width: 100%;
    border: none;
    outline: none;
    font-size: 16px;
    padding: 12px 16px 12px 48px;
    border-radius: 50px;
    background: transparent;
}

.wm-filter-toggle-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 8px;
}

.wm-filter-toggle-btn:hover {
    background: #e8e8e8;
}

/* === Промо-баннер === */
.wm-promo-banner {
    background: linear-gradient(135deg, #f0f7f0 0%, #e8f5e9 100%);
    border-radius: 20px;
    padding: 30px 25px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    overflow: hidden;
    position: relative;
}

.wm-promo-content h2 {
    font-size: 28px;
    line-height: 1.2;
    margin: 0 0 12px;
    color: #2e7d32;
    font-weight: 700;
}

.wm-promo-content p {
    color: #555;
    margin-bottom: 20px;
    font-size: 15px;
}

.wm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.wm-btn-green {
    background: #4CAF50;
    color: #fff;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.wm-btn-green:hover {
    background: #43a047;
    transform: translateY(-2px);
}

.wm-btn-outline {
    background: transparent;
    border: 2px solid #4CAF50;
    color: #4CAF50;
}

.wm-promo-image {
    max-width: 220px;
    height: auto;
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(135deg, #81c784, #4CAF50);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 60px;
    box-shadow: 0 10px 30px rgba(76, 175, 80, 0.3);
}

.wm-promo-image::before {
    content: "🛍️";
    font-size: 90px;
    opacity: 0.9;
}

/* === Категории (иконки) === */
.wm-categories-section {
    margin-bottom: 30px;
}

.wm-section-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #222;
}

.wm-categories-scroll {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 12px;
    scrollbar-width: none;
}

.wm-categories-scroll::-webkit-scrollbar {
    display: none;
}

.wm-category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 78px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.wm-category-item:hover {
    transform: translateY(-4px);
}

.wm-category-item.active .wm-category-icon {
    border: 3px solid #4CAF50;
    box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.15);
}

.wm-category-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-color: #f8f8f8;
    border: 3px solid #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.wm-category-name {
    font-size: 13px;
    text-align: center;
    color: #444;
    font-weight: 500;
    line-height: 1.3;
}

/* === Фильтр по цене === */
.wm-price-filter {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
}

.wm-price-inputs {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
}

.wm-price-input-group {
    flex: 1;
}

.wm-price-input-group label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 6px;
}

.wm-price-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 15px;
}

.wm-range-slider {
    position: relative;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    margin-top: 10px;
}

.wm-range {
    position: absolute;
    width: 100%;
    pointer-events: none;
    -webkit-appearance: none;
    background: transparent;
}

.wm-range::-webkit-slider-thumb {
    pointer-events: all;
    width: 18px;
    height: 18px;
    background: #4CAF50;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    -webkit-appearance: none;
}

.wm-range::-moz-range-thumb {
    pointer-events: all;
    width: 18px;
    height: 18px;
    background: #4CAF50;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* === Кнопки действий === */
.wm-filter-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 30px;
}

.wm-filter-actions .wm-btn {
    flex: 1;
    padding: 14px 20px;
    font-size: 15px;
}

/* === Сетка товаров === */
.wm-results-section {
    margin-top: 10px;
}

.wm-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.wm-show-all-btn {
    background: none;
    border: none;
    color: #4CAF50;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

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

@media (max-width: 600px) {
    .wm-products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Карточка товара в стиле референса */
.wm-product-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.wm-product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.12);
}

.wm-product-image-link {
    display: block;
    position: relative;
    overflow: hidden;
}

.wm-product-image-link img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.wm-product-card:hover .wm-product-image-link img {
    transform: scale(1.08);
}

.wm-product-info {
    padding: 14px 16px 18px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.wm-product-title {
    font-size: 15px;
    font-weight: 600;
    color: #222;
    text-decoration: none;
    line-height: 1.3;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.wm-product-meta {
    font-size: 13px;
    color: #888;
    margin-bottom: 8px;
}

.wm-product-price {
    font-size: 17px;
    font-weight: 700;
    color: #222;
    margin-top: auto;
    margin-bottom: 12px;
}

.wm-product-price .woocommerce-Price-amount {
    color: #222;
}

.wm-add-to-cart-btn {
    background: #4CAF50 !important;
    color: #fff !important;
    border: none !important;
    padding: 10px 18px !important;
    border-radius: 50px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    text-align: center;
    text-decoration: none !important;
    transition: all 0.3s ease;
    display: block;
}

.wm-add-to-cart-btn:hover {
    background: #43a047 !important;
    transform: translateY(-1px);
}

/* === Страница результатов === */
.wm-results-page-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 15px;
}

.wm-page-title {
    font-size: 28px;
    margin-bottom: 20px;
}

.wm-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 25px;
}

.wm-filter-tag {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 14px;
}

.wm-full-results {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.wm-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 18px;
}

/* =============================================
   ВЫЕЗЖАЮЩИЙ DRAWER С ФИЛЬТРАМИ
   ============================================= */

.wm-filter-drawer {
    position: fixed;
    top: 0;
    right: -380px;
    width: 360px;
    max-width: 90vw;
    height: 100vh;
    background: #fff;
    box-shadow: -4px 0 25px rgba(0,0,0,0.15);
    z-index: 99999;
    transition: right 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.wm-filter-drawer.active {
    right: 0;
}

.wm-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #eee;
    background: #fafafa;
}

.wm-drawer-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.wm-drawer-close {
    background: none;
    border: none;
    font-size: 32px;
    line-height: 1;
    color: #666;
    cursor: pointer;
    padding: 0 8px;
}

.wm-drawer-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.wm-drawer-search {
    margin-bottom: 28px;
}

.wm-drawer-search label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #444;
    margin-bottom: 8px;
}

.wm-drawer-subtitle {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 14px;
    color: #222;
}

.wm-drawer-footer {
    padding: 20px 24px;
    border-top: 1px solid #eee;
    background: #fafafa;
    display: flex;
    gap: 12px;
}

.wm-drawer-footer .wm-btn {
    flex: 1;
    padding: 14px 0;
    font-size: 15px;
}

/* Оверлей */
.wm-drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.45);
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.wm-drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Адаптив для мобильных — drawer снизу */
@media (max-width: 480px) {
    .wm-filter-drawer {
        top: auto;
        bottom: -100%;
        right: 0;
        width: 100%;
        max-width: 100%;
        height: 85vh;
        border-radius: 20px 20px 0 0;
        transition: bottom 0.4s cubic-bezier(0.32, 0.72, 0, 1);
    }
    
    .wm-filter-drawer.active {
        bottom: 0;
        right: 0;
    }
}

/* Адаптив */
@media (max-width: 768px) {
    .wm-promo-banner {
        flex-direction: column;
        text-align: center;
    }
    
    .wm-promo-image {
        margin-top: 20px;
    }
}