/* ============================================================
   FILTER PANEL SIDEBAR STYLING
   ============================================================ */

/* Main filter panel container - left sidebar */
.filter-panel {
    width: 280px;
    min-width: 280px;
    background: var(--background-color4, #f0efef);
    border: 2px solid var(--border-color2, #3a8a3493);
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 2px 8px var(--shadow-color, rgba(0, 0, 0, 0.6));
    position: sticky;
    top: 1rem;
    align-self: flex-start;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    box-sizing: border-box;
}

.filter-panel::-webkit-scrollbar {
    width: 8px;
}

.filter-panel::-webkit-scrollbar-track {
    background: var(--background-color3, #e4e3e3);
    border-radius: 4px;
}

.filter-panel::-webkit-scrollbar-thumb {
    background: var(--primary-color, #1d6316);
    border-radius: 4px;
}

.filter-panel::-webkit-scrollbar-thumb:hover {
    background: var(--highlight-color, #2e8a25);
}

/* Filter panel title */
.filter-panel > h3 {
    font-family: var(--main-font-family2, 'Science Gothic', 'Roboto', sans-serif);
    font-size: 1.89rem;
    font-weight: bold;
    color: var(--primary-color, #1d6316);
    margin: 0 0 1.5rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color2, #3a8a3493);
}

/* Filter group container */
.filter-group {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color, #c0c0c0);
    padding-bottom: 1rem;
}

.filter-group:last-of-type {
    border-bottom: none;
    margin-bottom: 1rem;
}

/* Collapsible filter group header */
.filter-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    margin-bottom: 0.75rem;
}

.filter-group-header h4 {
    font-family: var(--main-font-family2, 'Science Gothic', 'Roboto', sans-serif);
    font-size: 1.386rem;
    font-weight: 600;
    color: var(--primary-color, #1d6316);
    margin: 0;
}

.filter-group-toggle {
    font-size: 1.134rem;
    color: var(--text-color, #2b6924);
    transition: transform 0.3s ease;
}

.filter-group-toggle.collapsed {
    transform: rotate(-90deg);
}

.filter-group-content {
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 1;
}

.filter-group-content.collapsed {
    max-height: 0;
    opacity: 0;
    margin: 0;
    padding: 0;
}

/* Filter labels */
.filter-group label {
    display: flex;
    align-items: center;
    font-family: var(--main-font-family, 'Alumni Sans SC', 'Roboto', sans-serif);
    font-size: 1.197rem;
    color: var(--text-color, #2b6924);
    margin-bottom: 0.5rem;
    cursor: pointer;
    padding: 0.25rem 0;
    transition: color 0.2s ease;
}

.filter-group label:hover {
    color: var(--primary-color, #1d6316);
}

/* Checkbox styling */
.filter-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 0.75rem;
    cursor: pointer;
    accent-color: var(--primary-color, #1d6316);
    flex-shrink: 0;
}

/* Price range inputs */
.price-range {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.price-range span {
    font-family: var(--main-font-family, 'Alumni Sans SC', 'Roboto', sans-serif);
    color: var(--text-color, #2b6924);
    font-size: 1.134rem;
}

/* Filter inputs */
.filter-input {
    width: 100%;
    max-width: 100px;
    padding: 0.5rem;
    border: 1px solid var(--border-color, #c0c0c0);
    border-radius: 0.25rem;
    font-family: var(--main-font-family, 'Alumni Sans SC', 'Roboto', sans-serif);
    font-size: 1.134rem;
    color: var(--text-color, #2b6924);
    background: var(--background-color, #dbdbdb);
    box-sizing: border-box;
}

.filter-input:focus {
    outline: none;
    border-color: var(--primary-color, #1d6316);
    box-shadow: 0 0 0 2px rgba(29, 99, 22, 0.2);
}

/* Specification filter groups */
.spec-filter-group {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--background-color, #dbdbdb);
    border-radius: 0.5rem;
    border: 1px solid var(--border-color, #c0c0c0);
}

.spec-filter-label {
    display: block;
    margin-bottom: 0.5rem;
}

.spec-filter-label strong {
    font-family: var(--main-font-family2, 'Science Gothic', 'Roboto', sans-serif);
    font-size: 1.197rem;
    color: var(--primary-color, #1d6316);
}

/* Range inputs for numeric specs */
.range-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.range-inputs span {
    font-family: var(--main-font-family, 'Alumni Sans SC', 'Roboto', sans-serif);
    color: var(--text-color, #2b6924);
    font-size: 1.071rem;
}

.range-input-min,
.range-input-max {
    flex: 1;
    min-width: 80px;
    max-width: 90px;
}

/* Spec checkboxes container */
.spec-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-height: 200px;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.spec-checkboxes::-webkit-scrollbar {
    width: 6px;
}

.spec-checkboxes::-webkit-scrollbar-track {
    background: var(--background-color3, #e4e3e3);
    border-radius: 3px;
}

.spec-checkboxes::-webkit-scrollbar-thumb {
    background: var(--primary-color, #1d6316);
    border-radius: 3px;
}

.spec-checkbox-label {
    display: flex;
    align-items: center;
    font-family: var(--main-font-family, 'Alumni Sans SC', 'Roboto', sans-serif);
    font-size: 1.134rem;
    color: var(--text-color, #2b6924);
    cursor: pointer;
    padding: 0.2rem 0;
}

.spec-checkbox-label:hover {
    color: var(--primary-color, #1d6316);
}

.spec-checkbox-label input[type="checkbox"] {
    margin-right: 0.5rem;
}

/* Product options filter groups */
.option-filter-group {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--background-color, #dbdbdb);
    border-radius: 0.5rem;
    border: 1px solid var(--border-color, #c0c0c0);
}

.option-filter-label {
    display: block;
    margin-bottom: 0.5rem;
}

.option-filter-label strong {
    font-family: var(--main-font-family2, 'Science Gothic', 'Roboto', sans-serif);
    font-size: 1.197rem;
    color: var(--primary-color, #1d6316);
}

.option-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-height: 200px;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.option-checkboxes::-webkit-scrollbar {
    width: 6px;
}

.option-checkboxes::-webkit-scrollbar-track {
    background: var(--background-color3, #e4e3e3);
    border-radius: 3px;
}

.option-checkboxes::-webkit-scrollbar-thumb {
    background: var(--primary-color, #1d6316);
    border-radius: 3px;
}

.option-checkbox-label {
    display: flex;
    align-items: center;
    font-family: var(--main-font-family, 'Alumni Sans SC', 'Roboto', sans-serif);
    font-size: 1.134rem;
    color: var(--text-color, #2b6924);
    cursor: pointer;
    padding: 0.2rem 0;
}

.option-checkbox-label:hover {
    color: var(--primary-color, #1d6316);
}

.option-checkbox-label input[type="checkbox"] {
    margin-right: 0.5rem;
}

/* Filter action buttons */
.btn-apply-filters,
.btn-clear-filters {
    width: 100%;
    padding: 0.75rem 1rem;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    border: none;
    border-radius: 0.5rem;
    font-family: var(--main-font-family2, 'Science Gothic', 'Roboto', sans-serif);
    font-size: 1.26rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: block;
    text-align: center;
    box-sizing: border-box;
}

.btn-apply-filters {
    background: var(--primary-color, #1d6316);
    color: var(--text-color4, #ffffff);
    box-shadow: 0 2px 4px var(--shadow-color, rgba(0, 0, 0, 0.6));
}

.btn-apply-filters:hover {
    background: var(--highlight-color, #2e8a25);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow-color, rgba(0, 0, 0, 0.8));
}

.btn-clear-filters {
    background: var(--background-color3, #e4e3e3);
    color: var(--text-color, #2b6924);
    border: 1px solid var(--border-color, #c0c0c0);
}

.btn-clear-filters:hover {
    background: var(--background-color, #dbdbdb);
    border-color: var(--primary-color, #1d6316);
    color: var(--primary-color, #1d6316);
}

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

@media (max-width: 768px) {
    .filter-panel {
        width: 100%;
        min-width: 100%;
        position: relative;
        top: 0;
        max-height: none;
        margin-bottom: 1.5rem;
        border-radius: 0.5rem;
    }

    .filter-group-content {
        max-height: none !important;
    }

    .filter-group-content.collapsed {
        max-height: 0 !important;
        overflow: hidden;
    }
}

@media (max-width: 480px) {
    .filter-panel {
        padding: 1rem;
    }

    .filter-panel > h3 {
        font-size: 1.575rem;
        margin-bottom: 1rem;
    }

    .filter-group-header h4 {
        font-size: 1.26rem;
    }

    .range-inputs {
        flex-direction: column;
        align-items: stretch;
    }

    .range-input-min,
    .range-input-max {
        max-width: 100%;
    }
}
