*, *::before, *::after {
    box-sizing: border-box;
}

/* Layout */

.car-header {
    background-image: url(/wp-content/uploads/2025/12/biler-til-salg.jpg);
    background-size: cover;
    background-position: center;
    min-height: 50vh;
    height: 100%;
    padding: 45px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}
.autodesktop-car-listing h1 {
    display: none;
}

.autodesktop-error {
    color: red;
    margin: 1rem 0;
}

/* Filter form */
.autodesktop-filter-form {
    margin: 1.5rem 0;
    position: relative;
}
.form-group {
    position: relative;
    width: 100%;
    font-family: 'Figtree', sans-serif;
}
.form-group.is-hidden {
    display: none;
}
.input-icon {
    position: absolute;
    top: 13px;
    right: 13px;
    width: 20px;
    height: 20px;
}
.input-icon svg {
    fill: #18306F;
}
.form-group input:not(.price-range-group input) {
    font-family: 'Figtree', sans-serif;
    font-size: 1rem;
    width: 100%;
    border-radius: 8px;
    border: none;
    padding: 0.8rem 1rem;
    color: #18306F;
}
.form-group label {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.form-group.col {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    gap: 1rem;
}
.filter-topbar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
    justify-content: center;
    padding: 2rem;
    border-radius: 8px;
    max-width: 600px;
    margin: 0 auto;
}
@media only screen and (max-width: 600px) {
    .filter-topbar {
        padding: 1rem;
    }
}
.stats {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1400px;
    justify-content: center;
    align-items: center;
    margin: 1rem auto;
}
@media only screen and (max-width: 1400px) {
    .stats {
        padding: 0px 25px;
    }
}
.count {
    font-family: 'Figtree', sans-serif;
    font-weight: 800;
    color: #18306F;
}
/* Filter pills */
#filter-pills-wrapper {
    margin-top: 0.75rem;
}

.filter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-pill {
    font-family: 'Figtree', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    text-decoration: none;
    border: 1px solid #fff;
    color: #18306F;
    background: #fff;
    font-size: 0.85rem;
}

#advanced-filters-toggle {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    width: 100%;
    border: none;
    background: #ffffff;
    border-radius: 8px;
    padding: 0 1rem;
    height: 40px;
    display: flex;
    align-items: center;
    font-size: 1rem;
    cursor: pointer;
    outline: none;
    color: #18306F;
}
/* Advanced filters sidebar */
#advanced-filters {
    position: fixed;
    font-family: 'Figtree', sans-serif;
    top: 0;
    left: -320px; /* initial off-canvas, JS toggles this */
    width: 300px;
    height: 100%;
    background: rgba(240,249,252, 0.5);
    backdrop-filter: blur(14px);
    box-shadow: rgb(0 0 0 / 5%) 0px 1px 4px;
    border-right: 1px solid #66767d26;
    padding: 1rem;
    box-sizing: border-box;
    overflow: hidden;
    transition: left 0.25s ease;
    z-index: 9999;
}
#advanced-filters-close {
    background: none;
    border: none;
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
#advanced-filters-close svg {
    width: 18px;
    height: 18px;
    fill: var(--primary);
}
#advanced-filters.open {
    left: 0px;
}
@media only screen and (min-width: 1400px) {
    #advanced-filters {
        width: 400px;
        left: -420px;
    }
    #advanced-filters.open {
        left: 0px;
    }
}
.advanced-filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    color: #18306F;
}
#filter-pills-sidebar {
    border-bottom: 1px solid #18306f;
    padding-bottom: 1rem;
}
.advanced-filters-group {
    margin-bottom: 1rem;
}
.advanced-filters-group label {
    color: #18306f;
    margin-bottom: 0.5rem;
    display: inline-block;
}

.advanced-filters-apply-wrapper {
    margin-top: 1.5rem;
}

.advanced-filters-note {
    font-size: 0.85rem;
    color: #666;
    margin-top: 1rem;
}
.kd-select--icon-only .kd-select__label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.kd-select--icon-only .kd-select__label svg {
    width: 16px;   /* tweak as you like */
    height: 16px;
    margin-right: 10px;
}
.kd-select--icon-only .kd-select__options {
    left: unset;
    min-width: 200px;
}
/* Results / car grid */
#car-results-wrapper {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}
.car-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(calc(25% - 1rem), 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}
@media only screen and (max-width: 1024px) {
    .car-grid {
        grid-template-columns: repeat(auto-fill, minmax(calc(33% - 1rem), 1fr));
        padding: 25px;
    }
}
@media only screen and (max-width: 768px) {
    .car-grid {
        grid-template-columns: repeat(auto-fill, minmax(calc(50% - 1rem), 1fr));
        padding: 25px;
    }
}
@media only screen and (max-width: 500px) {
    .car-grid {
        grid-template-columns: repeat(auto-fill, minmax(calc(100% - 1rem), 1fr));
        padding: 25px;
    }
}
.car-card {
    font-family: 'Figtree', sans-serif;
    border-radius: 8px;
    padding: 10px;
    background: #fff;
    opacity: 0;
    transform:translateY(10px);
    transition: 0.4s ease-in-out;
    box-shadow: rgb(0 0 0 / 15%) 0px 1px 4px;
    text-decoration: none;
    overflow: hidden;
    color: #000;
    display: flex;
    flex-direction: column;
    top: 0;
    position: relative;
    z-index: 1;
}
.car-card:hover {
    top: -2px;
    box-shadow: rgb(0 0 0 / 15%) 0px 15px 14px;
    z-index: 2;
}
.car-card.is-visible {
    opacity: 1;
    transform: translateY(0);
}
.car-card-image-wrapper {
    margin-bottom: 0.75rem;
    flex: 1;
}
.car-card-image-wrapper img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    object-position: bottom;
    border-radius: 5px;
}
.car-card .title-wrapper {
    flex: 1;
    padding: 0px 10px
}
.car-card-title {
    color: #18306F;
    font-size: 1.4rem;
    margin: 0;
   
}

