/* ============================================================
 * Woo Elementor Filter Bar — Frontend Styles
 * ============================================================ */

.wef-wrap { width: 100%; }

.wef-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    border-top: 1px solid #e5e5e5;
    border-bottom: 1px solid #e5e5e5;
    font-size: 14px;
    color: #3a3a3a;
    flex-wrap: wrap;
    gap: 12px;
}

.wef-bar-left {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.wef-bar-right {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-left: auto;
    flex-wrap: wrap;
}

.wef-filter-label { color: #7a7a7a; font-weight: 400; }

/* Triggers */
.wef-trigger-wrap { position: relative; }

.wef-trigger {
    background: none; border: 0; padding: 0; margin: 0;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 8px;
    font: inherit; color: inherit;
    line-height: 1.4;
}
.wef-trigger:focus { outline: none; }
.wef-trigger:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }

.wef-trigger-text { text-decoration: none; }
.wef-trigger.is-active .wef-trigger-text,
.wef-trigger:hover .wef-trigger-text {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.wef-chevron {
    display: inline-flex; align-items: center;
    transition: transform 0.18s ease;
}
.wef-trigger.is-active .wef-chevron { transform: rotate(180deg); }

/* Dropdown */
.wef-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    z-index: 9999;
    min-width: 360px;
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    padding: 0 0 8px 0;
}
.wef-dropdown[hidden] { display: none; }

.wef-dropdown-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e5e5;
}

