/* ASE Specifications - Category Page + Filter Sidebar (Unified Card) */

/* ── Category Grid Layout ── */
.ase-category-layout {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(300px, 3fr);
    gap: 28px;
    align-items: start;
}

.ase-category-products {
    min-width: 0;
}

.ase-category-filters {
    min-width: 0;
}

/* ── Filter Sidebar ── */
.ase-filter-sidebar {
    width: 100%;
}

/* ── Filter Card (single unified container) ── */
.ase-filter-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    position: sticky;
    top: 24px;
}

.ase-filter-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px 12px;
    border-bottom: 1px solid #f0f0f0;
}

.ase-filter-card-title {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    letter-spacing: -0.01em;
}

.ase-card-header .ase-clear-filters,
.ase-filter-card-header .ase-clear-filters {
    background: none;
    border: none;
    color: #c0392b;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    transition: background 0.15s;
}

.ase-filter-card-header .ase-clear-filters:hover {
    background: #fef2f2;
}

/* ── Active Filter Tags ── */
.ase-filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease, padding 0.25s ease;
}

.ase-filter-tags.has-tags {
    padding: 10px 18px 4px;
    max-height: 200px;
}

.ase-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #f0f4ff;
    border: 1px solid #d0dbff;
    color: #2c5282;
    font-size: 12px;
    font-weight: 500;
    padding: 3px 8px 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
    cursor: default;
    line-height: 1.4;
}

.ase-filter-tag-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: none;
    border: none;
    color: #5b7fca;
    cursor: pointer;
    padding: 0;
    border-radius: 50%;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
    line-height: 1;
    font-size: 14px;
}

.ase-filter-tag-remove:hover {
    background: #d0dbff;
    color: #1a365d;
}

/* ── Filter Section (accordion) ── */
.ase-filter-section {
    border-bottom: 1px solid #f3f4f6;
}

.ase-filter-section:last-of-type {
    border-bottom: none;
}

.ase-filter-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 18px;
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: background 0.15s;
}

.ase-filter-section-head::-webkit-details-marker {
    display: none;
}

.ase-filter-section-head::marker {
    display: none;
    content: '';
}

.ase-filter-section-head:hover {
    background: #fafbfc;
}

.ase-filter-section-label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    letter-spacing: 0.01em;
}

.ase-chevron {
    color: #9ca3af;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.ase-filter-section[open] > .ase-filter-section-head .ase-chevron {
    transform: rotate(180deg);
}

.ase-filter-section-body {
    padding: 0 18px 14px;
}

/* ── Custom Checkboxes ── */
.ase-filter-checks {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ase-check-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    color: #374151;
    cursor: pointer;
    padding: 5px 6px;
    border-radius: 5px;
    transition: background 0.12s;
    line-height: 1.4;
}

.ase-check-label:hover {
    background: #f5f6f8;
}

.ase-check-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.ase-check-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border: 1.5px solid #c9cdd4;
    border-radius: 4px;
    background: #fff;
    flex-shrink: 0;
    transition: border-color 0.15s, background 0.15s;
}

.ase-check-mark::after {
    content: '';
    width: 9px;
    height: 5px;
    border-left: 1.8px solid #fff;
    border-bottom: 1.8px solid #fff;
    transform: rotate(-45deg) scale(0);
    transition: transform 0.15s ease;
    margin-top: -1px;
}

.ase-check-label input:checked + .ase-check-mark {
    background: #c0392b;
    border-color: #c0392b;
}

.ase-check-label input:checked + .ase-check-mark::after {
    transform: rotate(-45deg) scale(1);
}

/* ── Select Dropdown ── */
.ase-filter-section-body select {
    width: 100%;
    padding: 7px 10px;
    font-size: 13.5px;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s;
    appearance: auto;
}

.ase-filter-section-body select:focus {
    outline: none;
    border-color: #c0392b;
    box-shadow: 0 0 0 2px rgba(192, 57, 43, 0.1);
}

/* ── Range Inputs ── */
.ase-range-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ase-range-wrap input {
    flex: 1;
    min-width: 0;
    padding: 7px 10px;
    font-size: 13.5px;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    transition: border-color 0.15s;
    -moz-appearance: textfield;
}

.ase-range-wrap input::-webkit-inner-spin-button,
.ase-range-wrap input::-webkit-outer-spin-button {
    opacity: 1;
}

.ase-range-wrap input:focus {
    outline: none;
    border-color: #c0392b;
    box-shadow: 0 0 0 2px rgba(192, 57, 43, 0.1);
}

.ase-range-sep {
    color: #9ca3af;
    font-size: 14px;
    flex-shrink: 0;
}

/* ── Product Count ── */
.ase-filter-count {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 16px;
    padding: 0 2px;
}

.ase-filter-count strong {
    color: #1a1a1a;
    font-weight: 600;
}

/* ── Loading overlay ── */
.ase-filter-loading {
    position: relative;
}

.ase-filter-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(1px);
    display: none;
    border-radius: 6px;
    z-index: 5;
}

.ase-filter-loading.is-loading::after {
    display: block;
}

/* ═══════════════════════════════════════════════
   MOBILE — full width, collapsible filter
   ═══════════════════════════════════════════════ */
.ase-filter-toggle {
    display: none;
}

@media (max-width: 860px) {
    .ase-category-layout {
        grid-template-columns: 1fr;
    }

    .ase-category-filters {
        order: 1;
    }

    .ase-category-products {
        order: 2;
    }

    .ase-filter-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        padding: 12px 16px;
        background: #fff;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        font-size: 14px;
        font-weight: 600;
        color: #1a1a1a;
        cursor: pointer;
        margin-bottom: 10px;
        transition: background 0.15s;
    }

    .ase-filter-toggle:hover {
        background: #fafbfc;
    }

    .ase-filter-toggle-left {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .ase-filter-badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 20px;
        height: 20px;
        padding: 0 6px;
        background: #c0392b;
        color: #fff;
        font-size: 11px;
        font-weight: 700;
        border-radius: 10px;
    }

    .ase-filter-sidebar .ase-filter-inner {
        display: none;
    }

    .ase-filter-sidebar .ase-filter-inner.is-open {
        display: block;
    }

    .ase-filter-card {
        position: static;
    }
}
