/**
 * LHE Product Filters - Styles
 * Professional, clean styling for product filters
 */

/* ===========================
   Filter Container
   =========================== */

.lhe-product-filters {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 30px;
}

.lhe-filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f5f5f5;
}

.lhe-filters-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

/* ===========================
   Filter Notice
   =========================== */

.lhe-filters-notice {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    padding: 12px 15px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #856404;
}

/* ===========================
   Filter Groups
   =========================== */

.lhe-filter-group {
    margin-bottom: 15px;
    transition: opacity 0.3s ease;
}

.lhe-filter-group.lhe-filter-disabled {
    opacity: 0.5;
}

.lhe-filter-title {
    margin: 0 0 8px 0;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.lhe-filter-active-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #2c5282;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 12px;
    min-width: 20px;
    height: 20px;
}

/* ===========================
   Filter Terms
   =========================== */

.lhe-filter-terms {
    list-style: none;
    margin: 0;
    padding: 0;
}

.lhe-filter-term {
    margin-bottom: 4px;
}

.lhe-filter-term label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 3px 0;
    transition: color 0.2s ease;
}

.lhe-filter-term label:hover {
    color: #2c5282;
}

.lhe-filter-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
}

.lhe-filter-checkbox:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.lhe-term-name {
    flex: 1;
    font-size: 13px;
    line-height: 1.3;
}

.lhe-term-count {
    font-size: 12px;
    color: #666;
    margin-left: auto;
}

/* ===========================
   Filter Actions
   =========================== */

.lhe-filters-actions {
    display: flex;
    gap: 8px;
    margin-top: 15px;
}

.lhe-filters-actions-top {
    margin-top: 0;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.lhe-filters-actions-bottom {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.lhe-apply-filters,
.lhe-clear-filters {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lhe-apply-filters {
    background: #2c5282;
    color: #fff;
    flex: 1;
}

.lhe-apply-filters:hover {
    background: #1e3a5f;
}

.lhe-apply-filters:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.lhe-clear-filters {
    background: #f5f5f5;
    color: #333;
}

.lhe-clear-filters:hover {
    background: #e0e0e0;
}

/* Small clear button in header */
.lhe-filters-header .lhe-clear-filters {
    padding: 6px 12px;
    font-size: 12px;
    text-transform: none;
    letter-spacing: normal;
}

/* ===========================
   Loading States
   =========================== */

.lhe-filters-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lhe-filters-loading {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

/* ===========================
   Responsive Design
   =========================== */

@media (max-width: 768px) {
    .lhe-product-filters {
        padding: 15px;
    }
    
    .lhe-filters-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .lhe-filters-actions {
        flex-direction: column;
    }
    
    .lhe-apply-filters {
        width: 100%;
    }
    
    .lhe-clear-filters {
        width: 100%;
    }
}

/* ===========================
   Sidebar Integration
   =========================== */

/* If filters are in a sidebar, adjust styling */
.sidebar .lhe-product-filters,
.widget-area .lhe-product-filters {
    border: none;
    padding: 0;
}

.sidebar .lhe-filters-header,
.widget-area .lhe-filters-header {
    border-bottom: 1px solid #e0e0e0;
}

.sidebar .lhe-filter-group,
.widget-area .lhe-filter-group {
    margin-bottom: 12px;
}

.sidebar .lhe-filter-title,
.widget-area .lhe-filter-title {
    font-size: 14px;
    margin-bottom: 6px;
}

.sidebar .lhe-filter-term,
.widget-area .lhe-filter-term {
    margin-bottom: 3px;
}

.sidebar .lhe-term-name,
.widget-area .lhe-term-name {
    font-size: 12px;
}

.sidebar .lhe-term-count,
.widget-area .lhe-term-count {
    font-size: 11px;
}

.sidebar .lhe-filters-actions,
.widget-area .lhe-filters-actions {
    margin-top: 10px;
}

.sidebar .lhe-filters-actions-top,
.widget-area .lhe-filters-actions-top {
    margin-bottom: 10px;
    padding-bottom: 10px;
}

.sidebar .lhe-filters-actions-bottom,
.widget-area .lhe-filters-actions-bottom {
    margin-top: 10px;
    padding-top: 10px;
}

/* ===========================
   WooCommerce Integration
   =========================== */

/* Ensure proper spacing with WooCommerce elements */
.woocommerce .lhe-product-filters {
    clear: both;
}

/* Style pagination when filters are active */
.lhe-filters-active .woocommerce-pagination {
    margin-top: 30px;
}

/* ===========================
   Accessibility
   =========================== */

.lhe-filter-checkbox:focus {
    outline: 2px solid #2c5282;
    outline-offset: 2px;
}

.lhe-apply-filters:focus,
.lhe-clear-filters:focus {
    outline: 2px solid #2c5282;
    outline-offset: 2px;
}

/* Screen reader only text */
.lhe-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ===========================
   Print Styles
   =========================== */

@media print {
    .lhe-product-filters {
        display: none;
    }
}
