/**
 * WooCommerce Product Filters for Elementor
 * Styles - matches dark sidebar design with full customization via Elementor
 */

/* ============================================================
   CONTAINER
   ============================================================ */
.wpf-container {
    font-family: inherit;
    box-sizing: border-box;
    width: 100%;
}

.wpf-container *,
.wpf-container *::before,
.wpf-container *::after {
    box-sizing: border-box;
}

/* ============================================================
   SECTION TITLES ("SEARCH BY" / "FILTER BY")
   ============================================================ */
.wpf-section-title {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin: 0 0 20px 0;
    padding: 0;
}

.wpf-section-title--filter {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

/* ============================================================
   FILTER GROUPS
   ============================================================ */
.wpf-filter-group {
    margin-bottom: 15px;
}

.wpf-filter-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wpf-filter-label--clickable {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    padding-bottom: 4px;
}

.wpf-filter-label--clickable:hover {
    opacity: 0.8;
}

.wpf-toggle-icon {
    font-size: 12px;
    transition: transform 0.2s ease;
}

/* ============================================================
   DROPDOWN (SELECT)
   ============================================================ */
.wpf-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 14px;
    appearance: auto;
    outline: none;
    transition: border-color 0.2s ease;
}

.wpf-select:focus {
    border-color: rgba(255, 255, 255, 0.5);
}

/* ============================================================
   RANGE INPUTS (From - To)
   ============================================================ */
.wpf-range-inputs {
    display: flex;
    gap: 6px;
    align-items: center;
}

.wpf-range-prefix {
    font-size: 14px;
    font-weight: 600;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.9);
    color: #666;
    border-radius: 4px 0 0 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-right: none;
    line-height: 1;
    display: flex;
    align-items: center;
}

.wpf-range-prefix + .wpf-input-min {
    border-radius: 0;
}

.wpf-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
    -moz-appearance: textfield;
}

.wpf-input::-webkit-outer-spin-button,
.wpf-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.wpf-input:focus {
    border-color: rgba(255, 255, 255, 0.5);
}

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

/* ============================================================
   BUTTONS
   ============================================================ */
.wpf-buttons {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wpf-btn {
    width: 100%;
    padding: 12px 16px;
    border: none;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 4px;
    transition: opacity 0.2s ease, transform 0.1s ease;
    text-align: center;
}

.wpf-btn:hover {
    opacity: 0.9;
}

.wpf-btn:active {
    transform: scale(0.98);
}

.wpf-btn-update {
    /* Colors set by Elementor controls */
}

.wpf-btn-reset {
    /* Colors set by Elementor controls */
}

/* ============================================================
   CHECKBOX FILTERS
   ============================================================ */
.wpf-checkbox-group {
    margin-bottom: 18px;
}

.wpf-checkbox-list {
    padding-left: 0;
}

.wpf-checkbox-item {
    margin-bottom: 4px;
}

.wpf-checkbox-item label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px 0;
    font-size: 14px;
    transition: opacity 0.15s ease;
}

.wpf-checkbox-item label:hover {
    opacity: 0.8;
}

.wpf-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #4a6a8a;
    flex-shrink: 0;
}

.wpf-checkbox-name {
    flex: 1;
    font-size: 14px;
}

.wpf-checkbox-count {
    font-size: 13px;
    opacity: 0.7;
    margin-left: auto;
}

.wpf-remove-filter {
    cursor: pointer;
    font-size: 12px;
    opacity: 0.6;
    margin-left: 4px;
    transition: opacity 0.15s ease;
}

.wpf-remove-filter:hover {
    opacity: 1;
}

.wpf-no-options {
    font-size: 13px;
    opacity: 0.6;
    font-style: italic;
    margin: 4px 0;
}

.wpf-error {
    font-size: 12px;
    color: #ff6b6b;
    margin: 4px 0;
}

/* Hidden input */
.wpf-hidden-checkbox-value {
    display: none;
}

/* ============================================================
   SEARCH BY - CHECKBOX VARIANT
   ============================================================ */
.wpf-search-checkbox-group .wpf-checkbox-list {
    max-height: 220px;
    overflow-y: auto;
    padding-right: 4px;
}

.wpf-search-checkbox-group .wpf-checkbox-list::-webkit-scrollbar {
    width: 4px;
}

.wpf-search-checkbox-group .wpf-checkbox-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

/* ============================================================
   HORIZONTAL LAYOUT
   ============================================================ */
.wpf-horizontal .wpf-search-by {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
}

.wpf-horizontal .wpf-filter-group {
    flex: 1;
    min-width: 150px;
    margin-bottom: 0;
}

.wpf-horizontal .wpf-buttons {
    flex-direction: row;
    margin-top: 0;
    flex: 0 0 auto;
}

.wpf-horizontal .wpf-btn {
    width: auto;
    white-space: nowrap;
}

.wpf-horizontal .wpf-section-title {
    width: 100%;
    margin-bottom: 15px;
}

.wpf-horizontal .wpf-section-title--filter {
    border-top: none;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.wpf-horizontal .wpf-filter-by {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.wpf-horizontal .wpf-checkbox-group {
    flex: 1;
    min-width: 150px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 767px) {
    .wpf-horizontal .wpf-search-by {
        flex-direction: column;
    }

    .wpf-horizontal .wpf-filter-group {
        min-width: 100%;
    }

    .wpf-horizontal .wpf-buttons {
        flex-direction: column;
    }

    .wpf-horizontal .wpf-btn {
        width: 100%;
    }

    .wpf-horizontal .wpf-filter-by {
        flex-direction: column;
    }

    .wpf-horizontal .wpf-checkbox-group {
        min-width: 100%;
    }
}

/* ============================================================
   LOADING STATE
   ============================================================ */
.wpf-container.wpf-loading {
    opacity: 0.7;
    pointer-events: none;
}

.wpf-container.wpf-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: wpf-spin 0.6s linear infinite;
}

@keyframes wpf-spin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   ACTIVE FILTER TAGS (shown when filters are active)
   ============================================================ */
.wpf-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 15px;
}

.wpf-active-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s ease;
}

.wpf-active-tag:hover {
    background: rgba(255, 255, 255, 0.25);
}

.wpf-active-tag .wpf-tag-remove {
    font-size: 10px;
    opacity: 0.7;
}
