/*
 * ComparePress Archivseiten
 *
 * Die CSS-Datei ist in grobe UI-Bereiche sortiert: Layout, Hero, Filter,
 * Karten, redaktionelle Sektionen, FAQ, Responsive-Regeln und Darkmode.
 * ComparePress setzt keine eigene horizontale Containerbreite; die Breite kommt
 * ueber die Theme-Klasse .container aus dem aktiven Theme.
 */

/* Basislayout: Hintergrund und vertikale Innenabstaende der Archivseite. */
.comparepress-archive {
    background: #f6f8fb;
    color: #1f2a44;
}

.comparepress-archive__inner {
    padding: 40px 0 56px;
}

/* Hero: erster sichtbarer Landingpage-Bereich mit Titel, Intro und Trefferzahl. */
.comparepress-archive-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(160px, 220px);
    gap: 28px;
    align-items: end;
    padding: 34px;
    border: 1px solid #dde5f0;
    border-radius: 8px;
    background: #ffffff;
}

.comparepress-archive-hero__eyebrow,
.comparepress-archive-section__eyebrow,
.comparepress-card__meta {
    margin: 0 0 8px;
    color: #53627c;
    font-size: 12px;
    line-height: 1.35;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

.comparepress-archive-hero__title {
    margin: 0;
    color: #15213a;
    font-size: clamp(32px, 4vw, 52px);
    line-height: 1.06;
    letter-spacing: 0;
}

.comparepress-archive-hero__text {
    max-width: 760px;
    margin-top: 16px;
    color: #3f4d66;
    font-size: 17px;
    line-height: 1.65;
}

.comparepress-archive-hero__text p {
    margin: 0;
}

.comparepress-archive-hero__meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 18px;
    border: 1px solid #e2e8f2;
    border-radius: 8px;
    background: #f9fbfe;
}

.comparepress-archive-hero__meta strong {
    color: #1e78ff;
    font-size: 34px;
    line-height: 1;
}

/* Filter: Suche/Sortierung oben, Facetten darunter. */
.comparepress-archive-filter,
.comparepress-archive-section,
.comparepress-empty-state {
    margin-top: 22px;
    border: 1px solid #dde5f0;
    border-radius: 8px;
    background: #ffffff;
}

.comparepress-archive-filter {
    padding: 18px;
}

.comparepress-archive-filter__toggle {
    display: none;
}

.comparepress-archive-filter__form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.comparepress-archive-filter__general,
.comparepress-archive-facets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    align-items: end;
}

.comparepress-archive-facets {
    padding-top: 16px;
    border-top: 1px solid #e2e8f2;
}

.comparepress-archive-filter__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #2b3650;
}

.comparepress-archive-filter input,
.comparepress-archive-filter select {
    min-height: 42px;
    border: 1px solid #cfd8e6;
    border-radius: 6px;
    padding: 8px 10px;
    background: #ffffff;
    color: #1f2a44;
    font-size: 14px;
}

/* Checkbox-Dropdowns ersetzen native multiple-selects fuer kompaktere Facetten. */
.comparepress-facet-dropdown {
    position: relative;
}

.comparepress-facet-dropdown__button {
    display: flex;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 42px;
    border: 1px solid #cfd8e6;
    border-radius: 6px;
    padding: 8px 10px;
    background: #ffffff;
    color: #1f2a44;
    font-size: 14px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.comparepress-facet-dropdown__button:hover,
.comparepress-facet-dropdown.is-open .comparepress-facet-dropdown__button {
    border-color: #1e78ff;
}

.comparepress-facet-dropdown__menu {
    position: absolute;
    z-index: 20;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    display: none;
    max-height: 240px;
    overflow: auto;
    border: 1px solid #cfd8e6;
    border-radius: 6px;
    padding: 6px;
    background: #ffffff;
    box-shadow: 0 12px 26px rgba(31, 42, 68, 0.14);
}

.comparepress-facet-dropdown.is-open .comparepress-facet-dropdown__menu {
    display: grid;
    gap: 2px;
}

.comparepress-facet-dropdown__option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: 5px;
    color: #2b3650;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.comparepress-facet-dropdown__option:hover {
    background: #f2f6fc;
}

