/* ==========================================================================
   Marketplace Mobile Filter — FAB + Bottom Sheet (Bootstrap offcanvas)
   Mobile (<768px): yatay filtre bar gizli, FAB görünür, tıklayınca bottom sheet açılır.
   Desktop (≥768px): FAB gizli, normal filtre bar.
   ========================================================================== */

@media (max-width: 767.98px) {
    .marketplace-filter-bar--collapsible {
        display: none !important;
    }
}

@media (min-width: 768px) {
    .marketplace-filter-fab,
    #marketplaceFilterSheet,
    #contractorFilterSheet {
        display: none !important;
    }
}

.marketplace-filter-fab {
    position: fixed;
    right: 16px;
    bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    z-index: 1035;
    background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
    color: #fff;
    border: 0;
    border-radius: var(--radius-2026-btn, 14px);
    padding: 0.75rem 1.1rem;
    font-size: 0.9rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    box-shadow: var(--shadow-soft, 0 12px 36px rgba(15, 23, 42, 0.03));
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.marketplace-filter-fab:hover,
.marketplace-filter-fab:focus {
    transform: translateY(-2px);
    color: #fff;
    box-shadow: var(--shadow-soft, 0 12px 36px rgba(15, 23, 42, 0.03));
}

.marketplace-filter-fab:active {
    transform: translateY(0) scale(0.97);
}

.marketplace-filter-fab__count {
    background: rgba(255, 255, 255, 0.22);
    border-radius: var(--radius-2026-btn, 14px);
    padding: 1px 7px;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.2;
}

.marketplace-filter-fab__count[hidden] {
    display: none;
}

/* Bottom sheet (Bootstrap offcanvas-bottom override) */
#marketplaceFilterSheet.offcanvas-bottom {
    height: auto;
    max-height: 88vh;
    border-top-left-radius: 22px;
    border-top-right-radius: 22px;
    background: var(--bs-body-bg, #fff);
    box-shadow: 0 -16px 48px rgba(15, 23, 42, 0.22);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

#marketplaceFilterSheet .offcanvas-header {
    border-bottom: 1px solid #e2e8f0;
    padding: 1rem 1.25rem;
}

#marketplaceFilterSheet .offcanvas-header::before {
    content: "";
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    border-radius: var(--radius-2026-btn, 14px);
    background: #cbd5e1;
}

#marketplaceFilterSheet .offcanvas-title {
    font-weight: 700;
    color: #23313b;
}

#marketplaceFilterSheet .offcanvas-body {
    padding: 1rem 1.25rem 1.5rem;
}

/* Dark mode */
html[data-theme='dark'] #marketplaceFilterSheet.offcanvas-bottom {
    background: #23313b;
}

html[data-theme='dark'] #marketplaceFilterSheet .offcanvas-header {
    border-color: #334155;
}

html[data-theme='dark'] #marketplaceFilterSheet .offcanvas-header::before {
    background: #475569;
}

html[data-theme='dark'] #marketplaceFilterSheet .offcanvas-title {
    color: #e2e8f0;
}

/* Pastel production pass: shared mobile marketplace filter */
.marketplace-filter-fab {
    background: #e8f4ff;
    color: #235675;
    border: 1px solid #b9d9ec;
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(31, 78, 107, 0.12);
}

.marketplace-filter-fab:hover,
.marketplace-filter-fab:focus {
    color: #1f4e6b;
    background: #dceef9;
    border-color: #a9d1e6;
    box-shadow: 0 14px 32px rgba(31, 78, 107, 0.14);
}

.marketplace-filter-fab__count {
    background: #ffffff;
    color: #276346;
    border: 1px solid #bfdfcc;
    border-radius: 8px;
}

#marketplaceFilterSheet.offcanvas-bottom,
#contractorFilterSheet.offcanvas-bottom {
    background: #ffffff;
    border-top: 1px solid rgba(137, 172, 195, 0.3);
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    box-shadow: 0 -16px 42px rgba(31, 78, 107, 0.14);
}

#marketplaceFilterSheet .offcanvas-header,
#contractorFilterSheet .offcanvas-header {
    border-bottom-color: rgba(137, 172, 195, 0.24);
}

#marketplaceFilterSheet .offcanvas-header::before,
#contractorFilterSheet .offcanvas-header::before {
    background: #b9d9ec;
}

#marketplaceFilterSheet .offcanvas-title,
#contractorFilterSheet .offcanvas-title {
    color: #172033;
}
