/* =============================================
   PRODUCT CARDS
   ============================================= */

/* === Grid Layout === */
.tpd-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    align-items: stretch;
}
.fwpl-layout:has(.tpd-card) {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 20px !important;
    align-items: stretch !important;
}
/* FacetWP result wrapper — stretch to fill grid cell */
.fwpl-result:has(.tpd-card) {
    display: flex !important;
}
.fwpl-result:has(.tpd-card) .fwpl-row,
.fwpl-result:has(.tpd-card) .fwpl-col,
.fwpl-result:has(.tpd-card) .fwpl-item {
    display: flex !important;
    flex: 1 !important;
}

/* === Card === */
.tpd-card {
    display: flex;
    flex-direction: column;
    flex: 1;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    overflow: hidden;
    transition: box-shadow .2s ease, transform .2s ease;
}
.tpd-card:hover {
    box-shadow: 0 10px 25px rgba(0,0,0,.1), 0 4px 10px rgba(0,0,0,.06);
    transform: translateY(-2px);
}

/* === Image === */
.tpd-card__image {
    position: relative;
    height: 220px;
    padding: 16px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    box-sizing: border-box;
}
.tpd-card__image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    z-index: 1;
}
.tpd-card__image-placeholder {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
    color: #d4d4d4;
    z-index: 0;
}
.tpd-card__image-placeholder svg {
    width: 100%;
    height: 100%;
}
.tpd-card__badge {
    position: absolute;
    top: 12px; right: 12px;
    background: #e53e3e;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 6px;
    line-height: 1.4;
    z-index: 2;
}

/* === Body === */
.tpd-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 16px 20px 20px;
}
.tpd-card__title {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.35;
    margin: 0 0 12px;
    color: #1a202c;
}

/* === Specs === */
.tpd-card__specs {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
    flex: 1;
}
.tpd-card__spec {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    line-height: 1.4;
    color: #4a5568;
}
.tpd-card__spec-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: #a0aec0;
}
.tpd-card__spec-label {
    color: #a0aec0;
    min-width: 90px;
}
.tpd-card__spec-value {
    color: #2d3748;
    font-weight: 500;
}

/* === Footer: Price + CTA === */
.tpd-card__footer {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #f0f0f0;
}
.tpd-card__price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}
.tpd-card__price-current {
    font-size: 22px;
    font-weight: 700;
    color: #1a202c;
}
.tpd-card__price-current--sale {
    color: #e53e3e;
}
.tpd-card__price-current--request {
    font-size: 15px;
    font-weight: 500;
    color: #a0aec0;
}
.tpd-card__price--fallback {
    display: flex;
    align-items: center;
    min-height: 32px;
}
.tpd-card__price-note {
    font-size: 13px;
    color: #718096;
    font-style: italic;
}
.tpd-card__price-old {
    font-size: 15px;
    color: #a0aec0;
    text-decoration: line-through;
}

/* === Preis-Badges (Bestpreis / Allzeit-Tief) === */
.tpd-card__price-badge {
    display: inline-block;
    align-self: flex-start;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.4;
    margin-bottom: 4px;
}
.tpd-card__price-badge--best90 {
    background: #e6f7ed;
    color: #1f7a43;
    border: 1px solid #b5e3c6;
}
.tpd-card__price-badge--alltime {
    background: #1f7a43;
    color: #fff;
}
.tpd-card__price-badge--alltime::before {
    content: '\2605 ';
}

/* === CTA Button (Brand Blue) === */
.tpd-card__cta {
    display: block;
    width: 100%;
    padding: 12px 16px;
    background: #37aecf;
    color: #fff !important;
    text-align: center;
    text-decoration: none !important;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    transition: background .2s ease, transform .1s ease;
    box-sizing: border-box;
}
.tpd-card__cta:hover {
    background: #2d9ab8;
    color: #fff !important;
    transform: translateY(-1px);
}
.tpd-card__cta:active {
    transform: translateY(0);
}
/* Fallback-CTA: Amazon-Suche — gleiche Form, etwas gedämpftere Farbe */
.tpd-card__cta--fallback {
    background: #ff9900;
}
.tpd-card__cta--fallback:hover {
    background: #e68a00;
}

