/* WP Filter HQ — Frontend v1.5.0 */

.wpfhq-instance {
    font-family: var(--wpfhq-font, inherit) !important;
}

.wpfhq-cards {
    display: grid !important;
    grid-template-columns: repeat(var(--wpfhq-cols, 3), 1fr) !important;
    gap: 24px !important;
}

@media (max-width: 768px) {
    .wpfhq-cards {
        grid-template-columns: repeat(var(--wpfhq-cols-mobile, 1), 1fr) !important;
        gap: 16px !important;
    }
}

.wpfhq-count {
    font-size: 13px;
    color: #999;
    margin-bottom: 16px;
}

/* =========================================
   Card
   ========================================= */

.wpfhq-card {
    background: var(--wpfhq-card-bg, #fff) !important;
    border-radius: var(--wpfhq-card-radius, 8px) !important;
    overflow: hidden !important;
    border: 1px solid rgba(0,0,0,0.08) !important;
    display: flex !important;
    flex-direction: column !important;
    transition: box-shadow 0.2s ease;
}

.wpfhq-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.10) !important;
}

.wpfhq-card-img {
    position: relative !important;
    aspect-ratio: 16/9;
    overflow: hidden !important;
    background: #f0ede8 !important;
}

.wpfhq-card-img a,
.wpfhq-card-img > .wpfhq-card-link {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
}

.wpfhq-card-img img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    transition: transform 0.3s ease;
}

.wpfhq-card:hover .wpfhq-card-img img {
    transform: scale(1.03);
}

.wpfhq-card-img-placeholder {
    width: 100% !important;
    height: 100% !important;
    background: #ede9e3 !important;
}