.comparepress-facet-dropdown__option input {
    width: 16px;
    min-height: 16px;
    height: 16px;
    margin: 0;
    padding: 0;
}

/* Dual-Range-Preisfilter: Zwei range-Inputs teilen sich eine visuelle Spur. */
.comparepress-price-slider {
    grid-column: span 2;
}

.comparepress-price-slider__values {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: #40516f;
    font-size: 13px;
    font-weight: 700;
}

.comparepress-price-slider__track {
    position: relative;
    height: 36px;
    --cp-price-thumb-size: 18px;
    --cp-price-thumb-radius: calc(var(--cp-price-thumb-size) / 2);
}

.comparepress-price-slider__track::before {
    position: absolute;
    top: 50%;
    right: var(--cp-price-thumb-radius);
    left: var(--cp-price-thumb-radius);
    height: 6px;
    border-radius: 999px;
    background:
        linear-gradient(
            to right,
            #d8e1ee var(--cp-price-min, 0%),
            #1e78ff var(--cp-price-min, 0%),
            #1e78ff var(--cp-price-max, 100%),
            #d8e1ee var(--cp-price-max, 100%)
        );
    content: "";
    transform: translateY(-50%);
}

.comparepress-archive-filter input.comparepress-price-slider__range {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 36px;
    height: 36px;
    border: 0;
    border-radius: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
    color: transparent;
    pointer-events: none;
    appearance: none;
}

.comparepress-archive-filter input.comparepress-price-slider__range:focus {
    outline: none;
}

.comparepress-archive-filter input.comparepress-price-slider__range:focus-visible::-webkit-slider-thumb {
    box-shadow: 0 0 0 3px rgba(30, 120, 255, 0.2), 0 2px 8px rgba(31, 42, 68, 0.24);
}

.comparepress-archive-filter input.comparepress-price-slider__range:focus-visible::-moz-range-thumb {
    box-shadow: 0 0 0 3px rgba(30, 120, 255, 0.2), 0 2px 8px rgba(31, 42, 68, 0.24);
}

.comparepress-price-slider__range[data-comparepress-price-range="min"] {
    z-index: 2;
}

.comparepress-price-slider__range[data-comparepress-price-range="max"] {
    z-index: 3;
}

.comparepress-price-slider__range::-webkit-slider-runnable-track {
    height: 36px;
    background: transparent;
}

.comparepress-price-slider__range::-moz-range-track {
    height: 36px;
    background: transparent;
}

.comparepress-price-slider__range::-webkit-slider-thumb {
    width: var(--cp-price-thumb-size);
    height: var(--cp-price-thumb-size);
    margin-top: 9px;
    border: 3px solid #ffffff;
    border-radius: 50%;
    background: #1e78ff;
    box-shadow: 0 2px 8px rgba(31, 42, 68, 0.24);
    pointer-events: auto;
    appearance: none;
    cursor: pointer;
}

.comparepress-price-slider__range::-moz-range-thumb {
    width: var(--cp-price-thumb-size);
    height: var(--cp-price-thumb-size);
    border: 3px solid #ffffff;
    border-radius: 50%;
    background: #1e78ff;
    box-shadow: 0 2px 8px rgba(31, 42, 68, 0.24);
    pointer-events: auto;
    cursor: pointer;
}

/* Aktionen: Primaerer Apply-Button und sekundaerer Reset-Link. */
.comparepress-archive-filter__actions {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: flex-start;
}

.comparepress-archive-filter__submit,
.comparepress-card__cta,
.comparepress-empty-state__reset {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 9px 14px;
    border: 0;
    border-radius: 6px;
    background: #1e78ff;
    color: #ffffff;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.comparepress-archive-filter__reset {
    color: #40516f;
    font-weight: 700;
    text-decoration: none;
}

.comparepress-archive__results {
    margin-top: 24px;
}

/* Kartenraster: align-items:start verhindert gestreckte Cards mit riesigen Bildern. */
.comparepress-archive__grid,
.comparepress-hub__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    align-items: start;
}