/* =============================================
   FACETWP PAGINATION
   ============================================= */
.facetwp-pager {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 32px;
    padding: 16px 0;
}
.facetwp-pager .facetwp-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #4a5568;
    background: #fff;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all .15s ease;
    text-decoration: none;
}
.facetwp-pager .facetwp-page:hover {
    background: #f0f7fa;
    border-color: #37aecf;
    color: #37aecf;
}
.facetwp-pager .facetwp-page.active {
    background: #37aecf;
    border-color: #37aecf;
    color: #fff;
    font-weight: 700;
}
.facetwp-pager .facetwp-page.next,
.facetwp-pager .facetwp-page.prev {
    font-size: 18px;
    font-weight: 700;
}
.facetwp-pager .dots {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a0aec0;
    font-size: 14px;
}

/* =============================================
   FACETWP FILTER SIDEBAR
   ============================================= */

/* --- Section Titles --- */
.facetwp-facet-hersteller ~ h4,
.widget-title,
h4:has(+ .facetwp-facet),
.facetwp-facet + h4 {
    font-size: 14px;
    font-weight: 700;
    color: #1a202c;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 10px;
}

/* --- Checkboxes --- */
.facetwp-type-checkboxes .facetwp-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0 6px 26px;
    font-size: 14px;
    color: #4a5568;
    cursor: pointer;
    transition: color .15s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18'%3E%3Crect x='0.5' y='0.5' width='17' height='17' rx='4' fill='%23fff' stroke='%23cbd5e0'/%3E%3C/svg%3E") !important;
    background-size: 18px 18px !important;
    background-position: 0 center !important;
    background-repeat: no-repeat !important;
}
.facetwp-type-checkboxes .facetwp-checkbox:hover {
    color: #37aecf;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18'%3E%3Crect x='0.5' y='0.5' width='17' height='17' rx='4' fill='%23fff' stroke='%2337aecf'/%3E%3C/svg%3E") !important;
}
.facetwp-type-checkboxes .facetwp-checkbox.checked {
    color: #37aecf;
    font-weight: 600;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 18 18'%3E%3Crect x='0.5' y='0.5' width='17' height='17' rx='4' fill='%2337aecf' stroke='%2337aecf'/%3E%3Cpath d='M5 9l3 3 5-5' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
}
.facetwp-type-checkboxes .facetwp-counter {
    color: #a0aec0;
    font-size: 12px;
    margin-left: 2px;
}
.facetwp-type-checkboxes .facetwp-toggle {
    color: #37aecf;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    margin-top: 6px;
}
.facetwp-type-checkboxes .facetwp-toggle:hover {
    text-decoration: underline;
}

/* --- Sliders --- */
.facetwp-type-slider .facetwp-slider-wrap {
    padding: 8px 0 4px;
}
.facetwp-type-slider .noUi-connect {
    background: #37aecf !important;
}
.facetwp-type-slider .noUi-horizontal {
    height: 6px !important;
    border: none !important;
    background: #e2e8f0 !important;
    border-radius: 3px !important;
    box-shadow: none !important;
}
.facetwp-type-slider .noUi-handle {
    width: 20px !important;
    height: 20px !important;
    border-radius: 50% !important;
    border: 2px solid #37aecf !important;
    background: #fff !important;
    box-shadow: 0 1px 4px rgba(0,0,0,.15) !important;
    cursor: grab !important;
    top: -8px !important;
}
.facetwp-type-slider .noUi-handle:before,
.facetwp-type-slider .noUi-handle:after {
    display: none !important;
}
.facetwp-type-slider .facetwp-slider-reset {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    padding: 5px 14px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    background: #37aecf;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background .15s ease;
}
.facetwp-type-slider .facetwp-slider-reset:hover {
    background: #2d9ab8;
}
.facetwp-slider-label {
    font-size: 13px;
    color: #4a5568;
    margin-top: 6px;
}

