.purifiers-page {
    margin-top: 70px;
    min-height: calc(100vh - 70px);
    background: #f8f9fa;
}

.purifiers-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 20px;
    align-items: start;
}

.filters-sidebar {
    background: white;
    border-radius: 12px;
    padding: 24px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    position: sticky;
    top: 90px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

.filters-sidebar::-webkit-scrollbar {
    width: 6px;
}

.filters-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.filters-sidebar::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 3px;
}

.filters-sidebar::-webkit-scrollbar-thumb:hover {
    background-color: #aaa;
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eee;
}

.filters-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.clear-filters-btn {
    background: none;
    border: none;
    color: #007AFF;
    font-size: 14px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.clear-filters-btn:hover {
    background: #f0f4ff;
}

.filter-group {
    margin-bottom: 24px;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-group h3 {
    font-size: 14px;
    font-weight: 600;
    color: #555;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.filter-option:hover {
    background: #f5f5f5;
}

.filter-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #007AFF;
    cursor: pointer;
}

.filter-option span {
    font-size: 14px;
    color: #444;
}

.purifiers-content {
    min-width: 0;
    padding-top: 0;
    margin-top: 0;
}

.purifiers-intro {
    font-size: 15px;
    color: #888;
    margin: 6px 0 16px 0;
    line-height: 1.6;
}

.purifiers-header {
    margin-bottom: 24px;
    padding: 0px 24px 0 0;
    background: transparent;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 16px;
}

.purifiers-header-left {
    flex: 1;
}

.purifiers-header-right {
    flex-shrink: 0;
}

.purifiers-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #222;
    margin: 0 0 8px 0;
    line-height: 1;
}

.sort-select {
    padding: 10px 16px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: white;
    color: #333;
    cursor: pointer;
    min-width: 180px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.sort-select:hover {
    border-color: #007AFF;
}

.sort-select:focus {
    outline: none;
    border-color: #007AFF;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.results-count {
    color: #666;
    font-size: 16px;
}

.purifiers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.purifier-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

.purifier-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.purifier-card-image-link {
    display: block;
    cursor: pointer;
}

.purifier-card-image-link:hover .purifier-card-image {
    opacity: 0.85;
}

.purifier-card-image {
    width: 100%;
    height: 200px;
    object-fit: contain;
    background: #f8f8f8;
    padding: 16px;
    transition: opacity 0.2s ease;
}

.purifier-card-content {
    padding: 20px;
}

.purifier-card-name {
    font-size: 16px;
    font-weight: 600;
    color: #222;
    margin-bottom: 8px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.purifier-card-manufacturer {
    font-size: 13px;
    color: #888;
    margin-bottom: 12px;
}

.purifier-card-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.spec-tag {
    background: #f0f4ff;
    color: #007AFF;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 500;
}

.purifier-card-price {
    font-size: 22px;
    font-weight: 700;
    color: #222;
    margin-bottom: 8px;
}

.purifier-card-filter-cost {
    font-size: 13px;
    color: #666;
    margin-bottom: 16px;
}

.purifier-card-buttons {
    display: flex;
    gap: 10px;
}

.btn-learn-more {
    flex: 1;
    padding: 10px 16px;
    background: #f0f0f0;
    color: #333;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background 0.2s;
}

.btn-learn-more:hover {
    background: #e0e0e0;
}

.btn-buy-now {
    flex: 1;
    padding: 10px 16px;
    background: #007AFF;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background 0.2s;
}

.btn-buy-now:hover {
    background: #0056b3;
}

.loading-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f0f0f0;
    border-top-color: #007AFF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-results h3 {
    font-size: 20px;
    margin-bottom: 12px;
    color: #333;
}

.quiz-promotion {
    background: #007AFF;
    border-radius: 12px;
    padding: 3rem 2rem;
    margin: 3rem 0;
    text-align: center;
    color: white;
}

.quiz-promo-content h3 {
    font-size: 1.75rem;
    font-weight: bold;
    margin-bottom: 1rem;
    color: white;
}

.quiz-promo-content p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.6;
}

.quiz-promo-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2.5rem;
    background: white;
    color: #007AFF;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.quiz-promo-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    color: #0056b3;
}

/* Desktop: hide mobile-only elements */
.mobile-controls-bar {
    display: none;
}

.apply-filters-btn {
    display: none;
}

.filter-toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.2s;
}

.filter-toggle-btn:hover {
    border-color: #007AFF;
}

.mobile-filters-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.mobile-filters-overlay.active {
    display: block;
}


