:root {
    --primary: #65C15C;
    --primary-light: #eef8ec;
    --accent-color: #65C15C;
    --accent-glow: rgba(101, 193, 92, 0.28);
    --text-dark: #1e2432;
    --text-muted: #53647a;
    --text-light: #8b9bb4;
    --bg-main: #f8fafc;
    --surface: #ffffff;
    --border: #e2e8f0;
    --radius-xl: 32px;
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-pill: 100px;
    --shadow-soft: 0 16px 40px rgba(30, 36, 50, 0.08);
    --shadow-floating: 0 24px 60px rgba(101, 193, 92, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Manrope', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.page-background {
    position: fixed;
    top: -20vh;
    left: 50%;
    transform: translateX(-50%);
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle at 50% 0%, var(--accent-glow) 0%, transparent 60%);
    z-index: -1;
    pointer-events: none;
    transition: background 0.6s ease;
}

/* ================= ОФИЦИАЛЬНАЯ ШАПКА ================= */
.official-header {
    position: relative;
    top: 0;
    z-index: 100;
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 20px rgba(30, 36, 50, 0.05);
}

.main-header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
}

.school-brand {
    display: flex;
    align-items: center;
    gap: 18px;
    text-decoration: none;
    color: inherit;
}

.school-logo {
    width: 85px;
    height: 85px;
    object-fit: contain;
    flex-shrink: 0;
}

.school-text strong {
    display: block;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    color: #212529;
    margin-bottom: 4px;
    max-width: 550px;
}

.school-text span {
    font-size: 13px;
    color: #8b9bb4;
}

.header-actions {
    flex-shrink: 0;
}

.top-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: var(--primary);
    font-weight: 700;
    font-size: 13px;
    padding: 8px 18px;
    border-radius: var(--radius-pill);
    background: var(--primary-light);
    border: 1px solid rgba(101, 193, 92, 0.3);
    transition: all 0.3s ease;
}

.top-nav-link:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 4px 12px var(--accent-glow);
    transform: translateY(-1px);
}

/* ================= HERO И ПОИСК ================= */
.hero {
    padding: 32px 24px 32px;
    text-align: center;
}

.hero-content {
    max-width: 1180px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 38px;
    font-weight: 800;
    line-height: 1.18;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
    color: var(--text-dark);
}

.hero p {
    font-size: 17px;
    color: var(--text-muted);
    margin-bottom: 40px;
}

.search-wrapper {
    display: flex;
    background: var(--surface);
    border-radius: var(--radius-pill);
    padding: 8px;
    box-shadow: var(--shadow-floating);
    border: 1px solid var(--border);
    align-items: center;
}

.search-box {
    flex: 1.6;
    min-width: 200px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 20px;
    width: 20px;
    color: var(--accent-color);
    transition: color 0.3s ease;
}

.search-box input,
.filter-box select {
    width: 100%;
    border: none;
    outline: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    background: transparent;
    color: var(--text-dark);
}

.search-box input {
    padding: 16px 12px 16px 50px;
    font-size: 15px;
    font-weight: 500;
}

.filter-box {
    flex: 1;
    min-width: 135px;
    border-left: 1px solid var(--border);
    padding: 0 12px;
    position: relative;
    display: flex;
    align-items: center;
}