/* --- Number Range --- */
.facetwp-type-number_range .facetwp-number {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    color: #4a5568;
    background: #fff;
    transition: border-color .15s ease;
    box-sizing: border-box;
}
.facetwp-type-number_range .facetwp-number:focus {
    outline: none;
    border-color: #37aecf;
    box-shadow: 0 0 0 3px rgba(55,174,207,.15);
}
.facetwp-type-number_range .facetwp-submit {
    display: inline-flex;
    align-items: center;
    margin-top: 8px;
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: #37aecf;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background .15s ease;
}
.facetwp-type-number_range .facetwp-submit:hover {
    background: #2d9ab8;
}

/* --- Dropdowns --- */
.facetwp-type-dropdown select,
.facetwp-type-sort select {
    width: 100%;
    padding: 8px 32px 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    color: #4a5568;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a0aec0' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
    transition: border-color .15s ease;
}
.facetwp-type-dropdown select:focus,
.facetwp-type-sort select:focus {
    outline: none;
    border-color: #37aecf;
    box-shadow: 0 0 0 3px rgba(55,174,207,.15);
}

/* =============================================
   TOPLIST CARDS
   ============================================= */
.tpd-toplist-wrap {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.tpd-toplist {
    position: relative;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    overflow: hidden;
    transition: box-shadow .2s ease;
}
.tpd-toplist:hover {
    box-shadow: 0 10px 25px rgba(0,0,0,.1), 0 4px 10px rgba(0,0,0,.06);
}
.tpd-toplist__rank {
    position: absolute;
    top: 0;
    left: 0;
    width: 48px;
    height: 48px;
    background: #37aecf;
    color: #fff;
    font-size: 20px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0 0 12px 0;
    z-index: 3;
}
.tpd-toplist__inner {
    display: grid;
    grid-template-columns: 200px 1fr auto;
    gap: 0;
    min-height: 180px;
}
.tpd-toplist .tpd-toplist__image {
    height: auto;
    min-height: 160px;
    max-height: 200px;
    border-radius: 0;
}
.tpd-toplist .tpd-toplist__image img {
    object-fit: contain;
    padding: 16px;
}
.tpd-toplist__body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 20px 24px;
    gap: 8px;
}
.tpd-toplist__body .tpd-card__title {
    font-size: 19px;
    margin-bottom: 4px;
}
.tpd-toplist__action {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 20px 24px;
    min-width: 200px;
    border-left: 1px solid #f0f0f0;
}
.tpd-toplist__action .tpd-card__footer {
    border-top: none;
    padding-top: 0;
}
.tpd-toplist__action .tpd-card__price-current {
    font-size: 24px;
}

/* =============================================
   SEARCH LAYOUT + FILTERS (tpd_listing type=search)
   ============================================= */
.tpd-search-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 24px;
    align-items: start;
}
.tpd-search-results {
    min-width: 0;
}
.tpd-search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.tpd-search-count {
    font-size: 14px;
    color: #718096;
    font-weight: 500;
}
.tpd-sort-form {
    display: inline;
}
.tpd-sort-select {
    padding: 6px 28px 6px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    color: #4a5568;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23a0aec0' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}
.tpd-no-results {
    padding: 40px;
    text-align: center;
    color: #a0aec0;
    font-size: 15px;
}

/* Filter Sidebar */
.tpd-filters {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    position: sticky;
    top: 80px;
}
.tpd-filter-group {
    margin-bottom: 20px;
}
.tpd-filter-group:last-child {
    margin-bottom: 0;
}
.tpd-filter-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #1a202c;
    margin: 0 0 10px;
}
.tpd-filter-options {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 240px;
    overflow-y: auto;
}
.tpd-filter-option {
    display: block;
    padding: 6px 10px;
    font-size: 13px;
    color: #4a5568;
    text-decoration: none;
    border-radius: 6px;
    transition: all .12s ease;
}
.tpd-filter-option:hover {
    background: #f0f7fa;
    color: #37aecf;
}
.tpd-filter-option--active {
    background: #37aecf !important;
    color: #fff !important;
    font-weight: 600;
}
.tpd-filter-count {
    color: #a0aec0;
    font-size: 11px;
    font-weight: 400;
    margin-left: 4px;
}
.tpd-filter-option--active .tpd-filter-count {
    color: rgba(255, 255, 255, 0.8);
}
.tpd-search-layout {
    transition: opacity .15s ease;
}

