/* Module: forms.css — inputs, buttons, checkboxes, selects, filter controls, range sliders, view toggle */

/* View toggle toolbar */
.view-toggle {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 10px;
}

.view-switch .form-check-input {
    width: 48px;
    height: 24px;
    cursor: pointer;
}

/* Dual Range Slider (Preisbereich) */
.range-slider {
    position: relative;
    height: 36px;
}

.range-slider input[type="range"] {
    position: absolute;
    left: 0;
    right: 0;
    top: 10px;
    width: 100%;
    pointer-events: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: none;
    height: 0;
}

.range-slider input[type="range"]::-webkit-slider-thumb {
    pointer-events: auto;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #007fa3;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px rgba(0, 127, 163, 0.35);
}

.range-slider input[type="range"]::-moz-range-thumb {
    pointer-events: auto;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #007fa3;
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px rgba(0, 127, 163, 0.35);
}

.range-slider .slider-track {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(50% - 9px);
    height: 4px;
    background: #e9ecef;
    border-radius: 4px;
}

.range-slider .slider-range {
    position: absolute;
    top: calc(50% - 9px);
    height: 4px;
    background: #007fa3;
    border-radius: 4px;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, #009ec7 0%, #008fb3 50%, #007fa3 100%);
    border-color: #007fa3;
    padding: 8px 16px;
    border-radius: 20px;
    color: white;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #008fb3 0%, #007fa3 50%, #006f94 100%);
    border-color: #006f94;
    transform: translateY(-1px);
}

.btn-primary:focus,
.btn-primary:active {
    background: linear-gradient(135deg, #008fb3 0%, #007fa3 50%, #006f94 100%);
    border-color: #006f94;
    box-shadow: none;
    /* Fokusring entfernen */
    outline: none;
}

/* Filter Sidebar */
.filter-sidebar {
    background-color: transparent;
    border-radius: 8px;
    padding: 10px 15px;
    /* Sticky position remains, but we let it flow with the page */
    position: sticky;
    top: 20px;
    font-size: 0.9rem;
    margin-bottom: 60px;
    box-shadow: none;
    /* Hide scrollbar */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* 2026-05-27: Versuchter Innen-Scroll der Sidebar (max-height + overflow-y)
   wieder zurueckgenommen — Mouse-Wheel ueber Produkten erreichte den Sidebar-
   Innen-Scroll nicht, dadurch waren die unteren Smart-Filter (Kategorien,
   Kamera, Nachhaltigkeit) nicht zugaenglich. Sticky top:20px bleibt; lange
   Filter-Liste ueberragt den Content-Bereich nach unten — das ist der akzep-
   tierte CSS-only Kompromiss bis wir ggf. eine JS-basierte Smart-Sticky-
   Implementierung machen. */

.filter-sidebar::-webkit-scrollbar {
    display: none;
}

/* Wenn die Navbar ausgeblendet ist, verringert sich der notwendige Offset, damit kein leerer
   Platz über der Sidebar entsteht und sie nicht nach unten springt. */
/* Kein spezielles Handling mehr noetig – Sticky-Offset ist fix */

/* Accordion Styles für Filter */
.filter-sidebar .accordion-item {
    border: none;
    margin-bottom: 12px;
    border-radius: 12px;
    background-color: transparent;
}

.filter-sidebar .accordion-item .accordion-collapse.show {
    margin-bottom: 5px;
}

.filter-sidebar .accordion-button {
    padding: 12px 15px;
    font-size: 0.95rem;
    font-weight: 700;
    background-color: transparent !important;
    border: none;
    border-radius: 12px;
    color: #1a1a1b !important;
    box-shadow: none !important;
}

.filter-sidebar .accordion-button:not(.collapsed) {
    background-color: transparent !important;
    color: #1a1a1b !important;
    box-shadow: none !important;
}

.filter-sidebar .accordion-button:focus {
    box-shadow: none;
    color: #000 !important;
    border-color: #e9ecef;
}

.filter-sidebar .accordion-body {
    padding: 12px 15px;
    font-size: 0.85rem;
}

.filter-sidebar .form-label {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: #495057;
}

.filter-sidebar .form-control-sm,
.filter-sidebar .form-select-sm {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
}

/* Alle Form-Controls etwas runder machen */
.form-control,
.form-select {
    border-radius: 12px;
}

/* Alle Buttons runder machen */
.btn {
    border-radius: 15px;
}

/* Globale Fokus-Unterdrückung für Buttons, Form-Elemente und Checkboxen (verhindert persistente blaue Rahmen nach Klick) */
.btn:focus,
.btn:active:focus,
.form-control:focus,
.form-select:focus,
button:focus,
button:focus-visible,
.form-check-input:focus,
.form-check-input:focus-visible,
input[type="checkbox"]:focus,
input[type="radio"]:focus,
select:focus {
    outline: none !important;
    box-shadow: none !important;
}

.filter-sidebar .form-text {
    font-size: 0.75rem;
    color: #6c757d;
}

/* Legacy filter section styles - kept for compatibility */
.filter-section {
    margin-bottom: 15px;
}

.filter-heading {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: #2c3e50;
}

/* Filter Card Styles */
.filter-card {
    background-color: white !important;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
    padding: 1.5rem;
}

.filter-card .card-header {
    background-color: white !important;
    border-bottom: 1px solid #eee;
    padding: 1rem;
}

.filter-card .card-body {
    background-color: white !important;
    padding: 1rem;
}

.filter-card h6 {
    color: #333;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.filter-card .form-control {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0.5rem;
}

.filter-card .form-control:focus {
    border-color: #666;
    box-shadow: none;
}

.filter-card .form-check {
    margin-bottom: 0.5rem;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-section {
    margin-bottom: 1.5rem;
}

.filter-section h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: #333;
}

/* Mobile filter toggle button */
@media (max-width: 768px) {

    /* FILTER SIDEBAR MOBILE - VERSTECKT PER DEFAULT */
    .filter-sidebar {
        position: static;
        height: auto;
        margin-bottom: 20px;
        padding: 15px;
        display: none;
        /* Versteckt per Default auf Mobile */
    }

    /* MOBILE FILTER TOGGLE BUTTON - KLEIN IN NAVBAR */
    #mobileFilterToggle {
        border-radius: 6px;
        padding: 6px 8px;
        font-size: 0.9rem;
        border: 1px solid #00A8CC;
        transition: all 0.3s ease;
        margin-left: 0;
        min-width: 40px;
        height: 35px;
        display: flex;
        align-items: center;
        justify-content: center;
        align-self: flex-start;
    }

    #mobileFilterToggle:hover {
        transform: translateY(-1px);
        box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
    }

    #mobileFilterToggle i {
        margin: 0;
        font-size: 0.85rem;
    }

    /* BUTTONS MOBILE */
    .btn-primary {
        width: auto;
        padding: 8px 12px;
        font-size: 0.8rem;
        margin-top: 8px;
        border-radius: 15px;
        width: auto;
    }

    /* FILTER SIDEBAR MOBILE */
    .filter-sidebar {
        position: static;
        height: auto;
        margin-bottom: 20px;
    }
}

