/* =========================================
   ÜRÜN LİSTESİ SIRALAMA & FİLTRE TOOLBAR
   Trendyol/Hepsiburada tarzı profesyonel UI
   ========================================= */

/* --- Container --- */
.mp-toolbar {
    margin-bottom: 1.25rem;
    position: relative;
    z-index: 5;
    background: #fff;
    padding: 0;
}

/* --- Desktop Bar --- */
.mp-toolbar-desktop {
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
}
.mp-toolbar-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.mp-toolbar-right {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

/* --- Sort Dropdown (Desktop) --- */
.mp-sort-dropdown {
    position: relative;
}
.mp-sort-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.8125rem;
    color: #333;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    white-space: nowrap;
    font-family: inherit;
    line-height: 1.4;
}
.mp-sort-trigger:hover {
    border-color: #bbb;
}
.mp-sort-trigger.open {
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13,110,253,0.08);
}
.mp-sort-trigger strong {
    font-weight: 600;
    color: #111;
}
.mp-sort-chevron {
    transition: transform 0.2s;
    opacity: 0.5;
}
.mp-sort-trigger.open .mp-sort-chevron {
    transform: rotate(180deg);
}

/* Dropdown Menu */
.mp-sort-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 220px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1), 0 2px 8px rgba(0,0,0,0.04);
    z-index: 8;
    padding: 0.375rem 0;
    animation: mpMenuFade 0.15s ease;
}
.mp-sort-menu.open {
    display: flex;
    flex-direction: column;
}
@keyframes mpMenuFade {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}
.mp-sort-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 1rem;
    font-size: 0.8125rem;
    color: #444;
    text-decoration: none;
    transition: background 0.1s;
    white-space: nowrap;
    flex-shrink: 0;
}
.mp-sort-menu-item:hover {
    background: #f7f8fa;
    text-decoration: none;
    color: #222;
}
.mp-sort-menu-item.active {
    color: #0d6efd;
    font-weight: 600;
    background: #f0f6ff;
}
.mp-sort-menu-item svg {
    color: #0d6efd;
}

/* --- Active Filter Chips --- */
.mp-active-filters {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
}
.mp-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.3125rem 0.625rem;
    background: #f0f6ff;
    border: 1px solid #d0e2ff;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #0d6efd;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
}
.mp-filter-chip:hover {
    background: #dce9ff;
    border-color: #0d6efd;
    text-decoration: none;
    color: #0d6efd;
}
.mp-filter-chip svg {
    opacity: 0.6;
}
.mp-filter-chip:hover svg {
    opacity: 1;
}

/* --- Stock Toggle Switch --- */
.mp-stock-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    cursor: pointer;
    user-select: none;
    margin: 0;
    padding: 0.375rem 0;
}
.mp-stock-toggle input { display: none; }
.mp-stock-slider {
    position: relative;
    width: 36px;
    height: 20px;
    background: #d4d4d4;
    border-radius: 999px;
    transition: background 0.2s;
    flex-shrink: 0;
    order: 2;
}
.mp-stock-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.mp-stock-toggle input:checked + .mp-stock-slider,
.mp-sheet-toggle-row input:checked + .mp-stock-slider {
    background: #0d6efd;
}
.mp-stock-toggle input:checked + .mp-stock-slider::after,
.mp-sheet-toggle-row input:checked + .mp-stock-slider::after {
    transform: translateX(16px);
}
.mp-stock-text {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #555;
    order: 1;
}

/* --- Mobile Buttons --- */
.mp-toolbar-mobile {
    border-bottom: 1px solid #f0f0f0;
}
.mp-mob-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 0.5rem;
    background: #fff;
    border: none;
    border-right: 1px solid #f0f0f0;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #444;
    cursor: pointer;
    transition: background 0.1s;
    font-family: inherit;
}
.mp-mob-btn:last-child {
    border-right: none;
}
.mp-mob-btn:active {
    background: #f8f8f8;
}
.mp-mob-btn svg {
    opacity: 0.6;
    flex-shrink: 0;
}
.mp-mob-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.625rem;
    font-weight: 700;
    background: #0d6efd;
    color: #fff;
    padding: 0.125rem 0.4375rem;
    border-radius: 999px;
    min-width: 18px;
    height: 18px;
    line-height: 1;
}

/* --- Bottom Sheet (Shared) --- */
.mp-sheet-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1050;
    opacity: 0;
    transition: opacity 0.3s ease;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}
.mp-sheet-overlay.show { opacity: 1; }

.mp-bottom-sheet {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 14px 14px 0 0;
    z-index: 1051;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    max-height: 75vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.mp-bottom-sheet.show { transform: translateY(0); }

.mp-sheet-handle {
    width: 36px;
    height: 4px;
    background: #ddd;
    border-radius: 999px;
    margin: 0.625rem auto 0;
}

.mp-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.25rem 0.75rem;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
}
.mp-sheet-title {
    font-size: 1rem;
    font-weight: 700;
    color: #111;
    letter-spacing: -0.01em;
}
.mp-sheet-close {
    background: #f5f5f5;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1.25rem;
    color: #888;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background 0.1s;
}
.mp-sheet-close:active { background: #eee; }

.mp-sheet-body { padding: 0.25rem 0 0.5rem; }

/* Sort Options */
.mp-sheet-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9375rem 1.25rem;
    color: #333;
    text-decoration: none;
    font-size: 0.9375rem;
    transition: background 0.1s;
    -webkit-tap-highlight-color: transparent;
}
.mp-sheet-option:hover,
.mp-sheet-option:active {
    background: #fafafa;
    text-decoration: none;
    color: #333;
}
.mp-sheet-option.active {
    color: #0d6efd;
    font-weight: 600;
}

/* Filter Toggle Row */
.mp-sheet-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    cursor: pointer;
    font-size: 0.9375rem;
    font-weight: 500;
    color: #333;
    margin: 0;
    -webkit-tap-highlight-color: transparent;
}
.mp-sheet-toggle-row input { display: none; }
.mp-sheet-toggle-row .mp-stock-slider {
    width: 42px;
    height: 24px;
}
.mp-sheet-toggle-row .mp-stock-slider::after {
    width: 20px;
    height: 20px;
}
.mp-sheet-toggle-row input:checked + .mp-stock-slider::after {
    transform: translateX(18px);
}

/* Sheet Footer */
.mp-sheet-footer {
    display: flex;
    gap: 0.625rem;
    padding: 0.875rem 1.25rem;
    border-top: 1px solid #f0f0f0;
    position: sticky;
    bottom: 0;
    background: #fff;
}
.mp-sheet-btn-secondary {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    background: #fff;
    color: #555;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    font-family: inherit;
    transition: background 0.1s;
}
.mp-sheet-btn-secondary:hover { text-decoration: none; color: #333; background: #fafafa; }
.mp-sheet-btn-primary {
    flex: 2;
    padding: 0.75rem;
    border: none;
    border-radius: 10px;
    background: #0d6efd;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}
.mp-sheet-btn-primary:active { background: #0b5ed7; }

/* --- Stock Filter (CSS-only hide) --- */
#mpProductGrid.mp-stok-active .mp-product-col[data-stok="0"] {
    display: none;
}