/* ─────────────────────────────────────────────────────────
   Block-Wrapper (Heading + CTA) — für gallery/strip/grid/toplist
   ───────────────────────────────────────────────────────── */
.tpd-block {
    margin-bottom: 32px;
}
.tpd-block__header {
    margin-bottom: 18px;
}
.tpd-block__heading {
    font-size: 24px;
    font-weight: 700;
    color: #1a202c;
    margin: 0 0 4px;
    line-height: 1.25;
}
.tpd-block__subheading {
    font-size: 15px;
    color: #4a5568;
    margin: 0;
}
.tpd-block__cta {
    margin-top: 16px;
    text-align: right;
}
.tpd-block__cta-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    color: #37aecf;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    transition: all .15s ease;
}
.tpd-block__cta-link:hover,
.tpd-block__cta-link:focus-visible {
    background: #37aecf;
    color: #fff;
    border-color: #37aecf;
}

/* Card-Style Varianten */
.tpd-block--highlighted .tpd-card {
    border: 2px solid #37aecf;
    box-shadow: 0 4px 12px rgba(55, 174, 207, 0.15);
}
.tpd-block--minimal .tpd-card {
    box-shadow: none;
    border: 1px solid #e2e8f0;
}

/* ─────────────────────────────────────────────────────────
   Gallery-Layout — CSS-Variablen pro Block-Instanz via Inline-Style
   ───────────────────────────────────────────────────────── */
.tpd-gallery {
    display: grid;
    grid-template-columns: repeat(var(--tpd-cols-desk, 4), 1fr);
    gap: 16px;
}
@media (max-width: 960px) {
    .tpd-gallery {
        grid-template-columns: repeat(var(--tpd-cols-tab, 3), 1fr);
        gap: 12px;
    }
}
@media (max-width: 600px) {
    .tpd-gallery {
        grid-template-columns: repeat(var(--tpd-cols-mob, 2), 1fr);
        gap: 10px;
    }
}

/* ─────────────────────────────────────────────────────────
   Strip-Layout — horizontal scrollbar mit Snap
   ───────────────────────────────────────────────────────── */
.tpd-strip {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(240px, 1fr);
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 4px;
    padding-bottom: 12px;  /* Platz für Scrollbar */
    scrollbar-width: thin;
    scrollbar-color: #cbd5e0 transparent;
}
.tpd-strip::-webkit-scrollbar {
    height: 6px;
}
.tpd-strip::-webkit-scrollbar-track {
    background: transparent;
}
.tpd-strip::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}
.tpd-strip > * {
    scroll-snap-align: start;
}
@media (max-width: 960px) {
    .tpd-strip {
        grid-auto-columns: 42%;
    }
}
@media (max-width: 600px) {
    .tpd-strip {
        grid-auto-columns: 75%;
        gap: 10px;
    }
}

/* ─────────────────────────────────────────────────────────
   Compact Card (für Gallery + Strip) — kleinere Typo, weniger Padding
   ───────────────────────────────────────────────────────── */