.btn-search {
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: var(--radius-pill);
    padding: 16px 28px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.btn-search:hover {
    filter: brightness(0.95);
    transform: translateY(-1px);
}

/* ================= НАВИГАЦИЯ И ВКЛАДКИ С ИКОНКАМИ КАТЕГОРИЙ ================= */
.categories-nav {
    width: calc(100% - 48px);
    max-width: 1180px;
    margin: 0 auto 36px;
}

.tabs-container {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    padding: 4px 0 14px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    justify-content: flex-start;
}

.tabs-container::-webkit-scrollbar,
.subtabs-container::-webkit-scrollbar {
    display: none;
}

.tab {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 9px 20px 9px 12px;
    border-radius: var(--radius-pill);
    font-size: 14px;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

.tab[data-direction="all"] {
    padding: 11px 22px;
}

/* Цветной бейдж-иконка внутри кнопки категории (в едином стиле с карточками) */
.tab-icon-badge {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.25s ease;
}

.tab-icon-badge svg {
    width: 16px;
    height: 16px;
}

.tab.active .tab-icon-badge {
    background: rgba(255, 255, 255, 0.24) !important;
    color: #ffffff !important;
}

.tab:hover {
    border-color: var(--accent-color);
    color: var(--text-dark);
    transform: translateY(-2px);
}

.tab.active {
    background: var(--accent-color);
    color: #ffffff;
    border-color: var(--accent-color);
    box-shadow: 0 10px 24px var(--accent-glow);
    transform: translateY(-2px);
}

.tab.tab-popular {
    background: #fffaf2;
    border-color: #f0e4d1;
    color: #b1864b;
    box-shadow: 0 4px 12px rgba(173, 120, 45, 0.04);
}

.tab.tab-popular .tab-icon-badge {
    background: #ffedd5;
    color: #ea580c;
}

.tab.tab-popular:hover {
    background: #fff5e4;
    border-color: #e6cda8;
    color: #946928;
}

.tab.tab-popular.active {
    background: linear-gradient(135deg, #ffb545, #f59e0b);
    border-color: #f59e0b;
    color: #fff;
    box-shadow: 0 8px 22px rgba(245, 158, 11, 0.28);
}

.open-filter-row {
    display: flex;
    align-items: center;
    padding: 10px 0 12px;
}

.open-filter-toggle {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    padding: 4px 0;
}

.open-filter-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 28px;
    flex-shrink: 0;
    border-radius: 100px;
    background: #dce3eb;
    transition: background 0.25s ease;
}

.open-filter-switch::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 4px;
    left: 4px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.12);
    transition: transform 0.25s ease;
}

.open-filter-toggle.active .open-filter-switch {
    background: var(--primary);
}

.open-filter-toggle.active .open-filter-switch::after {
    transform: translateX(20px);
}

.open-filter-toggle.active {
    color: var(--text-dark);
}

.subtabs-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 24px 8px;
    justify-content: center;
}

.subtab {
    flex: 0 0 auto;
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    transition: all 0.25s ease;
}

.subtab:hover {
    border-color: var(--accent-color);
    color: var(--text-dark);
    background: var(--surface);
}

.subtab.active {
    background: var(--accent-color);
    color: #ffffff;
    border-color: var(--accent-color);
    box-shadow: 0 4px 12px var(--accent-glow);
}

.subtab.hidden {
    display: none;
}

@media (min-width: 1200px) {
    .tabs-container {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

/* ================= КАРТОЧКИ КУРСОВ ================= */
.courses-container {
    max-width: 1280px;
    width: 100%;
    margin: 0 auto 80px;
    padding: 0 24px;
    flex-grow: 1;
}

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

.courses-error {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: var(--text-light);
}

.courses-empty {
    grid-column: 1 / -1;
    margin: 4px 0 38px;
    padding: 28px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text-muted);
    text-align: center;
    font-weight: 600;
}

.courses-empty[hidden] {
    display: none;
}

.course-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 24px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    position: relative;
    min-width: 0;
    box-shadow: 0 12px 40px rgba(30, 36, 50, 0.04);
}

.course-card:hover {
    border-color: var(--accent-color);
    box-shadow: 0 24px 60px var(--accent-glow);
    transform: translateY(-6px);
}

.c-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 18px;
    gap: 12px;
}