@media (max-width: 576px) {

    /* MOBILE FILTER BUTTON SMARTPHONE */
    #mobileFilterToggle {
        padding: 4px 6px;
        font-size: 0.8rem;
        margin-left: 8px;
        min-width: 32px;
        height: 30px;
    }

    #mobileFilterToggle i {
        font-size: 0.75rem;
    }

    /* FILTER ACCORDION SMARTPHONE */
    .filter-sidebar {
        padding: 10px;
        margin-bottom: 15px;
    }

    .filter-sidebar .accordion-button {
        padding: 8px 12px;
        font-size: 0.85rem;
    }

    .filter-sidebar .accordion-body {
        padding: 10px 12px;
        font-size: 0.8rem;
    }

    /* BUTTONS SMARTPHONE */
    .btn-primary {
        padding: 6px 10px;
        font-size: 0.75rem;
        margin-top: 6px;
        border-radius: 12px;
        width: auto;
    }
}

@media (max-width: 992px) {
    .filters {
        margin-bottom: 1.5rem;
    }

    .filter-sidebar {
        position: static;
        height: auto;
        margin-bottom: 20px;
    }
}

/* ── Mobile Filter / Sort FABs (Split) ──
   Zwei Pill-FABs in den unteren Ecken statt einem zentralen Button.
   Hintergrund: Ein zentraler FAB kollidierte mit dem Browser-Chrome
   (Safari-Toolbar, Chrome-Address-Bar bei Scroll-Up), das in der
   Bildschirmmitte hochfährt. Linke und rechte Ecken bleiben frei. */
.mobile-filter-fab,
.mobile-sort-fab {
    display: none;
    position: fixed;
    bottom: max(25px, env(safe-area-inset-bottom, 25px));
    z-index: 1050;
    background: #1a1a1b;
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 10px 18px;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1;
    gap: 7px;
    align-items: center;
    box-shadow: 0 3px 16px rgba(0,0,0,0.24);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    cursor: pointer;
}

