/* ============================================
   MODERN FILTER SIDEBAR STYLES
   ============================================ */

/* Main Layout */
.ph-main-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 32px;
    margin-top: 32px;
}

@media (max-width: 1024px) {
    .ph-main-layout {
        grid-template-columns: 1fr;
    }
}

/* Sidebar */
.ph-sidebar {
    position: relative;
}

.ph-sticky-sidebar {
    position: sticky;
    top: 20px;
}

.filter-sidebar {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    overflow: hidden;
}

/* Filter Header */
.filter-header {
    padding: 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: #111827;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.ph-clear-all {
    background: none;
    border: none;
    color: #3b82f6;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 6px;
    transition: background 0.2s;
}

.ph-clear-all:hover {
    background: #eff6ff;
}

.close-filters {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

/* Filter Content */
.filter-content {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.filter-content::-webkit-scrollbar {
    width: 6px;
}

.filter-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.filter-content::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.filter-content::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Filter Groups */
.filter-group {
    border-bottom: 1px solid #e5e7eb;
}

.filter-section-header {
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
}

.filter-section-header:hover {
    background: #f9fafb;
}

.filter-title-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-title {
    font-size: 15px;
    font-weight: 600;
    color: #374151;
    margin: 0;
}

.filter-badge {
    background: #3b82f6;
    color: white;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 500;
    line-height: 1.5;
}

.filter-chevron {
    transition: transform 0.3s;
    color: #9ca3af;
    flex-shrink: 0;
}

.filter-section-header.collapsed .filter-chevron {
    transform: rotate(-90deg);
}

.filter-section-content {
    padding: 0 24px 20px;
    display: block;
}

.filter-section-header.collapsed + .filter-section-content {
    display: none;
}

/* Search Box */
.ph-search-box {
    position: relative;
    margin-bottom: 16px;
}

.ph-search-input {
    width: 100%;
    padding: 10px 12px 10px 38px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
    font-family: inherit;
}

.ph-search-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
}

/* Filter Options */
.filter-options {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.filter-options.ph-custom-scroll {
    max-height: 280px;
    overflow-y: auto;
    padding-right: 8px;
}

.filter-options.ph-custom-scroll::-webkit-scrollbar {
    width: 6px;
}

.filter-options.ph-custom-scroll::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.filter-options.ph-custom-scroll::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.filter-options.ph-custom-scroll::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Checkbox Container */
.ph-checkbox-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    cursor: pointer;
    transition: color 0.2s;
    margin: 0;
}

.ph-checkbox-container:hover .ph-label-text {
    color: #3b82f6;
}

.ph-checkbox-container input[type="checkbox"] {
    display: none;
}

.ph-checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    position: relative;
    margin-right: 10px;
}

.ph-checkbox-container input[type="checkbox"]:checked + .ph-checkmark {
    background: #3b82f6;
    border-color: #3b82f6;
}

.ph-checkbox-container input[type="checkbox"]:checked + .ph-checkmark::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 12px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.ph-label-text {
    font-size: 14px;
    color: #374151;
    transition: color 0.2s;
    flex: 1;
}

.ph-count {
    font-size: 13px;
    color: #9ca3af;
    margin-left: auto;
    padding-left: 8px;
}

/* Radio Container (Budget) */
.budget-options {
    gap: 10px;
}

.ph-radio-container {
    position: relative;
    margin: 0;
    display: block;
}

.ph-radio-container input[type="radio"] {
    display: none;
}

.ph-radio-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    color: #374151;
    font-weight: 500;
}

.ph-radio-container input[type="radio"]:checked + .ph-radio-label {
    border-color: #3b82f6;
    background: #eff6ff;
    color: #3b82f6;
}

.ph-radio-label:hover {
    border-color: #3b82f6;
}

.ph-radio-circle {
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    transition: all 0.2s;
    position: relative;
    flex-shrink: 0;
}

.ph-radio-container input[type="radio"]:checked + .ph-radio-label .ph-radio-circle {
    border-color: #3b82f6;
}

.ph-radio-container input[type="radio"]:checked + .ph-radio-label .ph-radio-circle::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    background: #3b82f6;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Filter Actions */
.filter-actions {
    padding: 20px 24px;
    display: flex;
    gap: 12px;
    background: #f9fafb;
}

.ph-btn {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-family: inherit;
}

.ph-btn-reset {
    background: white;
    color: #374151;
    border: 2px solid #e5e7eb;
}

.ph-btn-reset:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.ph-btn-apply {
    background: #3b82f6;
    color: white;
}

.ph-btn-apply:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

/* Mobile Styles */
@media (max-width: 1024px) {
    .filter-sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 998;
    }
    
    .filter-sidebar-overlay.active {
        display: block;
    }
    
    .filter-sidebar {
        position: fixed;
        top: 0;
        right: -100%;
        width: 90%;
        max-width: 380px;
        height: 100vh;
        z-index: 999;
        transition: right 0.3s ease;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    }
    
    .filter-sidebar.active {
        right: 0;
    }
    
    .close-filters {
        display: block;
    }
    
    .filter-content {
        max-height: calc(100vh - 160px);
    }
}

/* Shop Header */
.ph-shop-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    flex-wrap: wrap;
}

.ph-title-section {
    flex: 1;
}

.ph-page-title {
    font-size: 32px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 8px 0;
}

.ph-breadcrumb-wrapper {
    font-size: 14px;
    color: #6b7280;
}

.ph-shop-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.ph-mobile-filter-toggle {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
}

.ph-mobile-filter-toggle:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

@media (max-width: 1024px) {
    .ph-mobile-filter-toggle {
        display: flex;
    }
}

/* Content Area */
.ph-content {
    min-height: 400px;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.filter-group {
    animation: fadeIn 0.3s ease;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .ph-shop-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .ph-shop-controls {
        justify-content: space-between;
    }
    
    .ph-page-title {
        font-size: 24px;
    }
}

/* Loading state */
.filter-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #9ca3af;
}

/* Empty state */
.no-results {
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
}

.no-results i {
    font-size: 48px;
    color: #d1d5db;
    margin-bottom: 16px;
}