/* ====================================================================
   JITS Filter Bar — Inline pille-knapper med dropdowns
   v5: Filter-bar lige under page-titel
   ==================================================================== */

/* ====================================================================
   FILTER-BAR CONTAINER (blød lyseblå hero-stil)
   ==================================================================== */

.jits-yith-filter-wrapper {
    max-width: 1280px;
    margin: 0 auto 32px !important;
    padding: 0 24px !important;
    font-family: 'IBM Plex Sans', sans-serif;
    background: transparent !important;
    box-shadow: none !important;
    border: 0 !important;
    box-sizing: border-box;
}

/* YITH-container: blød hero-baggrund med gradient */
.jits-yith-filter-wrapper .yith-wcan-filters,
.jits-yith-filter-wrapper .yith-wcan-filters.no-title,
.jits-yith-filter-wrapper .yith-wcan-filters.enhanced {
    background: linear-gradient(180deg, #F0F7FF 0%, #FFFFFF 100%) !important;
    border: 1px solid #DBEAFE !important;
    border-radius: 16px !important;
    padding: 28px 32px !important;
    margin: 0 !important;
    box-shadow: none !important;
}

/* Skjul mobile-only h3 */
.jits-yith-filter-wrapper .yith-wcan-filters h3.mobile-only {
    display: none !important;
}

/* ====================================================================
   "FILTRÉR PRODUKTER" KICKER + OVERSKRIFT
   Kicker placeres på YITH-wrapper, overskrift på filters-container
   ==================================================================== */

.jits-yith-filter-wrapper .yith-wcan-filters::before {
    content: 'Filtrér produkter';
    display: block;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.12em;
    color: #1E3A8A;
    text-transform: uppercase;
    margin: 0 0 6px;
}

.jits-yith-filter-wrapper .filters-container::before {
    content: 'Find præcis det du leder efter';
    display: block;
    font-family: 'Fraunces', serif;
    font-size: 22px;
    font-weight: 500;
    color: #0F172A;
    margin: 0 0 20px;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.jits-yith-filter-wrapper .filters-container {
    display: block !important;
    padding: 0 !important;
}

/* ====================================================================
   FORM: HORISONTAL PILLE-RÆKKE
   ==================================================================== */

.jits-yith-filter-wrapper .filters-container > form {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 10px !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* ====================================================================
   FILTER-BLOK: BLIVER TIL EN PILLE-KNAP
   ==================================================================== */

.jits-yith-filter-wrapper .yith-wcan-filter {
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    position: relative;
    display: inline-block;
    vertical-align: top;
}

/* Filter-titel = pille-knap */
.jits-yith-filter-wrapper .yith-wcan-filter .filter-title,
.jits-yith-filter-wrapper .yith-wcan-filter h4.filter-title {
    display: inline-flex !important;
    align-items: center;
    gap: 9px;
    padding: 10px 18px !important;
    margin: 0 !important;
    background: #FFFFFF !important;
    color: #0F172A !important;
    border: 1px solid #CBD5E1 !important;
    border-radius: 999px !important;
    font-family: 'IBM Plex Sans', sans-serif !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    line-height: 1 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    cursor: pointer !important;
    user-select: none;
    transition: border-color 140ms ease, background-color 140ms ease;
    text-decoration: none;
}

.jits-yith-filter-wrapper .yith-wcan-filter .filter-title:hover,
.jits-yith-filter-wrapper .yith-wcan-filter h4.filter-title:hover {
    border-color: #1E3A8A !important;
    background: #FFFFFF !important;
}

/* Chevron efter titlen */
.jits-yith-filter-wrapper .yith-wcan-filter .filter-title::after {
    content: '';
    display: inline-block !important;
    width: 11px;
    height: 11px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat center/contain;
    transition: transform 200ms ease;
    flex-shrink: 0;
    margin: 0 !important;
    border: 0 !important;
}

/* Aktiv filter (når der er valg): blå fyldt pille */
.jits-yith-filter-wrapper .yith-wcan-filter.has-active-selection .filter-title,
.jits-yith-filter-wrapper .yith-wcan-filter.jits-has-active .filter-title {
    background: #1E3A8A !important;
    color: #FFFFFF !important;
    border-color: #1E3A8A !important;
}

.jits-yith-filter-wrapper .yith-wcan-filter.has-active-selection .filter-title::after,
.jits-yith-filter-wrapper .yith-wcan-filter.jits-has-active .filter-title::after {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFFFFF' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}

/* Tæller-badge på aktiv pille */
.jits-yith-filter-wrapper .yith-wcan-filter .jits-active-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 18px;
    padding: 0 7px;
    background: rgba(255, 255, 255, 0.25);
    color: #FFFFFF;
    font-size: 11px;
    font-weight: 500;
    border-radius: 999px;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

/* Open-state: chevron drejes */
.jits-yith-filter-wrapper .yith-wcan-filter.jits-open .filter-title::after {
    transform: rotate(180deg);
}

/* ====================================================================
   FILTER-CONTENT: DROPDOWN-PANEL
   ==================================================================== */

.jits-yith-filter-wrapper .yith-wcan-filter .filter-content {
    display: none !important;
    position: absolute !important;
    top: calc(100% + 8px);
    left: 0;
    z-index: 100;
    min-width: 280px;
    max-width: 360px;
    background: #FFFFFF !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 12px !important;
    padding: 16px !important;
    box-shadow: 0 8px 24px -8px rgba(15, 23, 42, 0.18), 0 4px 8px -4px rgba(15, 23, 42, 0.10) !important;
}

.jits-yith-filter-wrapper .yith-wcan-filter.jits-open .filter-content {
    display: block !important;
}

.jits-yith-filter-wrapper .yith-wcan-filter.filter-price-slider .filter-content {
    min-width: 320px;
    padding: 24px 20px 16px !important;
}

/* ====================================================================
   FILTER ITEMS LIST (inde i dropdown)
   ==================================================================== */

.jits-yith-filter-wrapper .filter-items {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
    flex-direction: column;
    gap: 1px;
    float: none !important;
    max-height: 320px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #CBD5E1 transparent;
}

.jits-yith-filter-wrapper .filter-items::-webkit-scrollbar { width: 4px; }
.jits-yith-filter-wrapper .filter-items::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 2px; }

.jits-yith-filter-wrapper .filter-item {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none;
    background: none !important;
}

.jits-yith-filter-wrapper .filter-item .filter-label,
.jits-yith-filter-wrapper .filter-item label {
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 8px 10px !important;
    margin: 0 !important;
    border-radius: 8px;
    color: #334155 !important;
    font-family: 'IBM Plex Sans', sans-serif !important;
    font-size: 13.5px !important;
    font-weight: 400;
    line-height: 1.4;
    cursor: pointer;
    transition: background-color 140ms ease, color 140ms ease;
    background: none;
    border: 0;
    min-height: auto;
}

.jits-yith-filter-wrapper .filter-item label:hover {
    background: #F8FAFC !important;
    color: #0F172A !important;
}

.jits-yith-filter-wrapper .filter-item.active label,
.jits-yith-filter-wrapper .filter-item.active .filter-label {
    background: #EFF6FF !important;
    color: #1E3A8A !important;
    font-weight: 500;
}

.jits-yith-filter-wrapper .filter-item input[type="checkbox"],
.jits-yith-filter-wrapper .filter-item input[type="radio"] {
    width: 16px !important;
    height: 16px !important;
    margin: 0 !important;
    accent-color: #1E3A8A;
    cursor: pointer;
    flex-shrink: 0;
}

.jits-yith-filter-wrapper .filter-item label > span:not(.filter-count) {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.jits-yith-filter-wrapper .filter-item .filter-count,
.jits-yith-filter-wrapper .item-count {
    color: #94A3B8 !important;
    font-size: 12px !important;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
    font-weight: 400;
    margin-left: auto;
}

.jits-yith-filter-wrapper .filter-content .search,
.jits-yith-filter-wrapper .filter-content input[type="search"],
.jits-yith-filter-wrapper .filter-content input[type="text"] {
    width: 100%;
    padding: 8px 12px !important;
    margin: 0 0 10px 0 !important;
    background: #F8FAFC !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 8px !important;
    font-family: 'IBM Plex Sans', sans-serif !important;
    font-size: 13px !important;
    color: #0F172A !important;
    box-sizing: border-box;
}

.jits-yith-filter-wrapper .filter-content input:focus {
    outline: none;
    border-color: #3B82F6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.10);
    background: #FFFFFF !important;
}

.jits-yith-filter-wrapper .yith-wcan-filter .clear-selection {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    padding: 4px 10px !important;
    margin: 0 0 8px 0 !important;
    background: transparent !important;
    color: #64748B !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 999px !important;
    font-family: 'IBM Plex Sans', sans-serif !important;
    font-size: 11.5px !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    cursor: pointer;
    transition: all 140ms ease;
    line-height: 1.4;
}

.jits-yith-filter-wrapper .yith-wcan-filter .clear-selection::before {
    content: '×';
    font-size: 14px;
    line-height: 1;
}

.jits-yith-filter-wrapper .yith-wcan-filter .clear-selection:hover {
    color: #DC2626 !important;
    border-color: #FECACA !important;
    background: #FEF2F2 !important;
}

/* ====================================================================
   PRIS-SLIDER (ion-rangeslider .irs-* klasser)
   ==================================================================== */

.jits-yith-filter-wrapper .filter-price-slider .price-slider {
    margin: 0 8px !important;
    padding: 0 !important;
}

.jits-yith-filter-wrapper .filter-price-slider .irs--round {
    height: 56px !important;
}

.jits-yith-filter-wrapper .filter-price-slider .irs--round .irs-line {
    background: #E2E8F0 !important;
    border: 0 !important;
    height: 3px !important;
    top: 28px !important;
    border-radius: 999px !important;
}

.jits-yith-filter-wrapper .filter-price-slider .irs--round .irs-bar {
    background: #1E3A8A !important;
    border: 0 !important;
    height: 3px !important;
    top: 28px !important;
    border-radius: 999px !important;
}

.jits-yith-filter-wrapper .filter-price-slider .irs--round .irs-handle {
    width: 18px !important;
    height: 18px !important;
    top: 20px !important;
    background: #FFFFFF !important;
    border: 2px solid #1E3A8A !important;
    border-radius: 50% !important;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(30, 58, 138, 0.20) !important;
}

.jits-yith-filter-wrapper .filter-price-slider .irs--round .irs-handle:hover,
.jits-yith-filter-wrapper .filter-price-slider .irs--round .irs-handle.state_hover {
    box-shadow: 0 2px 8px rgba(30, 58, 138, 0.35) !important;
}

.jits-yith-filter-wrapper .filter-price-slider .irs--round .irs-from,
.jits-yith-filter-wrapper .filter-price-slider .irs--round .irs-to,
.jits-yith-filter-wrapper .filter-price-slider .irs--round .irs-single {
    background: #0F172A !important;
    color: #FFFFFF !important;
    font-family: 'IBM Plex Sans', sans-serif !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    padding: 2px 8px !important;
    border-radius: 4px !important;
    font-variant-numeric: tabular-nums;
    top: 0 !important;
    text-shadow: none !important;
}

.jits-yith-filter-wrapper .filter-price-slider .irs--round .irs-from::before,
.jits-yith-filter-wrapper .filter-price-slider .irs--round .irs-to::before,
.jits-yith-filter-wrapper .filter-price-slider .irs--round .irs-single::before {
    border-top-color: #0F172A !important;
}

.jits-yith-filter-wrapper .filter-price-slider .irs--round .irs-min,
.jits-yith-filter-wrapper .filter-price-slider .irs--round .irs-max {
    background: transparent !important;
    color: #94A3B8 !important;
    font-size: 11px !important;
    font-family: 'IBM Plex Sans', sans-serif !important;
    padding: 0 !important;
    top: 40px !important;
    font-weight: 400 !important;
}

.jits-yith-filter-wrapper .filter-price-slider .irs--round .irs-shadow {
    background: rgba(30, 58, 138, 0.08) !important;
    border-radius: 999px !important;
}

.jits-yith-filter-wrapper .filter-price-slider .price-slider-min,
.jits-yith-filter-wrapper .filter-price-slider .price-slider-max {
    background: #F8FAFC !important;
    border: 1px solid #E2E8F0 !important;
    border-radius: 6px !important;
    padding: 5px 8px !important;
    font-family: 'IBM Plex Sans', sans-serif !important;
    font-size: 12px !important;
    color: #0F172A !important;
    text-align: center;
    width: 70px !important;
    margin: 8px 4px 0 !important;
}

/* ====================================================================
   AKTIVE FILTER-CHIPS (under pille-rækken)
   ==================================================================== */

.jits-yith-active-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 18px !important;
    padding-top: 16px !important;
    border-top: 1px solid #DBEAFE;
}

.jits-yith-active-bar-label {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: #64748B;
    text-transform: uppercase;
    margin-right: 4px;
}

.jits-yith-active-bar .jits-active-chip {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    padding: 5px 6px 5px 14px !important;
    background: #FFFFFF !important;
    color: #1E3A8A !important;
    border: 1px solid #DBEAFE !important;
    border-radius: 999px !important;
    font-family: 'IBM Plex Sans', sans-serif !important;
    font-size: 12.5px !important;
    font-weight: 500 !important;
    line-height: 1;
    text-decoration: none !important;
}

.jits-yith-active-bar .jits-active-chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: #EFF6FF;
    border-radius: 50%;
    font-size: 13px;
    line-height: 1;
    color: #1E3A8A;
    cursor: pointer;
    transition: all 140ms ease;
}

.jits-yith-active-bar .jits-active-chip-remove:hover {
    background: #DC2626;
    color: #FFFFFF;
}

.jits-yith-active-bar .jits-reset-all {
    margin-left: 4px;
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 12px;
    color: #64748B;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: color 140ms ease;
}

.jits-yith-active-bar .jits-reset-all:hover {
    color: #DC2626;
}

/* YITH's egne active-filters: skjult */
.jits-yith-filter-wrapper .yith-wcan-active-filters {
    display: none !important;
}

/* Reset-knap fra YITH: skjult */
.jits-yith-filter-wrapper > .filter-reset,
.jits-yith-filter-wrapper > .yith-wcan-reset-filters,
.jits-yith-filter-wrapper > a.reset-filters,
.jits-yith-filter-wrapper > button.reset-filters {
    display: none !important;
}

/* ====================================================================
   FILTERS-OPENER (mobile) — skjult på desktop
   ==================================================================== */

.yith-wcan-filters-opener {
    display: none !important;
}

@media (max-width: 768px) {
    .jits-yith-filter-wrapper .yith-wcan-filters,
    .jits-yith-filter-wrapper .yith-wcan-filters.no-title,
    .jits-yith-filter-wrapper .yith-wcan-filters.enhanced {
        padding: 20px 18px !important;
    }
    .jits-yith-filter-wrapper .filters-container::before {
        font-size: 18px;
        margin-bottom: 18px;
    }
    .jits-yith-filter-wrapper .filters-container > form {
        gap: 8px !important;
    }
    .jits-yith-filter-wrapper .yith-wcan-filter .filter-content {
        position: fixed !important;
        top: auto !important;
        bottom: 0;
        left: 0;
        right: 0;
        max-width: 100%;
        min-width: 0;
        border-radius: 16px 16px 0 0 !important;
        max-height: 70vh;
        overflow-y: auto;
        z-index: 9999;
    }
}

.jits-yith-filter-wrapper.loading {
    opacity: 0.6;
    pointer-events: none;
    transition: opacity 200ms ease;
}