.c-icon {
    width: 58px;
    height: 58px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.course-card:hover .c-icon {
    transform: scale(1.06) rotate(-2deg);
}

.c-icon svg {
    width: 28px;
    height: 28px;
}

/* Общие цветовые темы для иконок на карточках и во вкладках */
.theme-sport {
    background: linear-gradient(135deg, #eefbf3 0%, #d8f5e3 100%);
    color: #16a34a;
}
.theme-art {
    background: linear-gradient(135deg, #fdf2f8 0%, #fce7f3 100%);
    color: #db2777;
}
.theme-tech {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: #2563eb;
}
.theme-science {
    background: linear-gradient(135deg, #f0fdfa 0%, #ccfbf1 100%);
    color: #0d9488;
}
.theme-social {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    color: #d97706;
}
.theme-tour {
    background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
    color: #7c3aed;
}

.c-tags {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: flex-end;
    gap: 8px;
}

.c-tag-statuses,
.c-tag-audience {
    width: 100%;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.c-tag-popular {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 800;
    background: linear-gradient(135deg, #FF6B81, #FF3E5C);
    color: white;
    box-shadow: 0 4px 12px rgba(255, 107, 129, 0.25);
}

.c-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    font-size: 12px;
    font-weight: 700;
}

.c-status .status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.c-status.open {
    background: var(--primary-light);
    color: #2f8527;
}
.c-status.open .status-dot { background: #65C15C; }

.c-status.closed {
    background: #fef2f2;
    color: #dc2626;
}
.c-status.closed .status-dot { background: #ef4444; }

.c-tag-age,
.c-tag-grade {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    padding: 5px 11px;
    border-radius: var(--radius-pill);
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
}

.c-tag-age {
    background: #eef8ec;
    border-color: #dcefd9;
    color: #438d3b;
}

.c-title {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 6px;
    line-height: 1.3;
    color: var(--text-dark);
    overflow-wrap: anywhere;
}

.c-subtitle {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 18px;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

/* Ровная сетка инфо-блока (адрес, дни, время, цена) в едином стиле */
.c-info-list {
    display: flex;
    flex-direction: column;
    gap: 11px;
    padding: 16px 18px;
    background: #f8fafc;
    border: 1px solid #eef2f6;
    border-radius: 18px;
    margin-bottom: 20px;
    flex-grow: 1;
}

.c-info-item {
    display: grid;
    grid-template-columns: 20px 1fr;
    align-items: start;
    gap: 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.c-info-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    margin-top: 1px;
    flex-shrink: 0;
}

.c-info-icon svg {
    width: 18px;
    height: 18px;
}

.c-info-content {
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
}

.c-info-label {
    color: var(--text-muted);
    font-weight: 600;
    min-width: 52px;
}

.c-info-value {
    color: var(--text-dark);
    font-weight: 700;
}

.c-info-price .c-info-icon {
    color: #2f8527;
}

.c-info-price .c-info-content {
    color: var(--text-dark);
    font-weight: 800;
    font-size: 14.5px;
}

.c-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: auto;
}

.btn {
    width: 100%;
    padding: 13px 16px;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    text-align: center;
    border: none;
    transition: 0.3s;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-outline {
    background: var(--bg-main);
    color: var(--text-dark);
    border: 1px solid var(--border);
}
.btn-outline:hover {
    background: var(--text-dark);
    color: white;
    border-color: var(--text-dark);
}

.btn-primary {
    background: var(--accent-color);
    color: white;
    box-shadow: 0 6px 18px var(--accent-glow);
}
.btn-primary:hover {
    filter: brightness(0.95);
    transform: translateY(-2px);
}

.btn-disabled {
    background: #f1f5f9;
    color: var(--text-light);
    cursor: not-allowed;
    pointer-events: none;
}

/* ================= ПОДВАЛ ================= */
.minimal-footer {
    border-top: 1px solid var(--border);
    background: var(--surface);
    padding: 40px 24px;
    margin-top: auto;
}

.footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.f-left strong {
    font-size: 16px;
    font-weight: 800;
    display: block;
    margin-bottom: 6px;
    color: var(--text-dark);
}

.f-left p,
.f-right p {
    font-size: 14px;
    color: var(--text-muted);
}

.f-right {
    display: flex;
    align-items: center;
    gap: 28px;
}

.f-contacts { text-align: right; }

.phone-link {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-dark);
    text-decoration: none;
    display: block;
    margin-bottom: 4px;
}

.admin-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 13px;
}

/* ================= МОДАЛЬНОЕ ОКНО («ПОДРОБНЕЕ») ================= */
.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 24px;
    background: rgba(30, 36, 50, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

.drawer-overlay.active {
    opacity: 1;
    visibility: visible;
}

.drawer-content {
    width: 100%;
    max-width: 620px;
    max-height: 88vh;
    background: var(--surface);
    border-radius: var(--radius-xl);
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.22);
    transform: scale(0.94) translateY(12px);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.drawer-overlay.active .drawer-content {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.drawer-header {
    padding: 28px 32px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.drawer-header-main {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.d-category {
    font-size: 12px;
    font-weight: 800;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
    display: block;
}

.drawer-header h2 {
    font-size: 22px;
    font-weight: 800;
    line-height: 1.25;
}

.drawer-close {
    background: var(--bg-main);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: 0.2s;
    flex-shrink: 0;
}

.drawer-close:hover {
    background: #e2e8f0;
    color: var(--text-dark);
}

.drawer-body {
    padding: 26px 32px;
    overflow-y: auto;
    flex-grow: 1;
}

.d-blocks {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 26px;
}

.d-block {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
    background: var(--bg-main);
    border-radius: 18px;
    border: 1px solid var(--border);
}

.d-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, #eefbf3 0%, #d8f5e3 100%);
    color: #16a34a;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.d-icon svg {
    width: 22px;
    height: 22px;
}

.d-block > div:last-child {
    min-width: 0;
    flex: 1;
}

.d-block span {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.d-block strong {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-dark);
    line-height: 1.38;
    display: block;
    overflow-wrap: anywhere;
}

/* Единый стиль отображения Дней и Времени внутри модального окна */
.detail-schedule {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.detail-schedule-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-size: 13.5px;
    line-height: 1.4;
}

.detail-schedule-label {
    color: var(--text-muted);
    font-weight: 600;
    flex-shrink: 0;
}

.detail-schedule-val {
    color: var(--text-dark);
    font-weight: 800;
}

.highlight-block {
    background: var(--primary-light);
    border-color: rgba(101, 193, 92, 0.25);
}

.highlight-block .d-icon {
    background: #ffffff;
    color: #16a34a;
}

.highlight-block strong {
    color: #2f8527;
}

.d-description h3 {
    font-size: 17px;
    font-weight: 800;
    margin-bottom: 10px;
}

.d-description p {
    font-size: 15px;
    line-height: 1.65;
    color: var(--text-muted);
    white-space: pre-line;
}

.drawer-footer {
    padding: 20px 32px;
    background: var(--surface);
    border-top: 1px solid var(--border);
}

/* ================= МУЛЬТИВЫБОР В ШАПКЕ ================= */
.filter-box-multi { position: relative; }

.multi-filter-trigger {
    width: 100%;
    min-height: 48px;
    padding: 12px 2px 12px 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font: 600 14px 'Manrope', sans-serif;
    color: var(--text-dark);
    background: transparent;
    border: 0;
    text-align: left;
    cursor: pointer;
}

.multi-filter-summary {
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.multi-filter-chevron {
    flex-shrink: 0;
    width: 9px;
    height: 9px;
    margin: -5px 5px 0 2px;
    border: solid var(--text-muted);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
}

.filter-box-multi.menu-open .multi-filter-chevron {
    transform: rotate(225deg);
    margin-top: 4px;
}

.filter-box-multi.has-selection .multi-filter-trigger { color: #35942d; }

.multi-filter-menu {
    position: absolute;
    z-index: 300;
    left: 0;
    top: calc(100% + 12px);
    min-width: 255px;
    max-width: calc(100vw - 32px);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 10px;
    box-shadow: 0 20px 48px rgba(30, 36, 50, 0.15);
}

#ageFilter .multi-filter-menu,
#gradeFilter .multi-filter-menu { min-width: 220px; }
#dayFilter .multi-filter-menu { left: auto; right: 0; }
.multi-filter-menu[hidden] { display: none; }

.multi-filter-menu-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 5px 8px 10px;
}

.multi-filter-menu-head strong { font-size: 13px; font-weight: 800; }

.multi-filter-clear {
    border: 0;
    background: transparent;
    color: #408f39;
    font: 700 12px 'Manrope', sans-serif;
    cursor: pointer;
    padding: 4px;
}

.multi-filter-options {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 260px;
    overflow-y: auto;
}

.multi-filter-option {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 10px 8px;
    cursor: pointer;
    border-radius: 10px;
}

.multi-filter-option:hover { background: var(--primary-light); }
.multi-filter-option:has(input:checked) {
    background: var(--primary-light);
    color: #2f8527;
}

.multi-filter-option input {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    accent-color: var(--primary);
    cursor: pointer;
}

/* ================= АДАПТИВ ================= */
@media (max-width: 1024px) {
    .school-text strong { font-size: 14px; }
    .search-wrapper {
        flex-wrap: wrap;
        border-radius: var(--radius-lg);
        padding: 10px;
        gap: 6px;
    }
    .search-box {
        flex: 1 1 100%;
        border-bottom: 1px solid var(--border);
    }
    .filter-box {
        flex: 1 1 calc(50% - 12px);
        border-left: none;
        padding: 0 10px;
    }
    .btn-search {
        width: 100%;
        margin-top: 4px;
    }
}

@media (max-width: 768px) {
    .main-header-container {
        flex-wrap: wrap;
        padding: 12px 16px;
        gap: 0;
    }
    .header-actions {
        width: 100%;
        display: flex;
        justify-content: flex-end;
        order: -1;
        margin-bottom: 12px;
        padding-bottom: 12px;
        border-bottom: 1px solid var(--border);
    }
    .school-brand { width: 100%; }
    .school-text strong { font-size: 12px; }
    .school-logo { width: 60px; height: 60px; }
    .school-text span { font-size: 11px; }
    .hero h1 { font-size: 26px; }
    .hero { padding: 32px 16px; }
    .categories-nav { width: calc(100% - 32px); }

    .search-wrapper {
        flex-direction: column;
        border-radius: var(--radius-lg);
        padding: 8px;
        gap: 0;
    }
    .search-box { width: 100%; border-bottom: none; }
    .search-box input { padding: 14px 16px 14px 48px; }
    .filter-box {
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--border);
        padding: 0 12px;
    }
    .filter-box-multi {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }
    .filter-box-multi .multi-filter-menu,
    #ageFilter .multi-filter-menu,
    #gradeFilter .multi-filter-menu,
    #dayFilter .multi-filter-menu {
        position: static;
        left: auto;
        right: auto;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        margin: 4px 0 12px;
        box-shadow: 0 8px 22px rgba(30, 36, 50, 0.08);
    }
    .btn-search { width: 100%; margin-top: 6px; }
    .subtabs-container {
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
        -webkit-overflow-scrolling: touch;
    }
    .courses-grid { grid-template-columns: 1fr; }
    .footer-inner { flex-direction: column; gap: 24px; text-align: center; }
    .f-right { flex-direction: column; gap: 16px; }
    .f-contacts { text-align: center; }
    .drawer-overlay { padding: 12px; }
    .drawer-content { max-height: 92vh; border-radius: var(--radius-lg); }
    .drawer-header { padding: 22px 20px 16px; }
    .drawer-body { padding: 20px; }
    .d-blocks { grid-template-columns: 1fr; }
    .drawer-footer { padding: 16px 20px; }
}

/* ================= FAQ (ВОПРОСЫ И ОТВЕТЫ) ================= */
.faq-section {
    max-width: 820px;
    margin: 0 auto 80px;
    padding: 0 24px;
    width: 100%;
}

.faq-title {
    font-size: 34px;
    font-weight: 800;
    margin-bottom: 12px;
    text-align: center;
    color: var(--text-dark);
    letter-spacing: -0.02em;
}

.faq-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 36px;
    font-size: 16px;
    font-weight: 500;
}

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

.faq-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: 0 8px 28px rgba(30, 36, 50, 0.04);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.faq-item:hover {
    border-color: var(--accent-color);
    box-shadow: 0 14px 36px var(--accent-glow);
    transform: translateY(-2px);
}

.faq-item[open] {
    border-color: var(--accent-color);
    box-shadow: 0 16px 40px var(--accent-glow);
}

.faq-item summary {
    padding: 22px 24px;
    font-size: 16.5px;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    color: var(--text-dark);
    user-select: none;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary-light);
    color: var(--primary);
    font-size: 22px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.3s ease, background 0.3s ease, color 0.3s ease;
    line-height: 1;
}

.faq-item[open] summary {
    color: #2f8527;
}

.faq-item[open] summary::after {
    transform: rotate(45deg);
    background: var(--primary);
    color: #ffffff;
}

.faq-item p {
    padding: 0 24px 24px;
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.65;
    border-top: 1px solid #f1f5f9;
    padding-top: 16px;
    margin: 0 24px;
    padding-left: 0;
    padding-right: 0;
}

@media (max-width: 768px) {
    .faq-title { font-size: 26px; }
    .faq-item summary { padding: 18px 20px; font-size: 15px; }
    .faq-item p { margin: 0 20px; font-size: 14px; padding-bottom: 20px; }
}

/* ================= ЯНДЕКС.КАРТА ПРИ НАВЕДЕНИИ НА АДРЕС ================= */
.c-address-link {
    color: var(--text-dark);
    text-decoration: none;
    border-bottom: 1px dashed rgba(101, 193, 92, 0.65);
    transition: color 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
    display: inline;
}

.c-address-link:hover {
    color: var(--primary);
    border-bottom-style: solid;
    border-bottom-color: var(--primary);
}

.ymap-popover {
    position: fixed;
    z-index: 2500;
    width: 300px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.22);
    padding: 10px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px) scale(0.97);
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
    pointer-events: none;
}

.ymap-popover.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.ymap-popover-frame-wrap {
    width: 100%;
    height: 200px;
    border-radius: 14px;
    overflow: hidden;
    background: #f1f5f9;
    position: relative;
    border: 1px solid #e2e8f0;
}

.ymap-popover-frame {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.ymap-popover-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 6px 4px;
}

.ymap-popover-addr {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.3;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ymap-popover-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 100px;
    background: #fc3f1d;
    color: #ffffff;
    font-size: 11.5px;
    font-weight: 800;
    text-decoration: none;
    transition: filter 0.2s ease, transform 0.2s ease;
}

.ymap-popover-btn:hover {
    filter: brightness(0.93);
    transform: translateY(-1px);
}

/* === КАРУСЕЛЬ ФОТОГРАФИЙ В КАРТОЧКЕ КУРСА === */
.gallery-container {
    position: relative;
    margin-bottom: 20px;
    border-radius: 18px;
    overflow: hidden;
    background: #0f172a;
    border: 1px solid #e2e8f0;
    user-select: none;
}

.d-gallery {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none; /* Firefox — прячем системный скроллбар */
    -ms-overflow-style: none;
}

.d-gallery::-webkit-scrollbar {
    display: none; /* Chrome/Safari/Edge — прячем системный скроллбар */
}

.d-gallery img {
    flex: 0 0 100%;
    width: 100%;
    height: 300px; /* Единая фиксированная высота для всех курсов */
    object-fit: cover; /* Красиво заполняет кадр без сплющивания */
    object-position: center;
    scroll-snap-align: center;
    display: block;
    background: #0f172a;
}

/* Круглые парящие стрелки влево/вправо */
.gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(15, 23, 42, 0.1);
    color: #1e2432;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
    transition: transform 0.15s ease, background 0.15s ease;
    padding: 0;
}

.gallery-arrow:hover {
    background: #ffffff;
    transform: translateY(-50%) scale(1.07);
}

.gallery-arrow:active {
    transform: translateY(-50%) scale(0.96);
}

.gallery-arrow.prev {
    left: 12px;
}

.gallery-arrow.next {
    right: 12px;
}

@media (max-width: 560px) {
    .d-gallery img {
        height: 230px;
    }
    .gallery-arrow {
        width: 34px;
        height: 34px;
    }
}