/**
 * SearchPro - Facetten-Filter Styles
 *
 * Kompaktes, modernes Filter-Design für OXID Apex Theme (Bootstrap 5).
 *
 * Design-Konzept:
 * - Horizontale Quick-Filter für wichtige Attribute
 * - "Alle Filter" Offcanvas für vollständige Filterung
 * - Aktive Filter als Tags/Chips
 * - Responsive Mobile-First
 */

/* ========================================
   CSS Custom Properties (Apex-kompatibel)
   ======================================== */

:root {
    --searchpro-bg: #f8f9fa;
    --searchpro-border: #e9ecef;
    --searchpro-text: #212529;
    --searchpro-text-muted: #6c757d;
    --searchpro-primary: var(--bs-primary, #0d6efd);
    --searchpro-primary-hover: #0b5ed7;
    --searchpro-tag-bg: #e7f1ff;
    --searchpro-tag-text: #0d6efd;
    --searchpro-radius: 0.5rem;
    --searchpro-radius-sm: 0.375rem;
    --searchpro-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --searchpro-transition: 0.2s ease;
}

/* ========================================
   Hauptcontainer
   ======================================== */

.searchpro-facets {
    margin-bottom: 1.25rem;
    position: relative;
}

/* ========================================
   FILTER BAR - Kompakte horizontale Leiste
   ======================================== */

.searchpro-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: var(--searchpro-bg);
    border: 1px solid var(--searchpro-border);
    border-radius: var(--searchpro-radius);
}

/* Quick Filters Container */
.searchpro-quick-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

/* Einzelner Quick Filter */
.searchpro-quick-filter {
    min-width: 140px;
    max-width: 180px;
}

.searchpro-quick-filter__select {
    font-size: 0.875rem;
    border-color: var(--searchpro-border);
    transition: border-color var(--searchpro-transition), box-shadow var(--searchpro-transition);
}

.searchpro-quick-filter__select:hover {
    border-color: #adb5bd;
}

.searchpro-quick-filter__select:focus {
    border-color: var(--searchpro-primary);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

/* Preis Toggle Button */
.searchpro-quick-filter--price {
    min-width: auto;
    max-width: none;
}

.searchpro-price-toggle {
    display: inline-flex;
    align-items: center;
    font-size: 0.875rem;
    white-space: nowrap;
}

/* Filter Actions (Alle Filter + Reset) */
.searchpro-filter-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.searchpro-all-filters-btn {
    display: inline-flex;
    align-items: center;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    transition: all var(--searchpro-transition);
}

.searchpro-all-filters-btn:hover {
    background-color: var(--searchpro-text);
    color: #fff;
}

.searchpro-reset-link {
    font-size: 0.8125rem;
    text-decoration: none;
    white-space: nowrap;
    padding: 0.25rem 0.5rem;
}

.searchpro-reset-link:hover {
    text-decoration: underline;
}

/* ========================================
   PRICE COLLAPSE PANEL
   ======================================== */

.searchpro-price-collapse {
    margin-top: 0.75rem;
}

.searchpro-price-panel {
    padding: 1rem;
    background: #fff;
    border: 1px solid var(--searchpro-border);
    border-radius: var(--searchpro-radius-sm);
    box-shadow: var(--searchpro-shadow);
}

/* ========================================
   PRICE SLIDER IN OFFCANVAS
   ======================================== */

.searchpro-offcanvas-price {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--searchpro-border);
}

/* ========================================
   ACTIVE FILTER TAGS
   ======================================== */

.searchpro-active-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0;
}

.searchpro-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.625rem;
    background: var(--searchpro-tag-bg);
    color: var(--searchpro-tag-text);
    border-radius: 2rem;
    font-size: 0.8125rem;
    font-weight: 500;
    transition: all var(--searchpro-transition);
}

.searchpro-tag:hover {
    background: #d0e3ff;
}

.searchpro-tag__value {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.searchpro-tag__remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    padding: 0;
    color: var(--searchpro-tag-text);
    background: rgba(13, 110, 253, 0.15);
    border-radius: 50%;
    text-decoration: none;
    transition: all var(--searchpro-transition);
}

.searchpro-tag__remove:hover {
    background: var(--searchpro-primary);
    color: #fff;
}

.searchpro-tag--price {
    background: #fff3cd;
    color: #856404;
}

.searchpro-tag--price:hover {
    background: #ffe69c;
}