.mobile-filter-fab svg,
.mobile-sort-fab svg {
    width: 16px;
    height: 16px;
}

.mobile-filter-fab { left: 14px; }
.mobile-sort-fab   { right: 14px; }

.mobile-filter-fab.visible,
.mobile-sort-fab.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Badge mit Anzahl aktiver Filter — nur sichtbar wenn >0 */
.mobile-filter-fab .fab-count {
    display: none;
    background: #00A8CC;
    color: #fff;
    font-size: 0.66rem;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 9px;
    min-width: 17px;
    text-align: center;
    line-height: 1.35;
}
.mobile-filter-fab.has-active .fab-count { display: inline-block; }

@media (max-width: 768px) {
    .mobile-filter-fab,
    .mobile-sort-fab {
        display: flex;
    }

    /* Alte Sortierung-Dropdowns ausblenden auf Mobile — sind jetzt
       redundant, weil das Sort-Bottom-Sheet vom .mobile-sort-fab die
       gleichen Optionen liefert. Die <select>-Elemente selbst bleiben
       im DOM (display: none, nicht entfernt), weil das Sort-Sheet sie
       als Sync-Target braucht: bei Radio-Klick im Sheet schreiben wir
       in #priceSort / #valueSortDir und triggern deren change-Event. */
    .sort-control {
        display: none !important;
    }
}

/* ============================================
   SMART FILTER PARENT BUTTONS
   ============================================ */
.sf-parent-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 20px;
    color: #475569;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.sf-parent-btn:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #1e293b;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.sf-parent-btn.active {
    background: #f0f9ff;
    border-color: #00A8CC;
    color: #00A8CC;
}

.sf-parent-count {
    background: #00A8CC;
    color: white;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 1px 7px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.sf-parent-btn.active .sf-parent-count {
    background: #00A8CC;
}

.sf-parent-icon {
    opacity: 0.5;
    transition: transform 0.2s ease;
}

/* ============================================
   SMART FILTER SIDEBAR CHIPS
   Passt optisch zu den bestehenden Accordion-Filtern
   ============================================ */

/* Accordion-Button aufgeklappt: kein hellblauer Bootstrap-Hintergrund */
#sidebarSmartFilters .accordion-button:not(.collapsed) {
    background-color: transparent !important;
    color: #1a1a1b;
    box-shadow: none !important;
}
#sidebarSmartFilters .accordion-button:not(.collapsed)::after {
    filter: none;
}
#sidebarSmartFilters .accordion-button {
    font-size: 0.95rem;
    font-weight: 700;
    padding: 12px 15px;
    color: #1a1a1b !important;
    background-color: transparent !important;
    box-shadow: none !important;
    border: none;
    border-radius: 12px;
}
#sidebarSmartFilters .accordion-item {
    background-color: transparent;
    border: none;
    margin-bottom: 12px;
    border-radius: 12px;
}
#sidebarSmartFilters .accordion-collapse,
#sidebarSmartFilters .accordion-body {
    background-color: transparent;
}

/* Badge neben dem Accordion-Titel (aktive Filter-Anzahl) */
.sf-sidebar-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #6366f1;
    color: #fff;
    border-radius: 10px;
    font-size: 0.68rem;
    font-weight: 700;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    line-height: 1;
    margin-left: 6px;
    vertical-align: middle;
}

/* Chips-Container — gleiche Innenabstände wie .filter-sidebar .accordion-body */
.sf-sidebar-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

/* Einzelner Chip — schlicht wie die restlichen Filter-Elemente */
.sf-sidebar-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 9px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    font-size: 0.78rem;
    color: #495057;
    cursor: pointer;
    transition: border-color 0.12s, background 0.12s, color 0.12s;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.6;
}
.sf-sidebar-chip:hover {
    border-color: #adb5bd;
    background: #f8f9fa;
    color: #212529;
}
.sf-sidebar-chip.active {
    background: #e8eaf6;
    border-color: #6366f1;
    color: #3730a3;
    font-weight: 600;
}

/* Produktanzahl neben dem Chip-Label */
.sf-chip-cnt {
    font-size: 0.68rem;
    color: #adb5bd;
    margin-left: 2px;
}
.sf-sidebar-chip.active .sf-chip-cnt {
    color: #818cf8;
}

/* Alle Sidebar-Chips: vertikal gestapelt (1 pro Zeile) */
.sf-sidebar-chips--vertical {
    flex-direction: column;
    gap: 3px;
}
.sf-sidebar-chips--vertical .sf-sidebar-chip {
    justify-content: flex-start;
    width: 100%;
    text-align: left;
}