.tpd-card--compact {
    /* nutzt .tpd-card Basis-Styles, nur kompaktere Varianten */
}
.tpd-card--compact .tpd-card__image {
    height: 160px;
}
.tpd-card--compact .tpd-card__body {
    padding: 12px;
}
.tpd-card--compact .tpd-card__title {
    font-size: 14px;
    line-height: 1.35;
    margin-bottom: 8px;
    /* 2-Zeilen Truncate */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.tpd-card--compact .tpd-card__specs {
    margin-bottom: 8px;
}
.tpd-card--compact .tpd-card__spec {
    font-size: 12px;
}
.tpd-card--compact .tpd-card__footer {
    gap: 8px;
}
.tpd-card--compact .tpd-card__price-current {
    font-size: 16px;
}
.tpd-card--compact .tpd-card__cta {
    padding: 8px 10px;
    font-size: 13px;
}
@media (max-width: 600px) {
    .tpd-card--compact .tpd-card__image { height: 130px; }
    .tpd-card--compact .tpd-card__title { font-size: 13px; }
    .tpd-card--compact .tpd-card__body { padding: 10px; }
}

/* ─────────────────────────────────────────────────────────
   Related-Section (Varianten + Zubehör, CSS-only Tabs)
   ───────────────────────────────────────────────────────── */
.tpd-related {
    margin: 40px 0 32px;
    padding: 24px;
    background: #f7fafc;
    border-radius: 12px;
}
.tpd-related__title {
    font-size: 22px;
    font-weight: 700;
    color: #1a202c;
    margin: 0 0 16px;
}
.tpd-related__subtitle {
    font-size: 16px;
    font-weight: 600;
    color: #2d3748;
    margin: 0 0 14px;
}
.tpd-related__count {
    color: #718096;
    font-weight: 400;
    font-size: 0.9em;
}

/* Radios verstecken — Labels übernehmen die Tab-Interaktion */
.tpd-related__radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.tpd-related__tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 18px;
    border-bottom: 2px solid #e2e8f0;
}
.tpd-related__tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    margin-bottom: -2px;
    font-size: 14px;
    font-weight: 600;
    color: #4a5568;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all .15s ease;
}
.tpd-related__tab:hover {
    color: #37aecf;
}
.tpd-related__radio--variants:checked ~ .tpd-related__tabs .tpd-related__tab:first-child,
.tpd-related__radio--accessories:checked ~ .tpd-related__tabs .tpd-related__tab:last-child {
    color: #37aecf;
    border-bottom-color: #37aecf;
}

/* Panels — Default: alle versteckt, checked Radio aktiviert passendes Panel */
.tpd-related__panel {
    display: none;
}
.tpd-related__radio--variants:checked ~ .tpd-related__panel--variants,
.tpd-related__radio--accessories:checked ~ .tpd-related__panel--accessories {
    display: block;
}
/* Fallback wenn nur 1 Panel ohne Tabs (radios fehlen) — zeige immer */
.tpd-related > .tpd-related__panel:only-of-type {
    display: block;
}