.searchpro-tag--price .searchpro-tag__remove {
    background: rgba(133, 100, 4, 0.15);
    color: #856404;
}

.searchpro-tag--price .searchpro-tag__remove:hover {
    background: #856404;
    color: #fff;
}

/* ========================================
   OFFCANVAS - All Filters Panel
   ======================================== */

.searchpro-offcanvas {
    width: 360px !important;
}

@media (max-width: 991.98px) {
    .searchpro-offcanvas {
        width: min(420px, 85vw) !important;
    }
}

@media (max-width: 767.98px) {
    .searchpro-offcanvas {
        width: min(85vw, 360px) !important;
    }
}

@media (max-width: 575.98px) {
    .searchpro-offcanvas {
        width: calc(100vw - 3rem) !important;
    }
}

.searchpro-offcanvas .offcanvas-header {
    border-bottom: 1px solid var(--searchpro-border);
    padding: 1rem 1.25rem;
}

.searchpro-offcanvas .offcanvas-title {
    display: flex;
    align-items: center;
    font-size: 1.125rem;
    font-weight: 600;
}

.searchpro-offcanvas .offcanvas-body {
    padding: 0;
    display: flex;
    flex-direction: column;
}

.searchpro-offcanvas-form {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

/* Accordion im Offcanvas */
.searchpro-accordion {
    flex: 1;
    overflow-y: auto;
    border: none;
}

.searchpro-accordion-item {
    border: none;
    border-bottom: 1px solid var(--searchpro-border);
}

.searchpro-accordion-item:last-child {
    border-bottom: none;
}

.searchpro-accordion-btn {
    padding: 0.875rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 500;
    background: transparent;
    box-shadow: none !important;
}

.searchpro-accordion-btn:not(.collapsed) {
    color: var(--searchpro-primary);
    background: rgba(13, 110, 253, 0.05);
}

.searchpro-accordion-btn::after {
    width: 1rem;
    height: 1rem;
    background-size: 1rem;
}

.searchpro-accordion-badge {
    margin-left: auto;
    margin-right: 0.75rem;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--searchpro-tag-bg);
    color: var(--searchpro-primary);
    border-radius: 2rem;
}

.searchpro-accordion-body {
    padding: 0.5rem 1.25rem 1rem;
}

/* Filter Options im Accordion */
.searchpro-filter-options {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.searchpro-filter-option {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    margin: 0;
    cursor: pointer;
    border-radius: var(--searchpro-radius-sm);
    transition: background var(--searchpro-transition);
}

.searchpro-filter-option:hover {
    background: var(--searchpro-bg);
}

.searchpro-filter-option__input {
    margin-right: 0.625rem;
    accent-color: var(--searchpro-primary);
}

.searchpro-filter-option__input:checked + .searchpro-filter-option__label {
    font-weight: 600;
    color: var(--searchpro-primary);
}

.searchpro-filter-option__label {
    flex: 1;
    font-size: 0.875rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.searchpro-filter-option__count {
    color: var(--searchpro-text-muted);
    font-size: 0.8125rem;
    font-weight: 400;
}

/* Offcanvas Footer mit Submit Button */
.searchpro-offcanvas-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--searchpro-border);
    background: #fff;
    position: sticky;
    bottom: 0;
}

/* ========================================
   PREIS-FILTER (Price Slider)
   ======================================== */

.searchpro-price-filter {
    width: 100%;
}

.searchpro-price-filter__label {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--searchpro-text-muted);
}

.searchpro-price-filter__values {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--searchpro-text);
    margin-bottom: 0.75rem;
}

.searchpro-price-filter__separator {
    color: var(--searchpro-text-muted);
    font-weight: 400;
}

.searchpro-price-filter__currency {
    color: var(--searchpro-text-muted);
    font-weight: 400;
    font-size: 0.875rem;
}

/* Dual Range Slider */
.searchpro-price-slider {
    position: relative;
    height: 28px;
    margin: 0.5rem 0 0.25rem;
    /* Platz fuer Bubbles oben */
    padding-top: 2rem;
    box-sizing: content-box;
}

/* Preis-Bubble ueber dem Thumb */
.searchpro-price-bubble {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    background: var(--searchpro-text, #212529);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 0.375rem;
    white-space: nowrap;
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.15s ease;
    letter-spacing: 0.01em;
}

.searchpro-price-bubble::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--searchpro-text, #212529);
}