.comparepress-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #dde5f0;
    border-radius: 8px;
    background: #ffffff;
}

/* Medienflaeche: feste Hoehe und object-fit halten hohe Produktbilder kontrolliert. */
.comparepress-card__media {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 220px;
    overflow: hidden;
    background: #f2f5f9;
}

.comparepress-card__media img {
    width: auto;
    max-width: 88%;
    height: auto;
    max-height: 220px;
    object-fit: contain;
}

.comparepress-card__placeholder {
    width: 40%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: #dfe6f0;
}

.comparepress-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
}

.comparepress-card__title {
    margin: 0;
    font-size: 18px;
    line-height: 1.25;
    letter-spacing: 0;
}

.comparepress-card__title a {
    color: #17233c;
    text-decoration: none;
}

.comparepress-card__rating {
    align-self: flex-start;
    margin: 0;
    padding: 5px 9px;
    border-radius: 999px;
    background: #e8f2ff;
    color: #145fc4;
    font-size: 12px;
    font-weight: 700;
}

.comparepress-card__excerpt {
    margin: 0;
    color: #53627c;
    font-size: 14px;
    line-height: 1.5;
}

.comparepress-card__cta {
    align-self: flex-start;
    margin-top: auto;
}

/* Redaktionelle Sektionen: Kategoriebaum, Hub, FAQ und Empty State. */
.comparepress-archive-section,
.comparepress-empty-state {
    padding: 26px;
}

.comparepress-archive-section__header {
    margin-bottom: 18px;
}

.comparepress-archive-section__header h2,
.comparepress-hub h3,
.comparepress-empty-state h2 {
    margin: 0;
    color: #15213a;
    letter-spacing: 0;
}

.comparepress-archive-category-groups {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.comparepress-archive-category-group h3,
.comparepress-hub h3 {
    margin-bottom: 12px;
    font-size: 18px;
}

.comparepress-category-tree {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.comparepress-category-tree .comparepress-category-tree {
    margin-top: 8px;
    padding-left: 16px;
}

.comparepress-category-tree__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #e2e8f2;
    border-radius: 6px;
    color: #23314a;
    text-decoration: none;
}

.comparepress-category-tree__link.is-active,
.comparepress-category-tree__link:hover {
    border-color: #1e78ff;
    color: #145fc4;
}

.comparepress-category-tree__link small {
    color: #6b7890;
    font-weight: 700;
}

.comparepress-hub + .comparepress-hub {
    margin-top: 28px;
}

/* FAQ-Accordion: details/summary liefert native Tastatur- und No-JS-Unterstuetzung. */
.comparepress-faq__header {
    max-width: 760px;
}

.comparepress-faq__intro {
    margin: 10px 0 0;
    color: #53627c;
    font-size: 15px;
    line-height: 1.6;
}

.comparepress-faq {
    display: grid;
    gap: 12px;
}

.comparepress-faq__item {
    overflow: hidden;
    border: 1px solid #dde5f0;
    border-radius: 8px;
    background: #ffffff;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.comparepress-faq__item:hover,
.comparepress-faq__item[open] {
    border-color: #b8c9e2;
    box-shadow: 0 12px 28px rgba(31, 42, 68, 0.08);
}

.comparepress-faq__summary {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) 28px;
    gap: 14px;
    align-items: center;
    padding: 18px 20px;
    color: #1f2a44;
    cursor: pointer;
    list-style: none;
}

.comparepress-faq__summary::-webkit-details-marker {
    display: none;
}

.comparepress-faq__summary::marker {
    content: "";
}

.comparepress-faq__number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #e8f2ff;
    color: #145fc4;
    font-size: 12px;
    font-weight: 800;
}

.comparepress-faq__question {
    color: #17233c;
    font-size: 17px;
    line-height: 1.35;
    font-weight: 800;
}

.comparepress-faq__indicator {
    position: relative;
    width: 28px;
    height: 28px;
    border: 1px solid #d8e1ee;
    border-radius: 50%;
    background: #f8fbff;
}