/* Gallery innerhalb Related: kleiner + weniger Schatten */
.tpd-gallery--related {
    --tpd-cols-desk: 3;
    --tpd-cols-tab: 2;
    --tpd-cols-mob: 2;
    gap: 14px;
}
.tpd-gallery--related .tpd-card--compact {
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

/* Mobile-Anpassung: Tabs scrollbar, Gallery 2-spaltig */
@media (max-width: 600px) {
    .tpd-related {
        padding: 16px;
        margin: 24px 0;
    }
    .tpd-related__title {
        font-size: 18px;
    }
    .tpd-related__tabs {
        overflow-x: auto;
        scrollbar-width: none;
    }
    .tpd-related__tabs::-webkit-scrollbar {
        display: none;
    }
    .tpd-related__tab {
        padding: 8px 12px;
        font-size: 13px;
        white-space: nowrap;
        flex-shrink: 0;
    }
}

/* Mobile-Filter-Toggle (Desktop versteckt) */
.tpd-filters-toggle {
    display: none;
    width: 100%;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: #37aecf;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background .12s ease;
}
.tpd-filters-toggle:hover,
.tpd-filters-toggle:focus-visible {
    background: #2b8ca8;
}
.tpd-filters-toggle__icon {
    font-size: 18px;
    line-height: 1;
}
.tpd-filters-toggle__label {
    flex: 1;
    text-align: left;
}
.tpd-filters-toggle__badge {
    background: rgba(255,255,255,.25);
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
}
.tpd-filters-toggle__chevron {
    font-size: 10px;
    transition: transform .18s ease;
}
.tpd-filters[data-tpd-open="true"] .tpd-filters-toggle__chevron {
    transform: rotate(180deg);
}

@media (max-width: 960px) {
    .tpd-filters-toggle { display: flex; }
    .tpd-filters {
        padding: 12px;
    }
    .tpd-filters__body {
        display: none;
        margin-top: 14px;
        padding-top: 14px;
        border-top: 1px solid #e2e8f0;
    }
    .tpd-filters[data-tpd-open="true"] .tpd-filters__body {
        display: block;
    }
}
.tpd-filter-reset {
    display: block;
    margin-top: 16px;
    padding: 8px 16px;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    color: #e53e3e;
    text-decoration: none;
    border: 1px solid #fed7d7;
    border-radius: 6px;
    transition: all .12s ease;
}
.tpd-filter-reset:hover {
    background: #fff5f5;
}

/* Search Input */
.tpd-search-input-wrap {
    display: flex;
    gap: 0;
}
.tpd-search-input {
    flex: 1;
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #e2e8f0;
    border-right: none;
    border-radius: 6px 0 0 6px;
    outline: none;
    transition: border-color .12s ease;
}
.tpd-search-input:focus {
    border-color: #37aecf;
}
.tpd-search-submit {
    padding: 8px 12px;
    background: #37aecf;
    color: #fff;
    border: 1px solid #37aecf;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    font-size: 14px;
    transition: background .12s ease;
}
.tpd-search-submit:hover {
    background: #2d9ab8;
}

/* Active Filter Chips */
.tpd-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}
.tpd-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: #ebf8ff;
    color: #2b6cb0;
    font-size: 13px;
    font-weight: 500;
    border-radius: 20px;
    text-decoration: none;
    transition: all .12s ease;
}
.tpd-chip:hover {
    background: #bee3f8;
}
.tpd-chip__label {
    color: #90cdf4;
    font-weight: 400;
}
.tpd-chip__remove {
    font-size: 16px;
    line-height: 1;
    color: #90cdf4;
}
.tpd-chip--locked {
    background: #edf2f7;
    color: #4a5568;
    cursor: default;
}
.tpd-chip--locked .tpd-chip__label {
    color: #a0aec0;
}

/* Pagination */
.tpd-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 32px;
    padding: 16px 0;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
    /* Grid mobile */
    .tpd-grid,
    .fwpl-layout:has(.tpd-card) {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    .tpd-card__image {
        height: 200px;
    }
    .tpd-card__title {
        font-size: 16px;
    }
    .tpd-card__price-current {
        font-size: 20px;
    }
    .tpd-card__body {
        padding: 14px 16px 16px;
    }

    /* Toplist mobile: stack vertically */
    .tpd-toplist__inner {
        grid-template-columns: 1fr;
    }
    .tpd-toplist .tpd-toplist__image {
        height: 200px;
    }
    .tpd-toplist__body {
        padding: 16px;
    }
    .tpd-toplist__action {
        border-left: none;
        border-top: 1px solid #f0f0f0;
        padding: 16px;
        min-width: auto;
    }
    .tpd-toplist__rank {
        width: 40px;
        height: 40px;
        font-size: 17px;
    }

    /* Pagination mobile */
    .facetwp-pager {
        gap: 4px;
        margin-top: 24px;
    }
    .facetwp-pager .facetwp-page {
        min-width: 36px;
        height: 36px;
        font-size: 13px;
        padding: 0 8px;
    }

    /* Filter mobile */
    .facetwp-type-checkboxes .facetwp-checkbox {
        padding: 8px 0;
        font-size: 15px;
    }

    /* Search layout mobile */
    .tpd-search-layout {
        grid-template-columns: 1fr;
    }
    .tpd-filters {
        position: static;
    }
    .tpd-filter-options {
        max-height: 220px;  /* lange Listen (Hersteller) scrollbar statt endlos */
        overflow-y: auto;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 4px;
    }
    .tpd-filter-group {
        margin-bottom: 14px;
    }
    .tpd-filter-title {
        margin-bottom: 6px;
    }
    .tpd-search-header {
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
}