.searchpro-price-bubble--visible {
    opacity: 1;
}

.searchpro-price-slider__track {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 6px;
    transform: translateY(-50%);
    background: var(--searchpro-border);
    border-radius: 3px;
}

.searchpro-price-slider__range {
    position: absolute;
    top: 50%;
    height: 6px;
    transform: translateY(-50%);
    background: var(--searchpro-primary);
    border-radius: 3px;
    pointer-events: none;
}

.searchpro-price-slider__input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    pointer-events: none;
    margin: 0;
    padding: 0;
}

.searchpro-price-slider__input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    background: #fff;
    border: 3px solid var(--searchpro-primary);
    border-radius: 50%;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transition: transform 0.15s, box-shadow 0.15s;
}

.searchpro-price-slider__input::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.searchpro-price-slider__input::-webkit-slider-thumb:active {
    transform: scale(1.05);
    background: var(--searchpro-primary);
    border-color: var(--searchpro-primary);
}

.searchpro-price-slider__input::-moz-range-thumb {
    width: 22px;
    height: 22px;
    background: #fff;
    border: 3px solid var(--searchpro-primary);
    border-radius: 50%;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.searchpro-price-slider__input::-moz-range-track {
    background: transparent;
}

.searchpro-price-slider__input--min {
    z-index: 2;
}

.searchpro-price-slider__input--max {
    z-index: 1;
}

.searchpro-price-slider__input:focus {
    outline: none;
}

.searchpro-price-slider__input:focus::-webkit-slider-thumb {
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.2), 0 2px 6px rgba(0, 0, 0, 0.15);
}

.searchpro-price-filter__range-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--searchpro-text-muted);
    margin-top: 0.25rem;
}

/* ========================================
   FACET RENDER TYPES
   ======================================== */

/* --- Color Grid --- */
.facet-color-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.25rem 0;
}

.facet-color-grid--inline {
    gap: 0.375rem;
    align-items: center;
}

.facet-color-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--searchpro-radius-sm);
    transition: all var(--searchpro-transition);
    border: 2px solid transparent;
}

.facet-color-tile:hover {
    background: var(--searchpro-bg);
}

.facet-color-tile--active {
    border-color: var(--searchpro-primary);
    background: rgba(13, 110, 253, 0.05);
}

.facet-color-tile--all {
    min-width: 48px;
}

.facet-color-tile--reset {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: var(--searchpro-text-muted);
    font-size: 1rem;
    text-decoration: none;
}

.facet-color-tile--reset:hover {
    color: #dc3545;
    background: rgba(220, 53, 69, 0.1);
}

.facet-color-tile__swatch {
    display: block;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--searchpro-border);
    background: var(--searchpro-bg);
    transition: transform var(--searchpro-transition), box-shadow var(--searchpro-transition);
}

.facet-color-tile:hover .facet-color-tile__swatch {
    transform: scale(1.1);
}

.facet-color-tile--active .facet-color-tile__swatch {
    border-color: var(--searchpro-primary);
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.3);
}