.comparepress-faq__indicator::before,
.comparepress-faq__indicator::after {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 2px;
    border-radius: 999px;
    background: #1e78ff;
    content: "";
    transform: translate(-50%, -50%);
}

.comparepress-faq__indicator::after {
    transform: translate(-50%, -50%) rotate(90deg);
    transition: opacity 0.18s ease;
}

.comparepress-faq__item[open] .comparepress-faq__indicator::after {
    opacity: 0;
}

.comparepress-faq__answer {
    padding: 0 20px 20px 68px;
}

.comparepress-faq__answer p {
    max-width: 860px;
    margin: 0;
    color: #53627c;
    font-size: 15px;
    line-height: 1.75;
}

.comparepress-empty-state p {
    margin: 10px 0 0;
    color: #53627c;
    line-height: 1.6;
}

.comparepress-empty-state {
    text-align: center;
}

.comparepress-empty-state__reset {
    margin-top: 16px;
}

.comparepress-archive .nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 28px;
}

.comparepress-archive .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    min-height: 38px;
    border: 1px solid #d8e1ee;
    border-radius: 6px;
    color: #263653;
    text-decoration: none;
}

.comparepress-archive .page-numbers.current {
    background: #1e78ff;
    color: #ffffff;
}

/* Tablet: Einspaltige Steuerbereiche, zweispaltige Ergebnisraster. */
@media (max-width: 900px) {
    .comparepress-archive-hero,
    .comparepress-archive-filter__general,
    .comparepress-archive-facets,
    .comparepress-archive-category-groups {
        grid-template-columns: 1fr;
    }

    .comparepress-archive__grid,
    .comparepress-hub__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .comparepress-price-slider {
        grid-column: span 1;
    }
}

/* Mobile: kompakter Hero, einklappbarer Filter und einspaltige Cards. */
@media (max-width: 640px) {
    .comparepress-archive__inner {
        padding: 24px 0 40px;
    }

    .comparepress-archive-hero,
    .comparepress-archive-section,
    .comparepress-empty-state {
        padding: 20px;
    }

    .comparepress-archive-hero__title {
        font-size: 32px;
    }

    .comparepress-archive__grid,
    .comparepress-hub__grid {
        grid-template-columns: 1fr;
    }

    .comparepress-card__media {
        height: 180px;
    }

    .comparepress-card__media img {
        max-height: 180px;
    }

    .comparepress-archive-filter__toggle {
        display: flex;
        width: 100%;
        align-items: center;
        justify-content: space-between;
        min-height: 42px;
        border: 1px solid #cfd8e6;
        border-radius: 6px;
        background: #ffffff;
        color: #1f2a44;
        font-weight: 700;
    }

    .comparepress-archive-filter__form {
        display: none;
        margin-top: 14px;
    }

    .comparepress-archive-filter.is-open .comparepress-archive-filter__form {
        display: flex;
    }

    .comparepress-faq__summary {
        grid-template-columns: auto minmax(0, 1fr) 24px;
        gap: 10px;
        padding: 16px;
    }

    .comparepress-faq__number {
        width: 30px;
        height: 30px;
    }

    .comparepress-faq__question {
        font-size: 15px;
    }

    .comparepress-faq__answer {
        padding: 0 16px 16px;
    }
}

