/* --- استایل‌های اختصاصی صفحه تست‌ها --- */
.tests-page-container {
    display: flex;
    gap: 2rem;
    padding: 2rem 2% 2rem;
    min-height: 100vh;
}

.sidebar {
    width: 300px;
    flex-shrink: 0;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--brand-box-radius, 5px);
    padding: 1.5rem;
    height: fit-content;
    position: sticky;
    top: 100px;
}

.filter-section {
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 1.5rem;
}

.filter-section:last-child { border-bottom: none; }

.filter-title {
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--filter-text, #3f4064);
    font-size: 1rem;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    align-items: center;
    color: var(--filter-text, #3f4064);
    font-size: 1rem;
}

.close-filter {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
}

.filter-input,
.filter-select {
    width: 100%;
    padding: 10px 12px;
    background: var(--surface-input-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    color: var(--filter-text, #3f4064);
    font-family: 'Vazirmatn', sans-serif;
    font-size: 1rem;
}

.filter-input:focus,
.filter-select:focus {
    border-color: var(--accent);
    background: var(--surface-input-focus-bg);
    outline: none;
}

.filter-select option {
    background: var(--brand-surface);
    color: var(--filter-text, #3f4064);
}

html[data-theme="dark"] .filter-select option {
    background: #151621;
    color: #fff;
}

.main-content { flex: 1; }

.search-bar-container {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    padding: 1rem;
    border-radius: var(--brand-box-radius, 5px);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 15px;
}

.search-bar-container input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
}

.search-bar-container input::placeholder {
    color: var(--text-muted);
}

.search-bar-container input:focus {
    outline: none;
}

.result-count {
    margin-bottom: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.test-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.test-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--brand-box-radius, 5px);
    padding: 1.5rem;
    transition: 0.3s;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 24px rgba(27, 37, 75, 0.06);
}

html[data-theme="dark"] .test-card {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.test-card:hover {
    transform: translateY(-5px);
    border-color: var(--brand-box-hover-border, #62b6ff);
    box-shadow: 0 10px 30px rgba(98, 182, 255, 0.15);
}

.test-card__media {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    margin-bottom: 1rem;
    border-radius: var(--brand-box-radius, 5px);
    overflow: hidden;
    background: var(--landing-surface-soft);
}

.test-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.test-card__media .test-img {
    width: 100%;
    height: 100%;
    font-size: 2.25rem;
}

.test-card-badges {
    position: absolute;
    top: 0.65rem;
    inset-inline-end: 0.65rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    justify-content: flex-end;
    align-items: flex-start;
    max-width: calc(100% - 1.3rem);
    z-index: 1;
}

.test-card__discount-badge {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 6px;
    background: #e63946;
    color: #fff;
    line-height: 1.4;
    white-space: nowrap;
}

.test-card__type-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 5px;
}

.type-individual {
    background: rgba(76, 201, 240, 0.14);
    color: var(--accent);
}

.type-org {
    background: rgba(67, 97, 238, 0.14);
    color: var(--primary);
}

.test-img {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    background: var(--landing-surface-soft);
    border-radius: var(--brand-box-radius, 5px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 0;
    color: var(--landing-primary);
}

.test-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-main);
    line-height: 1.55;
}

.test-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 10px 0;
    border-top: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
    padding: 5px 0;
}

.test-price {
    font-weight: 700;
    color: var(--success);
    margin-top: auto;
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.test-price__free {
    color: var(--success);
    margin-bottom: 0.35rem;
}

.test-price__report {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted, #adb5bd);
    line-height: 1.5;
}

.test-price__report .product-old-price,
.test-price__report .product-current-price {
    font-size: 0.9rem;
}

.test-card-link {
    margin-top: 15px;
    width: 100%;
    text-align: center;
    text-decoration: none;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 2rem;
}

.page-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    cursor: pointer;
    transition: 0.3s;
    text-decoration: none;
    font-weight: 600;
}

.page-btn:hover,
.page-btn.active {
    background: var(--brand-action, #62b6ff);
    color: #fff;
    border-color: var(--brand-action, #62b6ff);
}

.empty-state {
    grid-column: 1/-1;
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.mobile-filter-btn {
    display: none;
    width: 100%;
    margin-bottom: 1rem;
    justify-content: center;
    gap: 10px;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1999;
}

.sidebar-overlay.active {
    display: block;
}

@media (max-width: 992px) {
    .sidebar {
        display: none;
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        z-index: 2000;
        width: 80%;
        max-width: 300px;
        height: 100dvh;
        max-height: 100dvh;
        overflow-x: hidden;
        overflow-y: auto;
        border-radius: 0;
        border-right: none;
        border-top: none;
        border-bottom: none;
    }

    .sidebar.active {
        display: flex;
        flex-direction: column;
        animation: slideIn 0.3s ease;
    }

    .mobile-filter-btn {
        display: flex;
    }

    .tests-page-container {
        flex-direction: column;
    }
}

@keyframes slideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.seo-page__h1 {
    font-size: clamp(1.35rem, 2.5vw, 1.75rem);
    font-weight: 800;
    margin: 0 0 1rem;
    line-height: 1.45;
}

.tests-page-container .seo-page__h1 {
    color: var(--text-main);
}