/* ── Mobile ─────────────────────────────────────────────── */
@media (max-width: 768px) {

    /* Switch to single column */
    .purifiers-container {
        grid-template-columns: 1fr;
        padding: 16px 16px 20px;
        /* extra top padding clears the fixed controls bar (~60px) */
        padding-top: 72px;
    }

    .purifiers-page {
        margin-top: 60px;
    }

    /* Hide the desktop sort dropdown */
    .purifiers-header-right {
        display: none;
    }

    .purifiers-header {
        flex-direction: column;
        gap: 4px;
        margin-bottom: 0;
        padding-right: 0;
    }

    .purifiers-header h1 {
        font-size: 22px;
        line-height: 1.3;
    }

    .purifiers-intro {
        font-size: 14px;
        line-height: 1.5;
        margin: 4px 0 6px;
    }

    /* Fixed controls bar — always visible while scrolling */
    /* top is set dynamically by JS to sit flush below the nav */
    .mobile-controls-bar {
        display: flex;
        gap: 10px;
        position: fixed;
        top: 60px; /* fallback; overridden by JS */
        left: 0;
        right: 0;
        z-index: 500;
        background: #f8f9fa;
        padding: 8px 16px;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    }

    .mobile-sort-select {
        flex: 1;
        min-width: unset;
        padding: 12px 36px 12px 16px;
        font-size: 15px;
        font-weight: 500;
    }

    .mobile-controls-bar .filter-toggle-btn {
        flex: 1;
        justify-content: center;
        padding: 12px 16px;
        font-size: 15px;
    }

    /* Active filter state on the Filters button */
    .mobile-controls-bar .filter-toggle-btn.filters-active {
        background: #e8f0fe;
        border-color: #007AFF;
        color: #007AFF;
    }

    .filter-badge {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        background: #007AFF;
        color: white;
        font-size: 12px;
        font-weight: 700;
        min-width: 20px;
        height: 20px;
        border-radius: 10px;
        padding: 0 5px;
        margin-right: 4px;
    }

    /* Sidebar: full-screen flex column on mobile */
    .filters-sidebar {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1000;
        border-radius: 0;
        max-height: none;
        overflow-y: hidden;
        padding: 0;
        flex-direction: column;
    }

    .filters-sidebar.mobile-active {
        display: flex;
    }

    /* Sticky Filters/Clear All header at the top of the open sidebar */
    .filters-header {
        flex-shrink: 0;
        background: white;
        padding: 20px 24px 16px;
        margin-bottom: 0;
        border-bottom: 1px solid #eee;
        /* no position:sticky needed — it's already at the top of the flex column */
    }

    /* Scrollable filter list */
    .filter-scroll-area {
        flex: 1;
        overflow-y: auto;
        padding: 16px 24px;
        -webkit-overflow-scrolling: touch;
    }

    /* Fix 3: larger, easier-to-tap filter options */
    .filter-scroll-area .filter-option {
        padding: 12px 10px;
        gap: 14px;
    }

    .filter-scroll-area .filter-option span {
        font-size: 16px;
    }

    .filter-scroll-area .filter-option input[type="checkbox"] {
        width: 22px;
        height: 22px;
    }

    .filter-scroll-area .filter-group h3 {
        font-size: 13px;
        margin-top: 8px;
        margin-bottom: 8px;
    }

    /* Show Results button pinned to the bottom of the sidebar */
    .apply-filters-btn {
        display: block;
        flex-shrink: 0;
        width: 100%;
        padding: 16px;
        background: #007AFF;
        color: white;
        border: none;
        border-radius: 0;
        font-size: 16px;
        font-weight: 600;
        cursor: pointer;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    }

    .purifiers-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .purifier-card-buttons {
        flex-direction: column;
    }
}

/* FAQ Section */
.purifiers-faq {
    background: white;
    border-top: 1px solid #e9ecef;
    padding: 60px 20px;
}

.purifiers-faq-inner {
    max-width: 860px;
    margin: 0 auto;
}

.purifiers-faq h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 36px;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.faq-item {
    padding: 28px 0;
    border-bottom: 1px solid #e9ecef;
}

.faq-item:first-child {
    border-top: 1px solid #e9ecef;
}

.faq-item h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 10px;
    line-height: 1.4;
}

.faq-item p {
    color: #555;
    line-height: 1.7;
    margin: 0 0 12px;
    font-size: 0.97rem;
}

.faq-item p:empty {
    display: none;
}

.faq-read-more {
    color: #007AFF;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
}

.faq-read-more:hover {
    text-decoration: underline;
}