/* Price badge */
.wpfhq-price-badge {
    position: absolute !important;
    top: 10px !important;
    left: 10px !important;
    background: var(--wpfhq-badge, #C1854B) !important;
    color: #fff !important;
    font-family: var(--wpfhq-badge-font, inherit) !important;
    font-size: var(--wpfhq-badge-fs, 13px) !important;
    font-weight: 600 !important;
    padding: var(--wpfhq-badge-pad-v, 4px) var(--wpfhq-badge-pad-h, 10px) !important;
    border-radius: var(--wpfhq-badge-radius, 4px) !important;
    line-height: 1.4 !important;
    display: inline-block !important;
}

.wpfhq-price-badge *,
.wpfhq-price-badge bdi,
.wpfhq-price-badge span {
    color: #fff !important;
    font-size: inherit !important;
}

/* Card body */
.wpfhq-card-body {
    padding: 18px 20px 20px !important;
    display: flex !important;
    flex-direction: column !important;
    flex: 1 !important;
}

.wpfhq-card-title {
    margin: 0 0 10px !important;
    line-height: 1.35 !important;
    font-family: var(--wpfhq-font, inherit) !important;
    font-size: var(--wpfhq-title-size, 16px) !important;
    font-weight: var(--wpfhq-title-weight, 600) !important;
    text-align: var(--wpfhq-title-align, left) !important;
    color: var(--wpfhq-title-color, inherit) !important;
}

.wpfhq-card-title a {
    color: var(--wpfhq-title-color, inherit) !important;
    text-decoration: none !important;
}

.wpfhq-card-title a:hover {
    color: var(--wpfhq-title-hover, var(--wpfhq-accent, #44b748)) !important;
    text-decoration: none !important;
}

.wpfhq-card-desc {
    font-family: var(--wpfhq-desc-font, inherit) !important;
    font-size: var(--wpfhq-desc-size, 14px) !important;
    color: var(--wpfhq-desc-color, inherit) !important;
    line-height: 1.55 !important;
    margin: 0 0 16px !important;
    flex: 1 !important;
}

/* =========================================
   Buttons
   ========================================= */

.wpfhq-card-btns {
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    margin-top: auto !important;
}

.wpfhq-btns--left          { justify-content: flex-start !important; }
.wpfhq-btns--right         { justify-content: flex-end !important; }
.wpfhq-btns--space-between { justify-content: space-between !important; }

.wpfhq-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    cursor: pointer !important;
    line-height: 1 !important;
    border: none !important;
    white-space: nowrap !important;
    transition: background 0.15s ease, opacity 0.15s ease;
}

.wpfhq-btn .dashicons {
    font-size: 14px !important;
    width: 14px !important;
    height: 14px !important;
    line-height: 1 !important;
}

.wpfhq-btn-primary {
    background: var(--wpfhq-accent, #44b748) !important;
    color: #fff !important;
    padding: var(--wpfhq-pri-pad-v, 8px) var(--wpfhq-pri-pad-h, 16px) !important;
    font-size: var(--wpfhq-pri-fs, 13px) !important;
    border-radius: var(--wpfhq-pri-radius, 4px) !important;
}

.wpfhq-btn-primary:hover {
    background: var(--wpfhq-pri-hover, var(--wpfhq-accent, #44b748)) !important;
    opacity: 0.88;
    color: #fff !important;
    text-decoration: none !important;
}

.wpfhq-btn-secondary {
    background: transparent !important;
    color: inherit !important;
    border: 1px solid rgba(0,0,0,0.18) !important;
    padding: var(--wpfhq-sec-pad-v, 8px) var(--wpfhq-sec-pad-h, 16px) !important;
    font-size: var(--wpfhq-sec-fs, 13px) !important;
    border-radius: var(--wpfhq-sec-radius, 4px) !important;
}

.wpfhq-btn-secondary:hover {
    border-color: rgba(0,0,0,0.35) !important;
    color: inherit !important;
    text-decoration: none !important;
    background: transparent !important;
}

.wpfhq-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px 24px;
    color: #999;
    font-size: 15px;
}

/* =========================================
   Load More
   ========================================= */

.wpfhq-load-more-wrap {
    display: flex !important;
    justify-content: center !important;
    margin-top: 40px !important;
}

/* Nothing more to load. Beats the display above (same !important, more specific). */
.wpfhq-load-more-wrap[hidden] {
    display: none !important;
}

.wpfhq-load-more {
    width: var(--wpfhq-lm-size, 120px) !important;
    height: var(--wpfhq-lm-size, 120px) !important;
    border-radius: 50% !important;
    border: 1.5px solid var(--wpfhq-lm-border, #C1854B) !important;
    background: transparent !important;
    color: var(--wpfhq-lm-text, #C1854B) !important;
    font-family: var(--wpfhq-lm-font, inherit) !important;
    font-size: var(--wpfhq-lm-font-size, 16px) !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background 0.25s ease, color 0.25s ease;
    padding: 0 !important;
    text-decoration: none !important;
}

.wpfhq-load-more:hover {
    background: var(--wpfhq-lm-hover-fill, #C1854B) !important;
    color: var(--wpfhq-lm-hover-text, #fff) !important;
    text-decoration: none !important;
}

.wpfhq-lm-text {
    text-align: center !important;
    line-height: 1.2 !important;
    display: block !important;
    pointer-events: none;
    /* Keep the label inside the circle: as a flex item it would otherwise be as
       wide as its text and run edge to edge. It wraps onto balanced lines instead. */
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 0 20px !important;
    text-wrap: balance;
}

.wpfhq-load-more.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* =========================================
   Filter sidebar
   ========================================= */

.wpfhq-filter-wrap {
    font-family: var(--wpfhq-font, inherit) !important;
}

.wpfhq-search-wrap {
    margin-bottom: var(--wpfhq-search-mb, 24px) !important;
}

.wpfhq-search-label-desktop {
    display: block !important;
    margin-bottom: 8px !important;
    font-family: var(--wpfhq-sl-font, inherit) !important;
    font-size: var(--wpfhq-sl-size, 15px) !important;
    color: var(--wpfhq-sl-color, inherit) !important;
    font-weight: var(--wpfhq-sl-weight, 600) !important;
}

.wpfhq-search-inner {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
}

.wpfhq-search {
    width: 100% !important;
    padding: var(--wpfhq-search-pad-v, 9px) 36px var(--wpfhq-search-pad-v, 9px) var(--wpfhq-search-pad-h, 12px) !important;
    border: var(--wpfhq-search-bw, 1px) solid var(--wpfhq-search-border, rgba(0,0,0,0.15)) !important;
    border-radius: var(--wpfhq-search-radius, 6px) !important;
    font-size: var(--wpfhq-search-fs, 14px) !important;
    background: var(--wpfhq-search-bg, #fff) !important;
    color: inherit !important;
    font-family: inherit !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    box-sizing: border-box !important;
}

.wpfhq-search:focus {
    outline: none !important;
    border-color: var(--wpfhq-search-focus, #44b748) !important;
}

.wpfhq-search-icon {
    position: absolute !important;
    right: 10px !important;
    color: #aaa !important;
    pointer-events: none !important;
    flex-shrink: 0 !important;
}

.wpfhq-filter-section {
    margin-bottom: 28px !important;
}

.wpfhq-filter-heading {
    display: block !important;
    font-family: var(--wpfhq-fh-font, inherit) !important;
    font-size: var(--wpfhq-fh-size, 12px) !important;
    color: var(--wpfhq-fh-color, inherit) !important;
    font-weight: var(--wpfhq-fh-weight, 600) !important;
    letter-spacing: 0.03em !important;
    margin-bottom: 12px !important;
    text-transform: uppercase !important;
}

/* Custom checkboxes & radios */
.wpfhq-filter-option {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 5px 0 !important;
    cursor: pointer !important;
    line-height: 1.4 !important;
    user-select: none !important;
    font-family: var(--wpfhq-fo-font, inherit) !important;
    font-size: var(--wpfhq-fo-size, 13px) !important;
    color: var(--wpfhq-fo-color, inherit) !important;
}

.wpfhq-filter-option input[type="checkbox"],
.wpfhq-filter-option input[type="radio"] {
    position: absolute !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
}

.wpfhq-custom-input {
    width: 17px !important;
    height: 17px !important;
    border: 1.5px solid rgba(0,0,0,0.22) !important;
    border-radius: 3px !important;
    background: #fff !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: border-color 0.15s, background 0.15s;
}

.wpfhq-filter-radio .wpfhq-custom-input {
    border-radius: 50% !important;
}

.wpfhq-filter-option input:checked + .wpfhq-custom-input {
    background: var(--wpfhq-active, #44b748) !important;
    border-color: var(--wpfhq-active, #44b748) !important;
}

.wpfhq-filter-option input:checked + .wpfhq-custom-input::after {
    content: '' !important;
    display: block !important;
}

.wpfhq-filter-checkbox input:checked + .wpfhq-custom-input::after {
    width: 9px !important;
    height: 5px !important;
    border-left: 2px solid #fff !important;
    border-bottom: 2px solid #fff !important;
    transform: rotate(-45deg) translateY(-1px) !important;
}

.wpfhq-filter-radio input:checked + .wpfhq-custom-input::after {
    width: 7px !important;
    height: 7px !important;
    border-radius: 50% !important;
    background: #fff !important;
}

.wpfhq-filter-option:has(input:checked) > span:last-child {
    color: var(--wpfhq-active, #44b748) !important;
    font-weight: 500 !important;
}

.wpfhq-filter-option > span:last-child {
    font-family: var(--wpfhq-fo-font, inherit) !important;
    font-size: var(--wpfhq-fo-size, 13px) !important;
    color: var(--wpfhq-fo-color, inherit) !important;
}

/* Dropdown — desktop */
.wpfhq-filter-dropdown-wrap {
    position: relative !important;
}

.wpfhq-filter-dropdown {
    width: 100% !important;
    padding: 8px 32px 8px 12px !important;
    border: 1px solid rgba(0,0,0,0.15) !important;
    border-radius: 6px !important;
    background: #fff !important;
    color: inherit !important;
    font-family: var(--wpfhq-fo-font, inherit) !important;
    font-size: var(--wpfhq-fo-size, 13px) !important;
    cursor: pointer !important;
    appearance: none !important;
    -webkit-appearance: none !important;
}

.wpfhq-filter-dropdown:focus {
    outline: none !important;
    border-color: var(--wpfhq-active, #44b748) !important;
}

.wpfhq-filter-dropdown-wrap::after {
    content: '' !important;
    position: absolute !important;
    right: 10px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 0 !important;
    height: 0 !important;
    border-left: 5px solid transparent !important;
    border-right: 5px solid transparent !important;
    border-top: 5px solid #888 !important;
    pointer-events: none !important;
}

/* Mobile: hide dropdown select, show checkbox fallback */
.wpfhq-dropdown-mobile-fallback {
    display: none !important;
}

@media (max-width: 768px) {
    .wpfhq-filter-dropdown-wrap {
        display: none !important;
    }
    .wpfhq-dropdown-mobile-fallback {
        display: block !important;
    }
}

/* =========================================
   Mobile drawer
   ========================================= */

.wpfhq-mobile-toggle {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    cursor: pointer;
    border-bottom: 1px solid rgba(0,0,0,0.1);
    margin-bottom: 16px;
}

.wpfhq-mobile-toggle-label {
    font-family: var(--wpfhq-ml-font, inherit) !important;
    font-size: var(--wpfhq-ml-size, 15px) !important;
    color: var(--wpfhq-ml-color, inherit) !important;
    font-weight: var(--wpfhq-ml-weight, 500) !important;
}

.wpfhq-toggle-icon {
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .wpfhq-mobile-toggle {
        display: flex !important;
    }

    .wpfhq-filter-body {
        overflow: hidden !important;
        max-height: 0 !important;
        transition: max-height 0.35s ease;
    }

    .wpfhq-filter-body.is-open {
        max-height: 3000px !important;
    }

    .wpfhq-filter-wrap.is-open .wpfhq-toggle-icon {
        transform: rotate(180deg);
    }

    .wpfhq-search-label-desktop {
        display: none !important;
    }
}

.wpfhq-card-desc p {
    font-family: var(--wpfhq-desc-font, inherit) !important;
    font-size: var(--wpfhq-desc-size, 14px) !important;
    color: var(--wpfhq-desc-color, inherit) !important;
    margin: 0 0 8px !important;
}

.wpfhq-card-desc p:last-child {
    margin-bottom: 0 !important;
}

.wpfhq-cards.is-loading {
    opacity: 0.45;
    pointer-events: none;
    transition: opacity 0.2s;
}

/* ════════════════════════════════════════════════════════════════════════
   Grouped Row List (v1.6)
   ════════════════════════════════════════════════════════════════════════ */

.wpfhq-grouped-rows .wpfhq-group {
    margin-bottom: 32px !important;
}

.wpfhq-group-heading {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    margin-bottom: 12px !important;
}

.wpfhq-group-accent {
    flex: 0 0 auto !important;
    width: 6px !important;
    height: 20px !important;
    border-radius: 2px !important;
    background: var(--wpfhq-group-accent, #cca128) !important;
}

.wpfhq-group-title {
    margin: 0 !important;
    color: var(--wpfhq-group-heading-color, inherit) !important;
    line-height: 1.2 !important;
}

.wpfhq-group-count {
    font-size: 13px !important;
    opacity: 0.6 !important;
}

.wpfhq-row-list {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.wpfhq-row {
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
    padding: 12px 0 !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
}

.wpfhq-row-icon {
    flex: 0 0 auto !important;
    width: 34px !important;
    height: 34px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
}

.wpfhq-icon-free {
    color: var(--wpfhq-accent, #44b748) !important;
    background: rgba(68, 183, 72, 0.12) !important;
}

.wpfhq-icon-locked {
    color: #9ca3af !important;
    background: rgba(0, 0, 0, 0.06) !important;
}

.wpfhq-row-body {
    flex: 1 1 auto !important;
    min-width: 0 !important;
}

.wpfhq-row-title {
    display: block !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    color: var(--wpfhq-title-color, inherit) !important;
}

.wpfhq-row-title:hover {
    color: var(--wpfhq-title-hover, var(--wpfhq-accent, #44b748)) !important;
}

.wpfhq-row-desc {
    margin: 2px 0 0 !important;
    font-size: 13px !important;
    opacity: 0.7 !important;
}

.wpfhq-row-meta {
    flex: 0 0 auto !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

.wpfhq-row-meta .wpfhq-badge {
    font-size: 11px !important;
    padding: 3px 8px !important;
    border-radius: 4px !important;
    line-height: 1.4 !important;
}

.wpfhq-badge-difficulty {
    background: rgba(0, 0, 0, 0.06) !important;
    color: #374151 !important;
}

.wpfhq-badge-free {
    background: var(--wpfhq-accent, #44b748) !important;
    color: #fff !important;
    letter-spacing: 0.04em !important;
}

.wpfhq-badge-watched {
    background: rgba(68, 183, 72, 0.15) !important;
    color: var(--wpfhq-accent, #44b748) !important;
}

.wpfhq-row-duration {
    font-size: 13px !important;
    opacity: 0.6 !important;
    font-variant-numeric: tabular-nums !important;
}

/* Free/locked toggle (filter bar) */
.wpfhq-free-toggle {
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
    cursor: pointer !important;
}

.wpfhq-free-toggle input {
    position: absolute !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
}

.wpfhq-free-slider {
    position: relative !important;
    flex: 0 0 auto !important;
    width: 38px !important;
    height: 22px !important;
    border-radius: 22px !important;
    background: rgba(0, 0, 0, 0.2) !important;
    transition: background 0.2s !important;
}

.wpfhq-free-slider::before {
    content: "" !important;
    position: absolute !important;
    top: 3px !important;
    left: 3px !important;
    width: 16px !important;
    height: 16px !important;
    border-radius: 50% !important;
    background: #fff !important;
    transition: transform 0.2s !important;
}

.wpfhq-free-toggle input:checked + .wpfhq-free-slider {
    background: var(--wpfhq-active, var(--wpfhq-accent, #44b748)) !important;
}

.wpfhq-free-toggle input:checked + .wpfhq-free-slider::before {
    transform: translateX(16px) !important;
}

.wpfhq-free-label {
    font-size: var(--wpfhq-fo-size, 13px) !important;
    color: var(--wpfhq-fo-color, inherit) !important;
}

.wpfhq-watch-note {
    margin: 8px 0 0 !important;
    font-size: 12px !important;
    opacity: 0.6 !important;
}

@media (max-width: 600px) {
    .wpfhq-row-desc { display: none !important; }
    .wpfhq-row { gap: 10px !important; }
}

/* ── Lightbox (1.8.0) — cards set to "Show the picture larger" ──────────── */

.wpfhq-card-img a[data-wpfhq-lightbox] { cursor: zoom-in; }

html.wpfhq-lb-open { overflow: hidden; }

.wpfhq-lightbox {
    border: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    background: transparent !important;
    overflow: hidden !important;
}

.wpfhq-lightbox[open] {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.wpfhq-lightbox::backdrop { background: rgba(17, 17, 17, 0.9); }

.wpfhq-lb-figure {
    margin: 0 !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    max-width: calc(100vw - 150px);
}

.wpfhq-lb-img {
    display: block !important;
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: calc(100vh - 120px) !important;
    border-radius: 6px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}

.wpfhq-lb-caption {
    color: #fff !important;
    font-family: var(--wpfhq-font, inherit);
    font-size: 17px;
    line-height: 1.4;
    text-align: center;
}

.wpfhq-lb-close,
.wpfhq-lb-prev,
.wpfhq-lb-next {
    position: absolute !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 48px !important;
    height: 48px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.14) !important;
    color: #fff !important;
    font-size: 30px !important;
    line-height: 1 !important;
    cursor: pointer;
    transition: background 0.15s ease;
}

.wpfhq-lb-close:hover,
.wpfhq-lb-prev:hover,
.wpfhq-lb-next:hover { background: rgba(255, 255, 255, 0.28) !important; }

.wpfhq-lb-close:focus-visible,
.wpfhq-lb-prev:focus-visible,
.wpfhq-lb-next:focus-visible { outline: 2px solid #fff !important; outline-offset: 2px; }

.wpfhq-lb-close { top: 18px; right: 18px; }
.wpfhq-lb-prev  { left: 18px;  top: 50%; transform: translateY(-50%); }
.wpfhq-lb-next  { right: 18px; top: 50%; transform: translateY(-50%); }

.wpfhq-lightbox.is-single .wpfhq-lb-prev,
.wpfhq-lightbox.is-single .wpfhq-lb-next { display: none !important; }

@media (max-width: 700px) {
    .wpfhq-lb-figure { max-width: calc(100vw - 24px); }
    .wpfhq-lb-img { max-height: calc(100vh - 170px) !important; }
    .wpfhq-lb-prev, .wpfhq-lb-next { top: auto; bottom: 18px; transform: none; }
}