/* Automatischer Darkmode ueber Betriebssystem-/Browserpraeferenz. */
@media (prefers-color-scheme: dark) {
    .comparepress-archive {
        background: #0b111c;
        color: #d9e2f2;
        color-scheme: dark;
    }

    .comparepress-archive-hero,
    .comparepress-archive-filter,
    .comparepress-archive-section,
    .comparepress-empty-state,
    .comparepress-card,
    .comparepress-faq__item {
        border-color: #1f2a3a;
        background: #121722;
        box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
    }

    .comparepress-archive-hero__title,
    .comparepress-archive-section__header h2,
    .comparepress-hub h3,
    .comparepress-empty-state h2,
    .comparepress-card__title a,
    .comparepress-faq__question,
    .comparepress-faq__summary {
        color: #f0f4ff;
    }

    .comparepress-archive-hero__text,
    .comparepress-faq__intro,
    .comparepress-faq__answer p,
    .comparepress-card__excerpt,
    .comparepress-empty-state p,
    .comparepress-price-slider__values {
        color: #c9d4e5;
    }

    .comparepress-archive-hero__eyebrow,
    .comparepress-archive-section__eyebrow,
    .comparepress-card__meta,
    .comparepress-category-tree__link small {
        color: #93a4bd;
    }

    .comparepress-archive-hero__meta,
    .comparepress-card__media,
    .comparepress-facet-dropdown__menu,
    .comparepress-faq__indicator,
    .comparepress-category-tree__link,
    .comparepress-archive .page-numbers {
        border-color: #2b364b;
        background: #0e1420;
    }

    .comparepress-archive-hero__meta strong,
    .comparepress-category-tree__link.is-active,
    .comparepress-category-tree__link:hover,
    .comparepress-archive-filter__reset,
    .comparepress-archive .page-numbers,
    .comparepress-archive .page-numbers:hover {
        color: #8bb6ff;
    }

    .comparepress-archive-filter input,
    .comparepress-archive-filter select,
    .comparepress-facet-dropdown__button,
    .comparepress-archive-filter__toggle {
        border-color: #2b364b;
        background: #0e1420;
        color: #d9e2f2;
    }

    .comparepress-archive-filter input::placeholder {
        color: #7f8fa8;
    }

    .comparepress-archive-facets {
        border-top-color: #1f2a3a;
    }

    .comparepress-archive-filter__field,
    .comparepress-facet-dropdown__option {
        color: #d9e2f2;
    }

    .comparepress-facet-dropdown__button:hover,
    .comparepress-facet-dropdown.is-open .comparepress-facet-dropdown__button,
    .comparepress-category-tree__link.is-active,
    .comparepress-category-tree__link:hover,
    .comparepress-archive .page-numbers:hover {
        border-color: #3b82f6;
    }

    .comparepress-facet-dropdown__menu {
        box-shadow: 0 18px 34px rgba(0, 0, 0, 0.4);
    }

    .comparepress-facet-dropdown__option:hover {
        background: #1a2231;
    }

    .comparepress-facet-dropdown__option input {
        accent-color: #3b82f6;
    }

    .comparepress-price-slider__track::before {
        background:
            linear-gradient(
                to right,
                #2b364b var(--cp-price-min, 0%),
                #3b82f6 var(--cp-price-min, 0%),
                #3b82f6 var(--cp-price-max, 100%),
                #2b364b var(--cp-price-max, 100%)
            );
    }

    .comparepress-price-slider__range::-webkit-slider-thumb {
        border-color: #121722;
        background: #8bb6ff;
        box-shadow: 0 0 0 1px #3b82f6, 0 2px 8px rgba(0, 0, 0, 0.45);
    }

    .comparepress-price-slider__range::-moz-range-thumb {
        border-color: #121722;
        background: #8bb6ff;
        box-shadow: 0 0 0 1px #3b82f6, 0 2px 8px rgba(0, 0, 0, 0.45);
    }

    .comparepress-card__media {
        background: #151d2b;
    }

    .comparepress-card__placeholder {
        background: #253247;
    }

    .comparepress-card__rating,
    .comparepress-faq__number {
        background: #17345f;
        color: #bcd6ff;
    }

    .comparepress-faq__item:hover,
    .comparepress-faq__item[open] {
        border-color: #2b4f82;
        box-shadow: 0 14px 30px rgba(0, 0, 0, 0.34);
    }

    .comparepress-faq__indicator::before,
    .comparepress-faq__indicator::after {
        background: #8bb6ff;
    }

    .comparepress-category-tree__link {
        color: #d9e2f2;
        text-decoration: none;
    }

    .comparepress-category-tree__link.is-active,
    .comparepress-category-tree__link:hover {
        background: #101b2c;
    }

    .comparepress-archive .page-numbers.current,
    .comparepress-archive-filter__submit,
    .comparepress-card__cta,
    .comparepress-empty-state__reset {
        background: #3b82f6;
        color: #ffffff;
    }
}