.car-card-variant {
    margin: 0 0 0.5rem;
    flex: 1;
}

.car-card-specs {
    list-style: none;
    padding: 0;
    margin: 1rem 0 2rem 0;
    flex: 3;
    padding: 0px 10px;
}
.car-card-specs li {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    color: #000;
}
.car-card-specs li:last-of-type {
    margin-bottom: 0;
}
.car-card-specs .icon {
    width: 20px;
    height: 20px;
    margin-right: 5px;
}
.car-card-specs .icon svg {
    fill: #18306F;
}
.pricing {
    margin: -10px;
    padding: 20px;
    background: #f7fbfd;
    font-weight: 600;

}
.pricing ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.pricing li {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}
.pricing li:last-of-type {
    margin-bottom: 0;
}
.pricing li p {
    margin: 0;
}
/* Loading state */
.car-loading {
    padding: 2rem 0;
    text-align: center;
}

.car-loading-spinner {
    margin: 0 auto 0.75rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 3px solid rgba(24,48,111, 0.25);
    border-top-color: #18306F;
    animation: car-spin 0.8s linear infinite;
}

@keyframes car-spin {
    to {
        transform: rotate(360deg);
    }
}


/* HCAK */
.price-range-group {
    margin: 0.5rem 0;
}
.price-range-slider {
  position: relative;
  width: 100%;
  height: 24px;
  margin-top: 8px;
}

/* Den lyse streg i baggrunden */
.price-range-track {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 4px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: rgba(255,255,255,0.6); /* lys/white-lignende */
}

/* Den farvede del mellem håndtagene */
.price-range-between {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 4px;
  transform: translateY(-50%);
  border-radius: 999px;
  background: #18306F; /* din blå farve */
}

/* De to range inputs ligger ovenpå tracket */
.price-range-slider input[type="range"] {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  margin: 0;
  width: 100%;
  background: transparent;
  pointer-events: none;       /* vigtig: track klik ignoreres */
  -webkit-appearance: none;
  appearance: none;
}

/* Selve thumb’en – her må der gerne være pointer-events */
.price-range-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  pointer-events: auto;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #18306F;        /* samme blå som mellemstregen */
  cursor: pointer;
  box-shadow: 0 0 0 2px rgba(0,0,0,0.1);
}

.price-range-slider input[type="range"]::-moz-range-thumb {
  pointer-events: auto;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #18306F;
  cursor: pointer;
  box-shadow: 0 0 0 2px rgba(0,0,0,0.1);
}

/* Fjern standard-track i Firefox */
.price-range-slider input[type="range"]::-moz-range-track {
  background: transparent;
}

/* Tekst under slideren */
.price-range-display {
    display: flex;
    justify-content: space-between;
    font-size: 1rem;
    margin-top: 1rem;
    font-family: 'Figtree';
    font-weight: 500;
    color: #18306F;
}
/* NEW */
.stats {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1400px;
    justify-content: center;
    align-items: center;
    margin: 1rem auto;
}

.stats-header {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    justify-content: space-between;
}
.button-wrapper {
    display: flex;
    flex-direction: row;
    gap: 5px;
}
.count {
    font-family: 'Figtree', sans-serif;
    font-weight: 800;
    color: #18306F;
}

/* Sort dropdown next to count */
.sort-wrapper {
    font-family: 'Figtree', sans-serif;
    display: flex;
    flex-direction: column;
    font-size: 0.85rem;
    color: #18306F;
}
.sort-wrapper svg,
#advanced-filters-toggle svg {
    fill: #18306F;
    width: 20px;
    height: 20px;
}
.sort-wrapper label {
    margin-bottom: 0.25rem;
}

/* Filter pills already exist – we just add sidebar container styling */
.advanced-filters-pills {
    margin-bottom: 1rem;
}

/* On mobile: hide pills below grid header, keep them inside sidebar only */
@media only screen and (max-width: 768px) {
    #filter-pills-wrapper {
        display: none;
    }
}