.facet-color-tile__name {
    font-size: 0.6875rem;
    color: var(--searchpro-text-muted);
    text-align: center;
    max-width: 48px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.facet-color-tile__label {
    font-size: 0.75rem;
    color: var(--searchpro-text-muted);
}

/* Common color swatches */
.facet-color-tile__swatch[data-color="rot"],
.facet-color-tile__swatch[data-color="red"] { background: #dc3545; }
.facet-color-tile__swatch[data-color="blau"],
.facet-color-tile__swatch[data-color="blue"] { background: #0d6efd; }
.facet-color-tile__swatch[data-color="gruen"],
.facet-color-tile__swatch[data-color="grün"],
.facet-color-tile__swatch[data-color="green"] { background: #198754; }
.facet-color-tile__swatch[data-color="gelb"],
.facet-color-tile__swatch[data-color="yellow"] { background: #ffc107; }
.facet-color-tile__swatch[data-color="schwarz"],
.facet-color-tile__swatch[data-color="black"] { background: #212529; }
.facet-color-tile__swatch[data-color="weiss"],
.facet-color-tile__swatch[data-color="weiß"],
.facet-color-tile__swatch[data-color="white"] { background: #fff; border-color: #dee2e6; }
.facet-color-tile__swatch[data-color="grau"],
.facet-color-tile__swatch[data-color="grey"],
.facet-color-tile__swatch[data-color="gray"] { background: #6c757d; }
.facet-color-tile__swatch[data-color="braun"],
.facet-color-tile__swatch[data-color="brown"] { background: #795548; }
.facet-color-tile__swatch[data-color="orange"] { background: #fd7e14; }
.facet-color-tile__swatch[data-color="pink"],
.facet-color-tile__swatch[data-color="rosa"] { background: #e91e90; }
.facet-color-tile__swatch[data-color="lila"],
.facet-color-tile__swatch[data-color="violett"],
.facet-color-tile__swatch[data-color="purple"] { background: #6f42c1; }
.facet-color-tile__swatch[data-color="silber"],
.facet-color-tile__swatch[data-color="silver"] { background: linear-gradient(135deg, #c0c0c0, #e8e8e8); }
.facet-color-tile__swatch[data-color="gold"] { background: linear-gradient(135deg, #d4a017, #f5d442); }

/* --- Facet Slider --- */
.facet-slider {
    padding: 0.5rem 0;
}

.facet-slider__values {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.9375rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.facet-slider__separator {
    color: var(--searchpro-text-muted);
}

/* --- Quick Filter Label (for color grids in quickfilter context) --- */
.searchpro-quick-filter__label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--searchpro-text-muted);
    margin-bottom: 0.25rem;
    display: block;
}

.searchpro-quick-filter--color {
    min-width: auto;
    max-width: none;
}

/* ========================================
   LOADING STATE
   ======================================== */

.searchpro-facets--loading {
    pointer-events: none;
    opacity: 0.6;
}

.searchpro-facets__loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    background: rgba(255, 255, 255, 0.95);
    padding: 0.75rem 1.25rem;
    border-radius: var(--searchpro-radius-sm);
    box-shadow: var(--searchpro-shadow);
}

/* ========================================
   RESPONSIVE
   ======================================== */

/* Tablet */
@media (max-width: 991.98px) {
    .searchpro-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .searchpro-quick-filters {
        order: 1;
        justify-content: flex-start;
    }

    .searchpro-filter-actions {
        order: 2;
        margin-left: 0;
        margin-top: 0.5rem;
        justify-content: flex-start;
    }

    .searchpro-quick-filter {
        flex: 1;
        min-width: 120px;
        max-width: none;
    }
}

/* Mobile */
@media (max-width: 575.98px) {
    .searchpro-filter-bar {
        padding: 0.75rem;
        gap: 0.5rem;
    }

    .searchpro-quick-filters {
        flex-direction: column;
        width: 100%;
    }

    .searchpro-quick-filter {
        width: 100%;
        max-width: none;
    }

    .searchpro-filter-actions {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .searchpro-all-filters-btn {
        flex: 1;
        justify-content: center;
    }

    .searchpro-active-tags {
        gap: 0.375rem;
    }

    .searchpro-tag {
        font-size: 0.75rem;
        padding: 0.3rem 0.5rem;
    }

    .searchpro-tag__value {
        max-width: 100px;
    }
}

/* ========================================
   ANIMATION
   ======================================== */

.searchpro-product-list {
    transition: opacity 0.2s ease-out;
}

.searchpro-loading .searchpro-product-list {
    opacity: 0.3;
}

@keyframes searchpro-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

.searchpro-quick-filter__select:focus,
.searchpro-filter-option__input:focus {
    outline: 2px solid var(--searchpro-primary);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .searchpro-tag,
    .searchpro-tag__remove,
    .searchpro-quick-filter__select,
    .searchpro-price-slider__input::-webkit-slider-thumb {
        transition: none;
    }
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ========================================
   MERCHANDISING BANNER
   ======================================== */

.searchpro-merchandising {
    margin-bottom: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Message Alert */
.searchpro-merchandising__message {
    margin-bottom: 0;
    border-radius: var(--searchpro-radius);
    font-size: 0.9375rem;
}

/* Image Banner */
.searchpro-merchandising__banner {
    display: block;
    position: relative;
    overflow: hidden;
    border-radius: var(--searchpro-radius);
    box-shadow: var(--searchpro-shadow);
    text-decoration: none;
    color: inherit;
    transition: box-shadow var(--searchpro-transition), transform var(--searchpro-transition);
}

a.searchpro-merchandising__banner:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.searchpro-merchandising__banner-img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    max-height: 300px;
}

.searchpro-merchandising__banner-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem 2rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.65));
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.searchpro-merchandising__banner-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.searchpro-merchandising__banner-subtitle {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Custom HTML */
.searchpro-merchandising__html {
    border-radius: var(--searchpro-radius);
}

/* Responsive */
@media (max-width: 575.98px) {
    .searchpro-merchandising__banner-img {
        max-height: 180px;
    }

    .searchpro-merchandising__banner-overlay {
        padding: 1rem;
    }

    .searchpro-merchandising__banner-title {
        font-size: 1.125rem;
    }

    .searchpro-merchandising__banner-subtitle {
        font-size: 0.875rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .searchpro-merchandising__banner {
        transition: none;
    }
}

/* ========================================
   DID-YOU-MEAN KORREKTURVORSCHLAG
   ======================================== */

.searchpro-did-you-mean {
    padding: 0.625rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.9375rem;
    color: var(--searchpro-text-muted);
    background: var(--searchpro-bg);
    border: 1px solid var(--searchpro-border);
    border-radius: var(--searchpro-radius);
}

.searchpro-did-you-mean__link {
    font-weight: 600;
    color: var(--searchpro-primary);
    text-decoration: none;
    margin-left: 0.25rem;
}

.searchpro-did-you-mean__link:hover {
    text-decoration: underline;
}

/* ========================================
   ZERO RESULTS PAGE
   ======================================== */

.searchpro-zero-results {
    max-width: 900px;
    margin: 0 auto;
}

.searchpro-zero-results__icon {
    color: var(--searchpro-text-muted);
}

.searchpro-zero-results .card {
    border: 1px solid var(--searchpro-border);
    border-radius: var(--searchpro-radius);
    transition: box-shadow var(--searchpro-transition);
}

.searchpro-zero-results .card:hover {
    box-shadow: var(--searchpro-shadow);
}

.searchpro-zero-results .card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* ========================================
   AUTOCOMPLETE DROPDOWN
   ======================================== */

.searchpro-autocomplete {
    position: relative;
    display: inline-block;
    width: 100%;
}

.searchpro-autocomplete__dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: -4px;
    right: -4px;
    z-index: 1050;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 0.75rem;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.07),
        0 12px 28px -4px rgba(0, 0, 0, 0.13),
        0 0 0 1px rgba(0, 0, 0, 0.03);
    max-height: 520px;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;

    /* Erschein-Animation */
    display: none;
    opacity: 0;
    transform: translateY(-8px);
    transition:
        opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.searchpro-autocomplete__dropdown--open {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Scrollbar */
.searchpro-autocomplete__dropdown::-webkit-scrollbar {
    width: 6px;
}

.searchpro-autocomplete__dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.searchpro-autocomplete__dropdown::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.12);
    border-radius: 3px;
}

.searchpro-autocomplete__dropdown::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.22);
}

/* Section Headers */
.searchpro-autocomplete__section {
    padding: 0;
}

.searchpro-autocomplete__section:first-child .searchpro-autocomplete__section-title {
    border-radius: 0.75rem 0.75rem 0 0;
}

.searchpro-autocomplete__section-title {
    padding: 0.625rem 1.125rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #8b95a2;
    background: linear-gradient(to bottom, #f6f7f9, #f1f3f5);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    margin: 0;
    position: sticky;
    top: 0;
    z-index: 2;
    backdrop-filter: blur(8px);
}

/* Product Items */
.searchpro-autocomplete__product {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.625rem 1.125rem;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid rgba(0, 0, 0, 0.035);
    transition:
        background 0.15s ease,
        box-shadow 0.15s ease;
    cursor: pointer;
    position: relative;
}

.searchpro-autocomplete__product:last-child {
    border-bottom: none;
}

.searchpro-autocomplete__product:hover,
.searchpro-autocomplete__product--active {
    background: #f4f6f9;
    text-decoration: none;
    color: inherit;
}

.searchpro-autocomplete__product--active {
    background: #edf0f5;
    box-shadow: inset 3px 0 0 0 var(--searchpro-primary, #0d6efd);
}

.searchpro-autocomplete__product-image {
    width: 56px;
    height: 56px;
    object-fit: contain;
    border-radius: 0.5rem;
    background: #f8f9fb;
    border: 1px solid rgba(0, 0, 0, 0.04);
    flex-shrink: 0;
    padding: 3px;
    transition: transform 0.2s ease;
}

.searchpro-autocomplete__product:hover .searchpro-autocomplete__product-image {
    transform: scale(1.05);
}

.searchpro-autocomplete__product-image--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #f0f2f5, #e8eaee);
    border-radius: 0.5rem;
    border: 1px solid rgba(0, 0, 0, 0.04);
    color: #b0b8c4;
    font-size: 1.375rem;
    flex-shrink: 0;
}

.searchpro-autocomplete__product-info {
    flex: 1;
    min-width: 0;
}

.searchpro-autocomplete__product-title {
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #1a1f25;
}

.searchpro-autocomplete__product-title mark {
    background: rgba(13, 110, 253, 0.1);
    color: #0a58ca;
    padding: 0.05em 0.15em;
    border-radius: 3px;
    font-weight: 600;
}

.searchpro-autocomplete__product-sku {
    display: block;
    font-size: 0.75rem;
    color: #6c757d;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.searchpro-autocomplete__product-sku mark {
    background: rgba(13, 110, 253, 0.1);
    color: #0a58ca;
    padding: 0.05em 0.15em;
    border-radius: 3px;
    font-weight: 600;
}

.searchpro-autocomplete__product-price {
    font-size: 0.8125rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    flex-shrink: 0;
    background: var(--searchpro-primary, #0d6efd);
    padding: 0.2rem 0.625rem;
    border-radius: 2rem;
    letter-spacing: 0.01em;
}

/* Category Items */
.searchpro-autocomplete__category {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 1.125rem;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid rgba(0, 0, 0, 0.035);
    transition:
        background 0.15s ease,
        box-shadow 0.15s ease;
    cursor: pointer;
}

.searchpro-autocomplete__category:last-child {
    border-bottom: none;
}

.searchpro-autocomplete__category:hover,
.searchpro-autocomplete__category--active {
    background: #f4f6f9;
    text-decoration: none;
    color: inherit;
}

.searchpro-autocomplete__category--active {
    background: #edf0f5;
    box-shadow: inset 3px 0 0 0 var(--searchpro-primary, #0d6efd);
}

.searchpro-autocomplete__category-icon {
    color: #8b95a2;
    font-size: 0.9375rem;
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f2f5;
    border-radius: 0.375rem;
}

.searchpro-autocomplete__category:hover .searchpro-autocomplete__category-icon {
    background: #e4e8ee;
}

.searchpro-autocomplete__category-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: #1a1f25;
}

.searchpro-autocomplete__category-title mark {
    background: rgba(13, 110, 253, 0.1);
    color: #0a58ca;
    padding: 0.05em 0.15em;
    border-radius: 3px;
    font-weight: 600;
}

/* Suggestion Items */
.searchpro-autocomplete__suggestion {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 1.125rem;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid rgba(0, 0, 0, 0.035);
    transition:
        background 0.15s ease,
        box-shadow 0.15s ease;
    cursor: pointer;
}

.searchpro-autocomplete__suggestion:last-child {
    border-bottom: none;
}

.searchpro-autocomplete__suggestion:hover,
.searchpro-autocomplete__suggestion--active {
    background: #f4f6f9;
    text-decoration: none;
    color: inherit;
}

.searchpro-autocomplete__suggestion--active {
    background: #edf0f5;
    box-shadow: inset 3px 0 0 0 var(--searchpro-primary, #0d6efd);
}

.searchpro-autocomplete__suggestion-icon {
    color: #8b95a2;
    font-size: 0.9375rem;
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f2f5;
    border-radius: 0.375rem;
}

.searchpro-autocomplete__suggestion:hover .searchpro-autocomplete__suggestion-icon {
    background: #e4e8ee;
}

.searchpro-autocomplete__suggestion-text {
    font-size: 0.875rem;
    color: #1a1f25;
}

.searchpro-autocomplete__suggestion-text mark {
    background: rgba(13, 110, 253, 0.1);
    color: #0a58ca;
    padding: 0.05em 0.15em;
    border-radius: 3px;
    font-weight: 600;
}

/* Trending Items */
.searchpro-autocomplete__trending {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 1.125rem;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid rgba(0, 0, 0, 0.035);
    transition:
        background 0.15s ease,
        box-shadow 0.15s ease;
    cursor: pointer;
}

.searchpro-autocomplete__trending:last-child {
    border-bottom: none;
}

.searchpro-autocomplete__trending:hover,
.searchpro-autocomplete__trending--active {
    background: #f4f6f9;
    text-decoration: none;
    color: inherit;
}

.searchpro-autocomplete__trending--active {
    background: #edf0f5;
    box-shadow: inset 3px 0 0 0 var(--searchpro-primary, #0d6efd);
}

.searchpro-autocomplete__trending-icon {
    color: #e8453c;
    font-size: 0.9375rem;
    flex-shrink: 0;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff0f0;
    border-radius: 0.375rem;
}

.searchpro-autocomplete__trending:hover .searchpro-autocomplete__trending-icon {
    background: #ffe3e3;
}

.searchpro-autocomplete__trending-text {
    font-size: 0.875rem;
    flex: 1;
    color: #1a1f25;
}

.searchpro-autocomplete__trending-count {
    font-size: 0.6875rem;
    font-weight: 600;
    color: #8b95a2;
    background: #f0f2f5;
    padding: 0.125rem 0.5rem;
    border-radius: 2rem;
}

/* All Results Link */
.searchpro-autocomplete__all-results {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.75rem 1.125rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--searchpro-primary, #0d6efd);
    text-decoration: none;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    background: linear-gradient(to bottom, #fafbfc, #f5f6f8);
    border-radius: 0 0 0.75rem 0.75rem;
    transition:
        background 0.15s ease,
        color 0.15s ease;
    letter-spacing: 0.01em;
}

.searchpro-autocomplete__all-results:hover,
.searchpro-autocomplete__all-results--active {
    background: var(--searchpro-primary, #0d6efd);
    color: #fff;
    text-decoration: none;
}

/* Loading State */
.searchpro-autocomplete__loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.5rem 1rem;
    font-size: 0.8125rem;
    color: #8b95a2;
}

.searchpro-autocomplete__spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid #e9ecef;
    border-top-color: var(--searchpro-primary, #0d6efd);
    border-radius: 50%;
    animation: searchpro-ac-spin 0.7s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

@keyframes searchpro-ac-spin {
    to { transform: rotate(360deg); }
}

/* ----------------------------------------
   RESPONSIVE: Tablet
   ---------------------------------------- */
@media (max-width: 991.98px) {
    .searchpro-autocomplete__dropdown {
        left: -2px;
        right: -2px;
        max-height: 480px;
    }

    .searchpro-autocomplete__product-image,
    .searchpro-autocomplete__product-image--placeholder {
        width: 50px;
        height: 50px;
    }
}

/* ----------------------------------------
   RESPONSIVE: Mobile — Bottom-Sheet Style
   ---------------------------------------- */
@media (max-width: 575.98px) {
    .searchpro-autocomplete__dropdown {
        position: fixed;
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        max-height: 70vh;
        border-radius: 1rem 1rem 0 0;
        border: none;
        box-shadow:
            0 -4px 12px rgba(0, 0, 0, 0.08),
            0 -16px 48px rgba(0, 0, 0, 0.12);
        transform: translateY(12px);
    }

    .searchpro-autocomplete__dropdown--open {
        transform: translateY(0);
    }

    /* Drag-Handle-Indikator */
    .searchpro-autocomplete__dropdown::before {
        content: '';
        display: block;
        width: 36px;
        height: 4px;
        background: #d0d5dc;
        border-radius: 2px;
        margin: 0.5rem auto 0.25rem;
    }

    .searchpro-autocomplete__section:first-child .searchpro-autocomplete__section-title {
        border-radius: 0;
    }

    .searchpro-autocomplete__product {
        padding: 0.75rem 1rem;
        gap: 0.75rem;
    }

    .searchpro-autocomplete__product-image,
    .searchpro-autocomplete__product-image--placeholder {
        width: 48px;
        height: 48px;
    }

    .searchpro-autocomplete__product-price {
        font-size: 0.75rem;
        padding: 0.15rem 0.5rem;
    }

    .searchpro-autocomplete__all-results {
        border-radius: 0;
        padding: 0.875rem 1rem;
        position: sticky;
        bottom: 0;
    }
}

/* ----------------------------------------
   REDUCED MOTION
   ---------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .searchpro-autocomplete__dropdown {
        transition: none;
    }

    .searchpro-autocomplete__product,
    .searchpro-autocomplete__category,
    .searchpro-autocomplete__suggestion,
    .searchpro-autocomplete__trending,
    .searchpro-autocomplete__all-results,
    .searchpro-autocomplete__product-image {
        transition: none;
    }
}
