/* ===================================
   WooCommerce AJAX Product Filter Styles - Horizontal Layout
   =================================== */

/* Main Container */
.waf-main-container {
    display: block;
    margin: 30px 0;
}

/* Horizontal Filters */
.waf-filters-horizontal {
    background: transparent;
    padding: 20px 0;
    margin-bottom: 30px;
}

.waf-filters-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

/* Filter Sections - Pill-shaped Buttons */
.waf-filter-section {
    position: relative;
    display: inline-block;
}

.waf-filter-header {
    padding: 10px 20px;
    cursor: pointer;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 50px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    user-select: none;
    white-space: nowrap;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.waf-filter-header:hover {
    background: #f5f5f5;
    border-color: #999;
}

.waf-filter-section.active .waf-filter-header {
    background: #2d2d2d;
    color: #fff;
    border-color: #2d2d2d;
}

.waf-filter-title {
    font-size: 14px;
    font-weight: 500;
    margin: 0;
    color: #2d2d2d;
}

.waf-filter-section.active .waf-filter-title {
    color: #fff;
}

.waf-filter-count {
    font-size: 13px;
    font-weight: 400;
    opacity: 0.8;
}

.waf-toggle-icon {
    transition: all 0.3s ease;
    font-size: 14px;
    display: inline-block;
    font-weight: 300;
    color: #2d2d2d;
}

.waf-filter-section.active .waf-toggle-icon {
    color: #fff;
}

.waf-toggle-icon::before {
    content: '+';
    font-size: 18px;
    font-weight: 300;
}

.waf-filter-section.active .waf-toggle-icon::before {
    content: '+';
    transform: rotate(45deg);
    display: inline-block;
}

.waf-filter-content {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    background: #d9d4c8;
    border: 1px solid #c4bfb3;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 280px;
    max-width: 340px;
    max-height: 350px;
    overflow-y: auto;
    padding: 18px;
}

/* Dropdown arrow/triangle */
.waf-filter-content::before {
    content: '';
    position: absolute;
    top: -9px;
    left: 30px;
    width: 0;
    height: 0;
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    border-bottom: 9px solid #c4bfb3;
}

.waf-filter-content::after {
    content: '';
    position: absolute;
    top: -7px;
    left: 31px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #d9d4c8;
}

.waf-dropdown-title {
    font-size: 15px;
    font-weight: 500;
    color: #2d2d2d;
    margin: 0 0 12px 0;
    padding: 0;
    text-transform: none;
}

.waf-filter-options {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.waf-filter-option {
    margin-bottom: 0;
}

.waf-filter-label {
    display: inline-block;
    cursor: pointer;
    font-size: 10px;
    color: #4a4a4a;
    background: #fff;
    padding: 7px 14px;
    border-radius: 3px;
    border: none;
    transition: all 0.2s ease;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
    line-height: 1;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.waf-filter-label:hover {
    background: #f5f5f5;
    color: #2d2d2d;
}

.waf-filter-checkbox {
    display: none;
}

.waf-filter-checkbox:checked + .waf-filter-label {
    background: #2d2d2d;
    color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.waf-term-name {
    display: inline-block;
}

.waf-term-count {
    display: none;
}

/* Filter Actions */
.waf-filter-actions {
    margin-left: auto;
}

.waf-clear-filters {
    display: inline-block;
    padding: 12px 24px;
    background: #e8e8e8;
    border: none;
    color: #2d2d2d;
    cursor: pointer;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    white-space: nowrap;
}

.waf-clear-filters:hover {
    background: #d0d0d0;
    color: #2d2d2d;
}

.waf-active-filters-badge {
    display: inline-block;
    background: #e74c3c;
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    margin-left: 5px;
}

/* Products Container */
.waf-products-wrapper-full {
    width: 100%;
}

.waf-products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

.waf-results-count {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.waf-sort-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.waf-sort-label {
    font-size: 14px;
    color: #666;
}

.waf-sort-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 14px;
    cursor: pointer;
    background: #fff;
}

.waf-products-container {
    position: relative;
    min-height: 400px;
}

.waf-products-container.waf-loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Products Grid */
.waf-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
}

/* Product Item */
.waf-product-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.waf-product-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.waf-product-image {
    position: relative;
    overflow: hidden;
    background: #f8f8f8;
    padding-top: 100%;
}

.waf-product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.waf-product-item:hover .waf-product-image img {
    transform: scale(1.05);
}

.waf-product-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #e74c3c;
    color: #fff;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 3px;
    z-index: 1;
}

.waf-product-badge.essential {
    background: #3498db;
}

.waf-product-details {
    padding: 15px;
}

.waf-product-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 10px 0;
    line-height: 1.4;
}

.waf-product-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s ease;
}

.waf-product-title a:hover {
    color: #3498db;
}

.waf-product-price {
    font-size: 18px;
    font-weight: 700;
    color: #e74c3c;
    margin-bottom: 10px;
}

.waf-product-price del {
    color: #999;
    font-size: 14px;
    margin-right: 5px;
}

.waf-add-to-cart {
    display: block;
    width: 100%;
    padding: 10px;
    background: #333;
    color: #fff;
    text-align: center;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.3s ease;
    text-decoration: none;
}

.waf-add-to-cart:hover {
    background: #000;
    color: #fff;
}

/* Loading Spinner */
.waf-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.waf-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #333;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: waf-spin 1s linear infinite;
}

@keyframes waf-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Pagination */
.waf-pagination {
    margin-top: 40px;
    text-align: center;
}

.waf-pagination ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: inline-flex;
    gap: 5px;
}

.waf-pagination li {
    display: inline-block;
}

.waf-pagination a,
.waf-pagination span {
    display: block;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #ddd;
    color: #333;
    text-decoration: none;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.waf-pagination a:hover {
    background: #333;
    color: #fff;
    border-color: #333;
}

.waf-pagination .current {
    background: #333;
    color: #fff;
    border-color: #333;
}

/* No Products Message */
.waf-no-products {
    text-align: center;
    padding: 60px 20px;
    font-size: 16px;
    color: #666;
}

.waf-error {
    text-align: center;
    padding: 60px 20px;
    font-size: 16px;
    color: #e74c3c;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .waf-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .waf-filters-wrapper {
        flex-direction: column;
        align-items: stretch;
    }
    
    .waf-filter-section {
        width: 100%;
    }
    
    .waf-filter-header {
        width: 100%;
        justify-content: space-between;
    }
    
    .waf-filter-content {
        position: static;
        box-shadow: none;
        border: none;
        border-top: 1px solid #ddd;
        margin-top: 10px;
    }
    
    .waf-filter-actions {
        margin-left: 0;
        width: 100%;
    }
    
    .waf-clear-filters {
        width: 100%;
        text-align: center;
    }
    
    .waf-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .waf-products-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .waf-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .waf-product-details {
        padding: 10px;
    }
    
    .waf-product-title {
        font-size: 14px;
    }
    
    .waf-product-price {
        font-size: 16px;
    }
}