/* Sub-Gruppen innerhalb einer Sidebar-Kategorie (z.B. Technik → Bildwiederholrate/Auflösung/...) */
.sf-sidebar-subgroup {
    margin-bottom: 10px;
}
.sf-sidebar-subgroup:last-child {
    margin-bottom: 0;
}
.sf-sidebar-sublabel {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7280;
    margin-bottom: 4px;
    padding: 0 2px;
}

/* Farb-Swatch Kreis */
.sf-color-swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-right: 4px;
    vertical-align: middle;
    border: 1px solid rgba(0,0,0,0.12);
}

/* Shop-Logo im Shops-Filter (Sidebar-Chips + Modal). Feste Box mit
   object-fit:contain, weil AWIN-Profile-Logos beliebige Seitenverhältnisse
   haben (meist breite Wortmarken). Weißer Hintergrund für transparente PNGs. */
.sf-shop-logo {
    display: inline-block;
    width: 44px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
    margin-right: 6px;
    vertical-align: middle;
    background: #fff;
    border-radius: 3px;
    border: 1px solid rgba(0,0,0,0.06);
}

/* "Alle anzeigen"-Link — wirkt wie ein kleiner Textlink */
.sf-sidebar-more-btn {
    display: inline-block;
    margin-top: 5px;
    font-size: 0.78rem;
    color: #6c757d;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    text-decoration: none;
}
.sf-sidebar-more-btn:hover {
    color: #495057;
    text-decoration: underline;
}

.sf-parent-btn:hover .sf-parent-icon {
    opacity: 0.8;
}

.sf-parent-btn.reset {
    color: #ef4444;
    border-color: #fecaca;
    background: #fff;
    font-weight: 700;
    margin-left: auto;
}

.sf-parent-btn.reset:hover {
    background: #fef2f2;
    border-color: #f87171;
}

/* Smart Filter parent buttons — second style block */
.sf-parent-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 20px;
    border: 1px solid #e0e0e0;
    background-color: #fff;
    font-size: 0.9rem;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}

.sf-parent-btn:hover {
    background-color: #f8f9fa;
    border-color: #ced4da;
}

.sf-parent-btn.active {
    background-color: #e3f2fd;
    border-color: #90caf9;
    color: #1976d2;
    font-weight: 500;
}

.sf-parent-count {
    background-color: #1976d2;
    color: #fff;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    line-height: 1;
}

.sf-parent-icon {
    color: #757575;
}

.sf-parent-btn.reset {
    background-color: transparent;
    border: none;
    color: #dc3545;
    text-decoration: underline;
    font-size: 0.85rem;
    padding: 6px 10px;
}

.sf-parent-btn.reset:hover {
    color: #a71d2a;
    background-color: transparent;
}

/* SMART FILTERS MODAL & BUTTONS */
.smart-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    align-items: center;
}

/* Inline-Variante: auf gleicher Ebene wie Sortierung, kein margin-bottom */
.smart-filters--inline {
    margin-bottom: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.smart-filters--inline::-webkit-scrollbar { display: none; }

/* Mobile Smart Filter Section Styles */
.mobile-sf-section {
    display: none; /* nur auf Mobile sichtbar */
}

.mobile-sf-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 10px;
    margin-top: 0;
}

.mobile-sf-divider {
    margin: 12px 0 16px;
    border-color: #e9ecef;
}

.compare-checkbox {
    margin: 0;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Variant Badges on Search Cards */
.variant-summary {
    margin: 8px 0;
}

.size-badge {
    background-color: #f8f9fa !important;
    color: #212529 !important;
    border: 1px solid #dee2e6 !important;
    font-weight: 600 !important;
    padding: 4px 8px !important;
    font-size: 0.75rem !important;
    border-radius: 4px !important;
}

.size-badge-more {
    color: #6c757d !important;
    font-weight: 600 !important;
    font-size: 0.75rem !important;
    display: flex;
    align-items: center;
}

@media (max-width: 576px) {
    .sf-parent-btn {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
}

/* Feed options table */
.feed-options-table code {
    font-size: 0.85rem;
}

.feed-option-current {
    border-left: 4px solid #198754;
}

.feed-name {
    font-weight: 600;
    color: #212529;
}

.feed-meta {
    font-size: 0.8rem;
    color: #6c757d;
}

.feed-url {
    font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
    font-size: 0.75rem;
    color: #495057;
    background: #f8f9fa;
    border-radius: 4px;
    padding: 4px 6px;
    margin-top: 4px;
    display: block;
    max-height: 68px;
    overflow: auto;
    word-break: break-all;
}

.feed-options-table .badge {
    font-size: 0.7rem;
}