.wef-dropdown-info { color: #7a7a7a; font-size: 14px; }

.wef-reset {
    background: none; border: 0; padding: 0;
    cursor: pointer;
    color: #3a3a3a; font: inherit;
    text-decoration: underline;
    text-underline-offset: 4px;
}
.wef-reset:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

.wef-dropdown-body { padding: 12px 20px 4px; }

/* Category lists can be long — cap height and allow scrolling. */
.wef-dropdown-category .wef-dropdown-body {
    max-height: 320px;
    overflow-y: auto;
}
.wef-dropdown-category .wef-dropdown-body::-webkit-scrollbar { width: 8px; }
.wef-dropdown-category .wef-dropdown-body::-webkit-scrollbar-thumb {
    background: #d5d5d5; border-radius: 4px;
}
/* Categories with no matches under the current search — dimmed but still usable. */
.wef-checkbox--empty .wef-check-label { opacity: .45; }

/* Custom Checkbox */
.wef-checkbox {
    display: flex; align-items: center; gap: 12px;
    padding: 8px 0;
    cursor: pointer;
    user-select: none;
}
.wef-checkbox input {
    position: absolute; opacity: 0;
    width: 1px; height: 1px;
    pointer-events: none;
}
.wef-check-box {
    width: 18px; height: 18px;
    border: 1px solid #cdcdcd;
    border-radius: 3px;
    background: #ffffff;
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s ease;
    position: relative;
}
.wef-checkbox input:checked + .wef-check-box {
    background-color: #3a3a3a;
    border-color: #3a3a3a;
}
.wef-checkbox input:checked + .wef-check-box::after {
    content: '';
    width: 5px; height: 9px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) translate(-1px, -1px);
}
.wef-checkbox input:focus-visible + .wef-check-box {
    outline: 2px solid currentColor; outline-offset: 2px;
}
.wef-check-label { font-size: 14px; color: #3a3a3a; }

/* Price inputs */
.wef-price-body {
    display: flex; align-items: center; gap: 12px;
    padding: 16px 20px;
}
.wef-price-field {
    display: flex; align-items: center; gap: 8px;
    flex: 1;
}
.wef-currency { color: #7a7a7a; font-size: 14px; flex-shrink: 0; }
.wef-price-input {
    flex: 1; width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 1px solid #cdcdcd;
    border-radius: 4px;
    background: #ffffff;
    font-size: 14px; color: #3a3a3a;
    -moz-appearance: textfield;
}
.wef-price-input::-webkit-outer-spin-button,
.wef-price-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.wef-price-input::placeholder { color: #9a9a9a; }
.wef-price-input:focus { outline: none; border-color: #3a3a3a; }

/* Sort & Count */
.wef-sort { display: flex; align-items: center; gap: 12px; }
.wef-sort-label { color: #7a7a7a; font-size: 14px; }
.wef-sort-select-wrap { position: relative; display: inline-flex; align-items: center; }
.wef-sort-select {
    appearance: none; -webkit-appearance: none; -moz-appearance: none;
    background: transparent; border: 0;
    padding: 0 24px 0 0;
    font: inherit; color: inherit;
    cursor: pointer; line-height: 1.4;
}
.wef-sort-select:focus { outline: none; }
.wef-sort-select:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
.wef-sort-select-wrap .wef-chevron { position: absolute; right: 0; pointer-events: none; }
.wef-count { color: #7a7a7a; font-size: 14px; white-space: nowrap; }

/* Per-page selector — mirrors the sort selector styling. */
.wef-perpage { display: flex; align-items: center; gap: 12px; }
.wef-perpage-label { color: #7a7a7a; font-size: 14px; white-space: nowrap; }
.wef-perpage-select-wrap { position: relative; display: inline-flex; align-items: center; }
.wef-perpage-select {
    appearance: none; -webkit-appearance: none; -moz-appearance: none;
    background: transparent; border: 0;
    padding: 0 24px 0 0;
    font: inherit; color: inherit;
    cursor: pointer; line-height: 1.4;
}
.wef-perpage-select:focus { outline: none; }
.wef-perpage-select:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
.wef-perpage-select-wrap .wef-chevron { position: absolute; right: 0; pointer-events: none; }

/* Loading */
.wef-loading {
    position: relative;
    pointer-events: none;
    transition: opacity 0.2s ease;
}
.wef-loading > * {
    opacity: 0.4;
    transition: opacity 0.2s ease;
}
.wef-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px; height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid #e5e5e5;
    border-top-color: #3a3a3a;
    border-radius: 50%;
    animation: wef-spin 0.8s linear infinite;
    pointer-events: none;
    z-index: 10;
}
@keyframes wef-spin { to { transform: rotate(360deg); } }

/* Visible loading bar overlay above grid - more reliable than centering inside grid */
.wef-loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #3a3a3a, transparent);
    background-size: 200% 100%;
    animation: wef-loading-slide 1s linear infinite;
    z-index: 99999;
    pointer-events: none;
}
@keyframes wef-loading-slide {
    from { background-position: 200% 0; }
    to { background-position: -200% 0; }
}

.wef-no-products { padding: 40px 20px; text-align: center; color: #7a7a7a; }

/* ============================================================
 * Pagination
 * ============================================================ */
.wef-pagination {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 32px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Filter Bar pagination — stronger spacing since it's after the grid */
.wef-pagination--filterbar {
    margin-top: 48px;
    margin-bottom: 16px;
    width: 100%;
}

.wef-pagination[hidden] { display: none; }

.wef-pagination__item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #cdcdcd;
    border-radius: 4px;
    background: #ffffff;
    color: #3a3a3a;
    cursor: pointer;
    font-size: 14px;
    font: inherit;
    line-height: 1;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.wef-pagination__item:hover:not(.is-current):not(.is-disabled) {
    border-color: #3a3a3a;
}

.wef-pagination__item.is-current {
    background-color: #3a3a3a;
    border-color: #3a3a3a;
    color: #ffffff;
    cursor: default;
}

.wef-pagination__item.is-disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.wef-pagination__dots {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    color: #7a7a7a;
}

/* Mobile */
@media (max-width: 768px) {
    .wef-bar { gap: 16px; }
    .wef-bar-left, .wef-bar-right { gap: 16px; width: 100%; }
    .wef-bar-right { justify-content: space-between; }
    .wef-dropdown { min-width: 280px; max-width: calc(100vw - 32px); }
}

@media (max-width: 480px) {
    .wef-dropdown {
        position: fixed;
        top: auto;
        left: 16px;
        right: 16px;
        min-width: 0;
    }
}
