/* Стили для страницы деталей курса */

/* Сетка наследуется из index.css через .main */
/* Дополнительные стили для фона */
.course-detail-page {
    max-width: 100%;
    margin: 30px auto;
    padding: 0;
    background: none;
    border-radius: 0;
    box-shadow: none;
    border: none;
    outline: none;
    position: relative;
    width: 100%;
    box-sizing: border-box;
    overflow: visible; /* Убираем ограничения overflow для sticky */
}

/* Переключатель реальных курсов в блоке «План подготовки». */
.course-plan-switcher {
    position: relative;
    z-index: 40;
    width: 100%;
    margin: 0 0 20px;
}

.course-plan-switcher__heading {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 32px;
}

.course-plan-switcher__title,
.course-plan-switcher__current,
.course-plan-switcher__toggle {
    margin: 0;
    font-family: var(--font-family-bold);
    font-size: var(--fs-h3);
    font-weight: 600;
    line-height: var(--lh-tight);
    letter-spacing: -0.01em;
    color: #000;
}

.course-plan-switcher__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 32px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.course-plan-switcher__toggle-icon {
    display: block;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    transition: transform 180ms ease;
}

.course-plan-switcher__toggle[aria-expanded="true"] .course-plan-switcher__toggle-icon {
    transform: rotate(180deg);
}

.course-plan-switcher__menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    z-index: 45;
    display: grid;
    grid-template-columns: 260px;
    box-sizing: border-box;
    width: 282px;
    max-width: calc(100vw - 32px);
    padding: 10px;
    border: 1px solid #e7e7e7;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.13);
    overflow: hidden;
    transform-origin: top left;
    transition: width 200ms ease, min-height 200ms ease, grid-template-columns 200ms ease;
}

.course-plan-switcher__menu.has-open-children {
    grid-template-columns: 260px 260px;
    width: 542px;
}

.course-plan-switcher__menu[hidden],
.course-plan-switcher__children[hidden] {
    display: none !important;
}

.course-plan-switcher__primary,
.course-plan-switcher__children {
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-sizing: border-box;
    width: 260px;
    padding: 0;
    border: 0;
    background: transparent;
}

.course-plan-switcher__group {
    position: static;
}

.course-plan-switcher__children {
    position: absolute;
    top: 10px;
    bottom: 10px;
    left: 280px;
    width: 250px;
    padding-left: 10px;
    border-left: 1px solid #e7e7e7;
    overflow-y: auto;
}

.course-plan-switcher__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-sizing: border-box;
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #111;
    font-family: var(--font-family-medium);
    font-size: 15px;
    line-height: 1.25;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.course-plan-switcher__row:hover,
.course-plan-switcher__row:focus-visible,
.course-plan-switcher__row.is-current,
.course-plan-switcher__row.is-selected,
.course-plan-switcher__row[aria-expanded="true"] {
    background: #f5f5f5;
    color: #000;
}

.course-plan-switcher__row:active {
    transform: scale(0.985);
}

.course-plan-switcher__row:focus-visible,
.course-plan-switcher__toggle:focus-visible {
    outline: 2px solid #111;
    outline-offset: 2px;
}

.course-plan-switcher__row-icon,
.course-plan-switcher__row > svg {
    display: block;
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    transition: transform 200ms ease;
}

.course-plan-switcher__row[aria-expanded="true"] .course-plan-switcher__row-icon {
    transform: rotate(90deg);
}

.course-plan-switcher__menu.is-opening {
    animation: course-plan-panel-in 200ms ease both;
}

.course-plan-switcher__menu.is-closing {
    animation: course-plan-panel-out 180ms ease both;
    pointer-events: none;
}

.course-plan-switcher__children.is-opening {
    animation: course-plan-children-in 200ms ease both;
}

.course-plan-switcher__children.is-closing {
    animation: course-plan-children-out 180ms ease both;
    pointer-events: none;
}

@keyframes course-plan-panel-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes course-plan-panel-out {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-4px); }
}

@keyframes course-plan-children-in {
    from { opacity: 0; transform: translateX(-6px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes course-plan-children-out {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(-6px); }
}

@media (max-width: 768px) {
    .course-plan-switcher {
        margin-bottom: 20px;
    }

    .course-plan-switcher__title,
    .course-plan-switcher__current,
    .course-plan-switcher__toggle {
        font-size: 1.125rem;
        line-height: 1.2;
    }

    .course-plan-switcher__heading {
        min-height: 28px;
    }

    .course-plan-switcher__toggle {
        min-height: 28px;
    }

    .course-plan-switcher__menu {
        position: absolute;
        top: calc(100% + 10px);
        left: 0;
        display: block;
        width: 50%;
        max-width: 100%;
        max-height: calc(100vh - 48px);
        padding: 6px;
        border-radius: 12px;
        transition: width 200ms ease, min-height 200ms ease;
    }

    .course-plan-switcher__menu.has-open-children {
        width: 100%;
    }

    .course-plan-switcher__primary {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        min-height: 0;
        max-height: calc(100vh - 48px);
        gap: 2px;
        overflow-y: auto;
        transition: width 200ms ease, padding-right 200ms ease;
    }

    .course-plan-switcher__menu.has-open-children .course-plan-switcher__primary {
        width: 50%;
        padding-right: 6px;
    }

    .course-plan-switcher__group {
        position: static;
    }

    .course-plan-switcher__children {
        position: absolute;
        top: 6px;
        bottom: 6px;
        left: 100%;
        width: 50%;
        max-width: none;
        min-width: 0;
        min-height: 0;
        margin: 0;
        padding: 0 0 0 6px;
        border-left: 1px solid #e7e7e7;
        overflow-x: hidden;
        overflow-y: auto;
        transition: left 200ms ease;
    }

    .course-plan-switcher__menu.has-open-children .course-plan-switcher__children {
        left: 50%;
    }

    .course-plan-switcher__row {
        min-height: 30px;
        padding: 5px 8px;
        border-radius: 7px;
        font-size: 11px;
    }

    .course-plan-switcher__children .course-plan-switcher__row {
        min-height: 28px;
        padding: 4px 8px;
        font-size: 10px;
        color: #333;
    }

}

@media (max-width: 480px) {
    .course-plan-switcher {
        margin-bottom: 8px !important;
    }

    .course-plan-switcher__heading {
        gap: 3px;
        min-height: 18px;
    }

    .course-plan-switcher__title,
    .course-plan-switcher__current,
    .course-plan-switcher__toggle {
        font-size: 0.6875rem;
        line-height: var(--lh-tight);
        letter-spacing: -0.01em;
    }

    .course-plan-switcher__toggle {
        min-height: 18px;
        gap: 3px;
    }

    .course-plan-switcher__toggle-icon {
        width: 13px;
        height: 13px;
        flex-basis: 13px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .course-plan-switcher__menu,
    .course-plan-switcher__children,
    .course-plan-switcher__row,
    .course-plan-switcher__toggle-icon,
    .course-plan-switcher__row-icon {
        animation: none !important;
        transition-duration: 0.01ms !important;
    }
}

/* Только для PC версии (больше 1024px) */
@media (min-width: 1025px) {
    .course-detail-page {
        max-width: 1500px;
        margin: 30px auto;
    }
}

/* Хлебные крошки: общие стили в deps/css/breadcrumbs.css (подключается в course_detail.html) */

/* Уменьшаем расстояние перед месяцем (level 4) */
.breadcrumb-separator-before-month {
    margin: 0 !important;
    padding: 0;
}

/* Двухколоночный layout */
.course-detail-layout {
    display: flex;
    flex-direction: row; /* Явно указываем направление для ПК версии */
    gap: 30px;
    align-items: flex-start; /* Выравниваем по верху, чтобы колонки не растягивались */
    border-radius: 0;
    box-shadow: none;
    border: none;
    outline: none;
    box-sizing: border-box;
    overflow: visible; /* Убираем ограничения overflow для sticky */
}

/* Левая колонка: информация о курсе */
.course-detail-left {
    flex: 1;
    min-width: 0;
    max-width: 100%;
    background: #fff;
    border-radius: 16px;
    box-shadow: none;
    border: 1px solid #e0e0e0;
    padding: 30px;
    box-sizing: border-box;
    height: auto;
    max-height: none;
    min-height: auto;
    overflow: visible;
}

/* Правая колонка: добавление в корзину (отдельно справа в ПК версии) */
.course-detail-right {
    flex-shrink: 0;
    width: 600px; /* Увеличено с 400px для лучшего размещения тарифов */
    align-self: flex-start; /* Выравниваем по верху, чтобы не растягивалась */
    display: flex;
    flex-direction: column;
    overflow: visible; /* Убираем ограничения overflow для sticky */
    position: relative; /* Для правильной работы sticky внутри */
}

.purchase-card {
    position: sticky;
    top: 30px;
    width: 100%; /* Занимает всю ширину course-detail-right */
    align-self: flex-start; /* Выравнивание по верху */
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    padding: 30px; /* Увеличено с 30px для лучшего размещения тарифов */
    box-shadow: none;
    box-sizing: border-box;
    max-height: calc(100vh - 60px); /* Максимальная высота с учетом отступа сверху */
    overflow-y: auto; /* Прокрутка, если содержимое не помещается */
    /* Sticky будет автоматически работать благодаря CSS */
}

/* Hero изображение */
.course-hero {
    width: 100%;
    margin-bottom: 30px;
}

.hero-image {
    width: 100%;
    height: 320px;
    object-fit: cover;
    border-radius: 10px;
}

/* Заголовок секции */
.section-title {
    font-size: var(--fs-h3); /* 22px */
    font-family: var(--font-family-bold);
    margin-bottom: 20px;
    color: #000;
    line-height: var(--lh-tight);
    letter-spacing: -0.01em;
}

/* Блок с фото и названием курса в самом верху */
.course-detail-page .course-main-info {
    display: flex !important;
    flex-direction: row !important;
    gap: 20px !important;
    margin-bottom: 30px !important;
    align-items: flex-start !important;
    padding-bottom: 30px !important;
    border-bottom: 1px dashed #e0e0e0 !important;
}

.course-detail-page .course-title-wrapper {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 15px !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    padding-top: 5px !important;
}

.course-detail-page .course-description {
    font-family: TTFirsNeue-DemiBold !important;
    font-size: 22px !important; /* Как main_text */
    color: #000 !important;
    margin: 0 !important;
}

/* Только course detail; на goods/courses и других .main — центровка из goods_courses.css */
.course-detail-page .meduim {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    margin: 0 !important;
    width: 100%;
    justify-content: flex-start;
    align-items: flex-start;
    align-self: flex-start;
    --meduim-neutral-bg: #f5f5f5;
}

/* Фон задаётся inline из БД (goods_color col_1..col_4), neutral — через --meduim-neutral-bg */
.course-detail-page .meduim p,
.course-detail-page .meduim .meduim-pill {
    display: inline-flex !important;
    font-size: 14px !important;
    font-family: TTFirsNeue-Medium !important;
    border-radius: 112px !important;
    padding: 5px 15px !important;
    margin: 0 !important;
}

.course-detail-page .meduim-pill--neutral {
    background-color: var(--meduim-neutral-bg, #f5f5f5) !important;
}

.meduim-school__label--short {
    display: none;
}

@media (max-width: 768px) {
    .meduim-school__label--full {
        display: none;
    }

    .meduim-school__label--short {
        display: inline;
    }
}

.course-detail-page .course-image-wrapper {
    flex-shrink: 0 !important;
    width: 120px !important;
    height: 120px !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    background: #f5f5f5 !important;
}

.course-detail-page .course-image {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

/* Блок выбора тарифа */
.tariff-selection {
    margin-bottom: 0;
}

.tariff-selection--classic-only {
    margin-bottom: 0;
}

.tariff-selection--classic-only .tariff-info {
    margin-top: 0;
}

/* Пунктирная линия-разделитель между тарифом и ценой */
.tariff-price-divider {
    width: 100%;
    height: 1px;
    border-top: 1px dashed #e0e0e0;
    margin: 30px 0 10px;
}

.tariff-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
    margin-bottom: 0;
}

.tariff-btn-wrapper {
    position: relative;
}

.tariff-btn-wrapper .yearly-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    background: linear-gradient(135deg, rgb(255 120 120) 0%, rgb(244 128 54) 100%);
}

.tariff-btn {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 16px 10px;
    font-size: var(--fs-body); /* 16px */
    font-family: var(--font-family);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 100%;
    box-sizing: border-box;
    height: 100%;
    color: #000;
}

.tariff-btn:hover {
    border-color: #000;
    background: #fff;
}

.tariff-btn.active {
    background: #000;
    color: #fff;
    border: 1px solid #000;
    padding: 16px 10px;
}

.tariff-btn-name {
    font-size: var(--fs-body); /* 16px, как period-option-title */
    font-family: var(--font-family-medium);
    display: block;
    width: 100%;
    text-align: center;
}

.tariff-btn.active .tariff-btn-name {
    color: #fff;
}

.tariff-btn-badge {
    font-size: 0.75rem; /* 12px, как period-option-subtitle */
    color: #666;
    font-family: var(--font-family);
    display: block;
    width: 100%;
    text-align: center;
}

.tariff-btn.active .tariff-btn-badge {
    color: #ccc; /* Как period-option.active .period-option-subtitle */
}

/* Выпадающая информация о тарифе */
.tariff-info {
    margin-top: 10px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
}


.tariff-features {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tariff-features li {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem; /* 12px, как period-option-subtitle */
    color: #666; /* Как period-option-subtitle */
    font-family: var(--font-family-medium);
    margin-bottom: 5px;
    line-height: var(--lh-base);
}

.tariff-features .feature-icon {
    width: 15px; /* Уменьшено с 18px */
    height: 15px; /* Уменьшено с 18px */
    flex-shrink: 0;
}

.tariff-features .feature-icon-cross {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

/* Блок выбора периода оплаты */
.billing-period-selection {
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.period-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Если в плане подготовки только одна опция (например, ЭКСПРЕСС-КУРС), растягиваем кнопку на всю ширину */
.period-toggle .period-option:only-child {
    grid-column: 1 / -1;
}

.period-option-wrapper {
    position: relative;
}

/* Блок просмотра расписания (отдельный блок) */
.schedule-view-section {
    margin-bottom: 30px;
}

.schedule-view-section .period-option {
    width: 100%;
    margin-top: 0;
}

.period-option-wrapper .yearly-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.period-option {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 16px 32px;
    font-size: var(--fs-body); /* 16px */
    font-family: var(--font-family);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 100%;
    box-sizing: border-box;
    height: 100%;
    color: #000;
}

.period-option:hover {
    border-color: #000;
    background: #fff;
}

.period-option.active {
    background: #000;
    color: #fff;
    border: 1px solid #000;
    padding: 16px 32px;
}

.period-option-title {
    font-size: var(--fs-body); /* 16px */
    font-family: var(--font-family-medium);
    display: block;
    width: 100%;
    text-align: center;
}

.period-option-subtitle {
    font-size: 0.75rem; /* 12px */
    color: #666;
    font-family: var(--font-family);
    display: block;
    width: 100%;
    text-align: center;
    margin-top: 0;
}

.period-option.active .period-option-subtitle {
    color: #ccc;
}

/* Селектор месяца */
.month-selector {
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.month-selector-title {
    font-size: var(--fs-h2); /* 28px */
    font-family: var(--font-family-bold);
    margin-bottom: 25px;
    color: #000;
    line-height: var(--lh-tight);
    letter-spacing: -0.01em;
}

/* Сетка кнопок месяцев */
.month-buttons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(calc((100% - 36px) / 4), 1fr));
    gap: 12px;
    width: 100%;
    max-width: 100%;
}


.month-btn {
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 12px 24px;
    font-size: var(--fs-desc); /* 15px */
    font-family: var(--font-family);
    cursor: pointer;
    transition: all 0.3s ease;
    color: #000;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
}

.month-btn:hover {
    border-color: #000;
    background: #fff;
}

.month-btn.active {
    background: #000;
    color: #fff;
    border-color: #000;
}

/* Годовой селектор */
.yearly-selector {
    margin-bottom: 0px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.yearly-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: rgb(255, 92, 92);
    color: #fff;
    padding: 4px 12px;
    font-size: 0.75rem; /* 12px */
    font-family: var(--font-family-bold);
    white-space: nowrap;
    z-index: 10;
    border-radius: 6px;
}

.yearly-btn {
    background: #000;
    color: #fff;
    border: 1px solid #000;
    border-radius: 10px;
    padding: 12px 32px;
    font-size: var(--fs-body); /* 16px */
    font-family: var(--font-family);
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 auto;
    position: relative;
}

.yearly-btn:hover {
    background: #333;
}

.yearly-btn.active {
    background: #000;
    color: #fff;
    width: 100%;
}

/* Блок информации о курсе (использует структуру block__bottom из раздела курсов) */
.course-info-section {
    margin-bottom: 0px !important;
}

.course-info-section[style*="display: none"],
.course-info-section[style*="display:none"],
.course-info-section.hidden {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    margin-bottom: 0 !important;
    margin-top: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    min-height: 0 !important;
    max-height: 0 !important;
    visibility: hidden !important;
    line-height: 0 !important;
    font-size: 0 !important;
}

/* Стили block__bottom уже определены в goods_courses.css */
/* .block__bottom использует те же стили, что и в разделе курсов */

/* Отображение цены */
.price-display {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    display: flex;
    justify-content: center;
}

.price-breakdown {
    display: flex;
    width: 100%;
    margin: 0 auto;
    padding: 0;
    flex-direction: column;
    gap: 5px;
    box-sizing: border-box;
    border: none;
    border-radius: 0;
    background: transparent;
    color: #333;
    font-family: var(--font-family-medium);
    font-size: 11px;
    line-height: 1.25;
}

.price-breakdown[hidden],
.price-breakdown__row[hidden],
.price-breakdown-divider[hidden] {
    display: none !important;
}

.tariff-price-divider.price-breakdown-divider {
    display: block !important;
}

.tariff-price-divider.price-breakdown-divider[hidden] {
    display: none !important;
}

@media (min-width: 769px) {
    .tariff-price-divider.price-breakdown-divider {
        margin: 30px 0;
    }
}

@media (max-width: 768px) {
    .price-display {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    .tariff-price-divider.price-breakdown-divider {
        margin: 10px 0;
    }

    .price-breakdown-divider:not([hidden]) + .price-display {
        border-top: none;
    }
}

.price-breakdown__row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
}

.price-breakdown__row--discount {
    padding-top: 0;
    border-top: none;
}

.price-breakdown__label {
    color: #777;
    white-space: nowrap;
}

.price-breakdown__value {
    min-width: 0;
    color: #333;
    text-align: right;
    white-space: nowrap;
}

.price-breakdown__row--discount .price-breakdown__value {
    color: #e05252;
}

.price-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;
    position: relative;
    width: 100%;
}

.purchase-card--free .price-container {
    margin-top: 30px;
}

.price-main-wrapper {
    display: flex;
    align-items: baseline;
    gap: 10px;
    justify-content: center;
}

.price-label {
    font-size: 0.75rem; /* 12px */
    font-family: var(--font-family-bold);
    color: #666;
}

.price-value {
    font-size: 2rem; /* 32px */
    font-family: var(--font-family-bold);
    color: #000;
}

.old-price {
    text-decoration: line-through;
    font-size: var(--fs-body); /* 16px */
    color: #666;
    font-family: var(--font-family-bold);
}

.price-period {
    font-size: var(--fs-body); /* 16px */
    font-family: var(--font-family-bold);
    color: #666;
}

/* Секция покупки */
.purchase-section {
    text-align: center;
    margin-top: 10px;
}

.purchase-btn {
    background: rgb(255, 176, 92);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 14px 48px;
    font-size: var(--fs-category); /* 18px */
    font-family: var(--font-family-bold);
    cursor: pointer;
    transition: background-color 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    box-sizing: border-box;
    box-shadow: none;
    outline: none;
}

.purchase-btn:hover {
    background: rgb(255, 195, 130);
    box-shadow: none;
}

.purchase-btn:active {
    background: rgb(255, 176, 92);
    box-shadow: none;
}

.purchase-btn:disabled {
    background: #ccc;
    color: #999;
    cursor: not-allowed;
    opacity: 0.5;
    box-shadow: none;
}

.purchase-btn:disabled:hover {
    background: #ccc;
}

/* Стили для кнопки "Убрать из корзины" */
.purchase-btn.remove-from-cart-btn {
    background: #e0e0e0;
    color: #666;
    border: none;
    border-radius: 10px;
    padding: 14px 48px;
    font-size: var(--fs-category); /* 18px */
    font-family: var(--font-family-bold);
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: none;
    outline: none;
    margin-top: 0;
}

.purchase-btn.remove-from-cart-btn:hover {
    background: #ececec;
    color: #666;
    box-shadow: none;
}

/* Переопределение .add-to-cart-btn / .remove-from-cart-btn из goods_courses: только лёгкое осветление фона, без теней и outline */
.course-detail-page .purchase-btn.add-to-cart-btn {
    box-shadow: none;
    outline: none;
    margin-top: 0;
}
.course-detail-page .purchase-btn.add-to-cart-btn:hover {
    background: rgb(255, 195, 130);
    color: #fff;
    outline: none;
    box-shadow: none;
}
.course-detail-page .purchase-btn.remove-from-cart-btn {
    box-shadow: none;
    outline: none;
    margin-top: 0;
}
.course-detail-page .purchase-btn.remove-from-cart-btn:hover {
    background: #ececec;
    color: #666;
    outline: none;
    box-shadow: none;
}

/* Стили для кнопки "Подробнее" */
.course-btn.details-btn {
    display: inline-block;
    background: #000;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: var(--fs-body); /* 16px */
    font-family: var(--font-family);
    padding: 13px 38px;
    text-decoration: none;
    margin-top: 10px;
    transition: background-color 0.2s ease;
    white-space: nowrap;
    text-align: center;
}

.course-btn.details-btn:hover {
    background: #333;
    opacity: 0.8;
}

/* Медиа-запросы для адаптивности */

/* Десктопная версия (выше 1024px) - правая колонка справа отдельно */
@media screen and (min-width: 1025px) {
    .course-detail-layout {
        display: flex;
        flex-direction: row; /* Явно указываем горизонтальное направление */
        gap: 30px;
        align-items: flex-start; /* Выравниваем по верху, чтобы колонки не растягивались */
        overflow: visible; /* Убираем ограничения overflow для sticky */
    }
    
    .course-detail-left {
        flex: 1;
        min-width: 0;
    }
    
    .course-detail-right {
        flex-shrink: 0;
        width: 500px; /* Увеличено с 400px для лучшего размещения тарифов */
        align-self: flex-start; /* Выравниваем по верху, чтобы не растягивалась */
        display: flex;
        flex-direction: column;
        overflow: visible; /* Убираем ограничения overflow для sticky */
        position: relative; /* Для правильной работы sticky внутри */
    }
    
    .purchase-card {
        position: sticky;
        top: 30px;
        width: 100%; /* Занимает всю ширину course-detail-right */
        height: auto;
        max-height: none;
        overflow: visible;
        /* Sticky будет автоматически опускаться, когда нижний край viewport доходит до нижнего края контейнера */
    }
}

/* Планшеты */
@media screen and (max-width: 1024px) {
    .course-detail-layout {
        flex-direction: column;
        gap: 20px;
        padding: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        border: none;
    }
    
    .course-detail-left {
        padding: 0;
        border-radius: 12px;
        box-shadow: none;
        border: none;
        background: #fff;
    }
    
    .course-detail-right {
        width: 100%;
        background: #fff;
        border-radius: 12px;
    }
    
    .purchase-card {
        position: static;
        padding: 0;
        border-radius: 0;
        box-shadow: none;
        border: none;
        background: transparent;
    }
}

@media screen and (max-width: 768px) {
    .course-schedule-section {
        margin-top: 15px;
    }
    
    .course-detail-page {
        margin: 20px auto;
        padding: 0;
    }
    
    .course-detail-layout {
        gap: 15px;
        padding: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        border: none;
    }
    
    .course-detail-left {
        padding: 10px;
        border-radius: 12px;
        box-shadow: none;
        border: none;
        background: #fff;
    }
    
    .course-detail-right {
        border-radius: 12px;
    }
    
    .purchase-card {
        padding: 10px;
        border-radius: 0;
        box-shadow: none;
        border: none;
        background: transparent;
    }
    
    .hero-image {
        height: 200px;
        border-radius: 8px;
    }
    
    .course-detail-page .course-main-info {
        gap: 15px !important;
        margin-bottom: 25px !important;
        padding-bottom: 20px !important;
        flex-direction: row !important;
    }
    
    .course-detail-page .course-image-wrapper {
        width: 100px !important;
        height: 100px !important;
    }
    
    .course-detail-page .course-description {
        font-size: calc(22px * 0.9) !important; /* Как main_text для 1024px */
    }
    
    .section-title {
        font-size: 1.375rem; /* 22px */
        margin-bottom: 20px;
    }
    
    .tariff-selection {
        margin-bottom: 0;
    }
    
    .tariff-price-divider {
        display: none !important;
    }
    
    .tariff-buttons {
        gap: 10px;
    }
    
    .tariff-btn {
        padding: 10px 20px;
        font-size: 0.9375rem; /* 15px */
        border-radius: 8px;
    }
    
    .tariff-btn-name {
        font-size: var(--fs-body); /* Как period-option-title */
        font-family: var(--font-family-medium);
    }
    
    .tariff-btn-badge {
        font-size: 0.75rem; /* Как period-option-subtitle */
        margin-top: 0;
    }
    
    .tariff-info {
        margin-top: 15px;
        padding: 16px;
    }
    
    .tariff-features li {
        font-size: 0.75rem; /* 12px, как period-option-subtitle */
        color: #666;
        font-family: var(--font-family-medium);
        gap: 6px;
        margin-bottom: 5px;
    }
    
    .tariff-features .feature-icon {
        width: 12px;
        height: 12px;
    }
    
    .tariff-features .feature-icon-cross {
        width: 12px;
        height: 12px;
    }
    
    .billing-period-selection {
        margin-bottom: 25px;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .period-toggle {
        gap: 10px;
        justify-content: center;
        width: 100%;
        max-width: 100%;
        margin: 0;
    }
    
    .period-option {
        padding: 10px 20px;
        font-size: 0.9375rem; /* 15px */
        border-radius: 8px;
    }
    
    .month-selector,
    .yearly-selector {
        margin-bottom: 25px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }
    
    .month-selector-title {
        font-size: 1rem; /* 16px */
        margin-bottom: 12px;
    }
    
    .month-buttons-grid {
        gap: 8px;
    }
    
    .month-btn {
        padding: 10px 18px;
        font-size: 0.875rem; /* 14px */
        width: 100%;
    }
    
    .yearly-btn {
        padding: 10px 20px;
        font-size: 0.9375rem; /* 15px */
    }
    
    .yearly-badge,
    .period-option-wrapper .yearly-badge,
    .tariff-btn-wrapper .yearly-badge {
        font-size: 0.6875rem; /* 11px */
        padding: 3px 10px;
        top: -10px;
    }
    
    .course-info-section {
        margin-bottom: 20px;
    }
    
    .course-info-section[style*="display: none"],
    .course-info-section[style*="display:none"],
    .course-info-section.hidden {
        display: none !important;
        height: 0 !important;
        margin: 0 !important;
        margin-bottom: 0 !important;
        margin-top: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
        min-height: 0 !important;
        max-height: 0 !important;
        visibility: hidden !important;
        line-height: 0 !important;
        font-size: 0 !important;
    }
    
    .course-info-section .block__bottom {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .price-display {
        margin-top: 25px;
        padding-top: 25px;
        border-top: 1px dashed #e0e0e0;
        display: flex;
        justify-content: center;
    }
    
    .price-main-wrapper {
        gap: 8px;
    }
    
    .price-container {
        flex-direction: column;
        align-items: center;
        gap: 8px;
    }
    
    .price-label {
        font-size: 0.7rem; /* ~11px */
        font-family: var(--font-family-bold);
    }
    
    .price-value {
        font-size: 1.75rem; /* 28px */
    }
    
    .old-price {
        font-size: 0.9375rem; /* 15px */
        font-family: var(--font-family-bold);
        color: #666;
    }
    
    .price-period {
        font-size: 0.9375rem; /* 15px */
        font-family: var(--font-family-bold);
    }
    
    .purchase-btn {
        padding: 12px 32px;
        font-size: 1rem; /* 16px */
        border-radius: 8px;
    }
    
    .purchase-btn.remove-from-cart-btn {
        padding: 12px 32px;
        font-size: 1rem; /* 16px */
        border-radius: 8px;
        font-family: var(--font-family-bold);
    }
    
    .course-btn.details-btn {
        font-size: 0.875rem; /* 14px */
        padding: 10px 24px;
        border-radius: 8px;
    }
}

/* Медиа-запрос для 800px (как main_text) */
@media screen and (max-width: 800px) {
    .course-detail-page .course-description {
        font-size: 12px !important;
        margin-bottom: 5px !important;
    }
}

/* Мобильные устройства */
@media screen and (max-width: 576px) {
    .course-schedule-section {
        margin-top: 15px;
    }
    
    .course-detail-page {
        margin: 15px auto;
        padding: 0;
    }
    
    .course-detail-layout {
        flex-direction: column;
        gap: 12px;
        padding: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        border: none;
    }
    
    .course-detail-left {
        padding: 10px;
        border-radius: 12px;
        box-shadow: none;
        border: none;
        background: #fff;
        order: 1;
    }
    
    .course-detail-right {
        width: 100%;
        order: 2;
        background: #fff;
        border-radius: 12px;
    }
    
    .purchase-card {
        padding: 10px;
        border-radius: 0;
        box-shadow: none;
        border: none;
        background: transparent;
        position: static;
        max-height: none;
    }
    
    .hero-image {
        height: 180px;
        border-radius: 8px;
    }
    
    .course-detail-page .course-main-info {
        gap: 12px !important;
        margin-bottom: 20px !important;
        padding-bottom: 15px !important;
        flex-direction: row !important;
    }
    
    .course-detail-page .course-image-wrapper {
        width: 80px !important;
        height: 80px !important;
    }
    
    .course-detail-page .course-description {
        font-size: calc(22px * 0.8) !important; /* Как main_text для 880px */
    }
    
    .course-detail-page .course-title-wrapper {
        gap: 5px !important;
    }
    
    .course-detail-page .meduim {
        gap: 4px !important;
    }
    
    .course-detail-page .meduim p,
    .course-detail-page .meduim .meduim-pill {
        font-size: 9px !important;
        padding: 3px 9px !important;
    }
    
    .course-additional-info {
        gap: 12px;
        padding: 12px;
        font-size: 0.5625rem;
    }
    
    .info-item {
        font-size: 0.5625rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .info-label, .info-value {
        font-size: 0.5rem; /* 8px - уменьшен размер даты в мобильной версии */
    }
    
    .section-title {
        font-size: 1.125rem; /* 18px */
        margin-bottom: 15px;
    }
    
    .schedule-title {
        font-size: 1.125rem;
        margin-bottom: 15px;
    }
    
    .schedule-calendar {
        margin-top: 0;
    }
    
    .billing-period-selection {
        margin-bottom: 20px;
    }
    
    .yearly-selector {
        margin-bottom: 20px;
    }
    
    .course-info-section {
        margin-bottom: 20px;
    }
    
    .tariff-buttons {
        gap: 10px;
    }
    
    .tariff-btn {
        padding: 8px 16px;
        font-size: 0.875rem; /* 14px */
        border-radius: 10px;
    }
    
    .tariff-btn-name {
        font-size: var(--fs-body); /* Как period-option-title */
        font-family: var(--font-family-medium);
    }
    
    .tariff-btn-badge {
        font-size: 0.75rem; /* Как period-option-subtitle */
        margin-top: 0;
    }
    
    .tariff-info {
        margin-top: 12px;
        padding: 14px;
        border-radius: 10px;
    }
    
    .tariff-features li {
        font-size: 0.75rem; /* 12px, как period-option-subtitle */
        color: #666;
        font-family: var(--font-family-medium);
    }
    
    .tariff-features .feature-icon {
        width: 11px;
        height: 11px;
    }
    
    .tariff-features .feature-icon-cross {
        width: 11px;
        height: 11px;
    }
    
    .tariff-price-divider {
        display: none !important;
    }
    
    .period-toggle {
        gap: 10px;
        justify-content: center;
        width: 100%;
        max-width: 100%;
        margin: 0;
    }
    
    .period-option {
        padding: 8px 16px;
        font-size: 0.875rem; /* 14px */
    }
    
    .month-selector-title {
        font-size: 1.125rem; /* 18px */
        margin-bottom: 15px;
    }
    
    .month-buttons-grid {
        gap: 6px;
    }
    
    .month-btn {
        padding: 8px 16px;
        font-size: 0.875rem; /* 14px */
        border-radius: 8px;
        width: 100%;
    }
    
    .yearly-btn {
        padding: 8px 18px;
        font-size: 0.875rem; /* 14px */
    }
    
    .yearly-badge,
    .period-option-wrapper .yearly-badge,
    .tariff-btn-wrapper .yearly-badge {
        font-size: 0.625rem; /* 10px */
        padding: 2px 8px;
        top: -8px;
    }
    
    .price-display {
        margin-top: 20px;
        padding-top: 20px;
        border-top: 1px dashed #e0e0e0;
    }
    
    .price-main-wrapper {
        gap: 6px;
    }
    
    .price-container {
        gap: 6px;
    }
    
    .price-label {
        font-size: 0.6875rem; /* 11px */
        font-family: var(--font-family-bold);
    }
    
    .price-value {
        font-size: 1.5rem; /* 24px */
    }
    
    .old-price {
        font-size: 0.875rem; /* 14px */
        font-family: var(--font-family-bold);
        color: #666;
    }
    
    .price-period {
        font-size: 0.875rem; /* 14px */
        font-family: var(--font-family-bold);
    }
    
    .purchase-btn {
        padding: 10px 28px;
        font-size: 0.9375rem; /* 15px */
        border-radius: 8px;
    }
    
    .purchase-btn.remove-from-cart-btn {
        padding: 10px 28px;
        font-size: 0.9375rem; /* 15px */
        border-radius: 8px;
        font-family: var(--font-family-bold);
    }
    
    .course-btn.details-btn {
        font-size: 0.875rem; /* 14px */
        padding: 9px 20px;
    }
    
    .period-option.schedule-view-period-btn {
        margin-top: 10px;
    }
}

.period-option.schedule-view-period-btn--unavailable {
    opacity: 0.55;
    cursor: default;
    pointer-events: none;
}

/* Маленькие мобильные устройства */
@media (max-width: 480px) {
    .course-schedule-section {
        margin-top: 15px !important;
    }
    
    .course-info-section {
        margin-bottom: 0 !important;
    }
    
    .yearly-selector {
        margin-bottom: 0 !important;
    }
    
    .course-detail-page {
        max-width: calc(100% - 10px);
        margin: 0 auto 15px auto;
        padding: 0;
    }
    
    .course-detail-layout {
        flex-direction: column;
        gap: 10px;
        padding: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        border: none;
    }
    
    .course-detail-left {
        padding: 10px;
        border-radius: 12px;
        box-shadow: none;
        border: none;
        background: #fff;
        order: 1;
    }
    
    .course-detail-right {
        width: 100%;
        order: 2;
        background: #fff;
        border-radius: 12px;
    }
    
    .purchase-card {
        padding: 10px;
        border-radius: 0;
        box-shadow: none;
        border: none;
        background: transparent;
        position: static;
        max-height: none;
    }
    
    .hero-image {
        height: 100px;
        border-radius: 6px;
    }
    
    .course-detail-page .course-main-info {
        gap: 8px !important;
        margin-bottom: 10px !important;
        padding-bottom: 8px !important;
        flex-direction: row !important;
    }
    
    .course-detail-page .course-image-wrapper {
        width: 80px !important;
        height: 80px !important;
        border-radius: 8px !important;
    }
    
    .course-detail-page .course-description {
        font-size: calc(16px * 0.8) !important; /* Как main_text для мобильных */
    }
    
    .course-detail-page .course-title-wrapper {
        gap: 5px !important;
    }
    
    .course-detail-page .meduim {
        gap: 3px !important;
    }
    
    .course-detail-page .meduim p,
    .course-detail-page .meduim .meduim-pill,
    .course-detail-left .meduim p,
    .course-detail-left .meduim .meduim-pill,
    .course-detail-layout .meduim p,
    .course-detail-layout .meduim .meduim-pill {
        font-size: 8px !important;
        padding: 2px 8px !important;
        display: inline-flex !important;
        font-family: TTFirsNeue-Medium !important;
    }
    
    .course-additional-info {
        gap: 25px !important;
        padding: 5px !important;
        font-size: 0.5rem !important;
    }
    
    .info-item {
        font-size: 0.5rem !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 2px !important;
    }
    
    .info-label, .info-value {
        font-size: 0.4375rem !important; /* 7px - уменьшен размер даты в мобильной версии */
    }
    
    .section-title {
        font-size: 0.6875rem !important; /* 11px */
        margin-bottom: 8px !important;
        letter-spacing: -0.01em !important;
    }
    
    .schedule-title {
        font-size: 0.6875rem !important;
        margin-bottom: 8px !important;
        letter-spacing: -0.01em !important;
    }
    
    .schedule-calendar {
        margin-top: 0 !important;
    }
    
    .schedule-calendar .calendar-grid {
        gap: 4px !important;
        margin-top: 0 !important;
        align-items: stretch !important; /* Все ячейки в строке будут одинаковой высоты */
    }
    
    .schedule-calendar .calendar-grid-mobile {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 4px !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
        padding: 0 !important;
        margin-top: 0 !important;
    }
    
    .schedule-calendar .calendar-grid-mobile .calendar-day {
        flex: 0 0 calc(25% - 3px) !important;
        max-width: calc(25% - 3px) !important;
        width: calc(25% - 3px) !important;
        box-sizing: border-box !important;
    }
    
    /* Скрываем пустые дни в мобильной версии */
    .schedule-calendar .calendar-grid-mobile .calendar-day.no-lesson {
        display: none !important;
    }
    
    .schedule-calendar .calendar-day {
        min-height: 18px !important;
        min-width: 30px !important; /* Минимальная ширина */
        height: auto !important; /* Высота может увеличиваться */
        padding: 2px !important;
        border-radius: 4px !important;
        justify-content: flex-start !important; /* Выравнивание по верху */
    }
    
    .schedule-calendar .calendar-day.has-lesson {
        padding-bottom: 0 !important;
        min-height: 40px !important;
    }
    
    .schedule-calendar .calendar-day.has-lesson:hover {
        transform: none !important;
        box-shadow: none !important;
        background: #fff !important;
    }
    
    .schedule-calendar .calendar-day::before {
        font-size: 6px !important;
        font-family: var(--font-family-bold) !important;
        top: 1px !important;
        left: 2px !important;
    }
    
    .schedule-calendar .lesson-title {
        font-size: 6px !important;
        margin-top: 15px !important;
        margin-bottom: 15px !important;
        font-family: var(--font-family-medium) !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        word-break: break-word !important;
        white-space: normal !important;
        min-width: 0 !important;
        width: 100% !important;
        padding: 0 1px !important;
        box-sizing: border-box !important;
    }
    
    .schedule-calendar .lesson-time {
        font-size: 6px !important;
        bottom: 1px !important;
        right: 2px !important;
        font-family: var(--font-family) !important;
    }
    
    .period-option.schedule-view-period-btn {
        margin-top: 10px !important;
    }
    
    .billing-period-selection {
        margin-bottom: 12px;
    }
    
    .yearly-selector {
        margin-bottom: 12px;
    }
    
    .course-info-section {
        margin-bottom: 12px;
    }
    
    .tariff-selection {
        margin-bottom: 0;
    }
    
    .tariff-price-divider {
        display: none !important;
    }
    
    .tariff-buttons {
        gap: 4px;
    }
    
    .tariff-btn {
        padding: 6px 10px;
        font-size: 0.5625rem; /* 9px */
        border-radius: 6px;
        border-width: 1px;
        gap: 2px;
    }
    
    .tariff-btn.active {
        padding: 6px 10px;
    }
    
    .tariff-btn-name {
        font-size: 0.5625rem; /* 9px */
        color: inherit;
        font-family: var(--font-family-medium);
    }
    
    .tariff-btn-badge {
        font-size: 0.4rem; /* 7px */
        margin-top: 0 !important;
    }
    
    .tariff-info {
        margin-top: 10px;
        padding: 12px;
        border-radius: 8px;
    }
    
    .tariff-features li {
        font-size: 0.4rem; /* 7px, как period-option-subtitle */
        color: #666;
        font-family: var(--font-family-medium);
        gap: 4px;
        margin-bottom: 4px;
    }
    
    .tariff-features .feature-icon {
        width: 10px;
        height: 10px;
    }
    
    .tariff-features .feature-icon-cross {
        width: 10px;
        height: 10px;
    }
    
    .billing-period-selection {
        margin-bottom: 12px;
    }
    
    .period-toggle {
        gap: 4px;
        width: 100%;
        max-width: 100%;
        margin: 0;
    }
    
    .period-option {
        padding: 6px 10px;
        font-size: 0.5625rem; /* 9px */
        border-radius: 6px;
        border-width: 1px;
        gap: 2px;
        color: #000;
    }
    
    .period-option.active {
        padding: 6px 10px;
        color: #fff;
    }
    
    .period-option-title {
        font-size: 0.5625rem; /* 9px */
        color: inherit;
        font-family: var(--font-family-medium);
    }
    
    .period-option-subtitle {
        font-size: 0.4rem; /* 7px */
        margin-top: 0 !important;
    }
    
    .period-option-wrapper .yearly-badge {
        top: -5px;
    }
    
    .month-selector {
        margin-bottom: 6px;
    }
    
    .month-selector-title {
        font-size: 0.5625rem; /* 9px */
        margin-bottom: 4px;
    }
    
    .month-buttons-grid {
        gap: 4px;
    }
    
    .month-btn {
        padding: 4px 8px;
        font-size: 0.4375rem; /* 7px */
        border-radius: 6px;
        border-width: 1px;
        width: 100%;
    }
    
    .yearly-selector {
        margin-bottom: 12px;
    }
    
    .yearly-btn {
        padding: 6px 12px;
        font-size: 0.5625rem; /* 9px */
        border-radius: 6px;
        border-width: 1px;
    }
    
    .yearly-badge,
    .period-option-wrapper .yearly-badge,
    .tariff-btn-wrapper .yearly-badge {
        font-size: 0.3rem; /* 7px */
        padding: 2px 5px;
        border-radius: 3px;
        top: -5px;
    }
    
    .price-display {
        margin-top: 12px;
        padding-top: 12px;
    }
    
    .price-container {
        gap: 3px;
    }
    
    .price-main-wrapper {
        gap: 3px;
    }
    
    .price-value {
        font-size: 0.875rem; /* 14px */
    }
    
    .price-label {
        font-size: 0.4375rem; /* 7px */
        font-family: var(--font-family-bold);
    }
    
    .old-price {
        font-size: 0.5rem; /* 8px */
        font-family: var(--font-family-bold);
    }
    
    .price-period {
        font-size: 0.5625rem; /* 9px */
        font-family: var(--font-family-bold);
    }
    
    .purchase-btn {
        padding: 8px 16px;
        font-size: 0.5625rem; /* 9px */
        border-radius: 6px;
        width: 100%;
        max-width: 100%;
    }
    
    .purchase-btn.remove-from-cart-btn {
        padding: 8px 16px;
        font-size: 0.5625rem; /* 9px */
        border-radius: 6px;
        width: 100%;
        max-width: 100%;
        font-family: var(--font-family-bold);
    }
    
    .course-btn.details-btn {
        font-size: 0.5rem; /* 8px */
        padding: 6px 14px;
        border-radius: 6px;
        margin-top: 4px;
    }
    
    .course-info-section {
        margin-bottom: 20px;
    }
    
    .course-info-section[style*="display: none"],
    .course-info-section[style*="display:none"],
    .course-info-section.hidden {
        display: none !important;
        height: 0 !important;
        margin: 0 !important;
        margin-bottom: 0 !important;
        margin-top: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
        min-height: 0 !important;
        max-height: 0 !important;
        visibility: hidden !important;
        line-height: 0 !important;
        font-size: 0 !important;
    }
    
    .course-info-section .block__bottom {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }
}

/* Модальное окно подтверждения замены курса в корзине (#replaceConfirmModal) */
.replace-confirm-modal {
    display: none;
    position: fixed;
    z-index: 100001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 16px;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes replaceConfirmModalIn {
    from {
        opacity: 0;
        transform: scale(0.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.replace-confirm-content {
    display: block;
    width: 100%;
    max-width: 420px;
    margin: auto;
    background: #fff;
    border-radius: 20px;
    padding: 28px 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    text-align: center;
    box-sizing: border-box;
    animation: replaceConfirmModalIn 0.25s ease;
}

.replace-modal-title {
    font-family: var(--font-family-bold);
    font-size: 1.25rem;
    color: #333;
    margin: 0 0 12px 0;
    line-height: 1.3;
}

.replace-modal-message {
    font-family: var(--font-family);
    font-size: var(--fs-body);
    color: #555;
    margin: 0 0 24px 0;
    line-height: 1.5;
}

.replace-modal-buttons {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    align-items: center;
}

.replace-modal-cancel,
.replace-modal-confirm {
    font-family: var(--font-family-medium);
    font-size: var(--fs-body);
    padding: 12px 22px;
    border-radius: 10px;
    cursor: pointer;
    min-width: 120px;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    box-sizing: border-box;
}

.replace-modal-cancel {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
}

.replace-modal-cancel:hover {
    background: #ececec;
}

.replace-modal-confirm {
    background: rgb(255, 176, 92);
    color: #fff;
    border: none;
}

.replace-modal-confirm:hover {
    background: rgb(255, 195, 130);
    color: #fff;
}

body.replace-confirm-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    left: 0;
    right: 0;
}

/* Telegram-шлюз для бесплатных курсов */
.free-course-tg-modal {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 100010;
    padding: 18px;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
    background: rgba(16, 24, 40, 0.52);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.free-course-tg-modal.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.free-course-tg-panel {
    position: relative;
    width: 100%;
    max-width: 390px;
    max-height: min(90vh, 660px);
    overflow-y: auto;
    box-sizing: border-box;
    padding: 30px 26px 25px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 18px 60px rgba(15, 23, 42, 0.24);
    text-align: center;
    font-family: var(--font-family, 'TTFirsNeue-Regular', system-ui, sans-serif);
    transform: translateY(8px) scale(0.98);
    transition: transform 0.22s ease;
    overscroll-behavior: contain;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
}

.free-course-tg-modal.is-open .free-course-tg-panel {
    transform: translateY(0) scale(1);
}

.free-course-tg-close {
    position: absolute;
    top: 10px;
    right: 11px;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #98a2b3;
    font-family: Arial, sans-serif;
    font-size: 28px;
    line-height: 32px;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease;
}

.free-course-tg-close:hover {
    color: #344054;
    background: #f2f4f7;
}

.free-course-tg-icon {
    display: grid;
    width: 58px;
    height: 58px;
    margin: 0 auto 14px;
    border-radius: 17px;
    place-items: center;
    color: #fff;
    background: linear-gradient(145deg, #39aeea, #168bd2);
    box-shadow: 0 9px 22px rgba(34, 158, 217, 0.28);
}

.free-course-tg-icon svg {
    width: 31px;
    height: 31px;
}

.free-course-tg-title {
    margin: 0 0 10px;
    color: #1a1a1a;
    font-family: var(--font-family-bold, 'TTFirsNeue-DemiBold', sans-serif);
    font-size: 23px;
    font-weight: 600;
    line-height: 1.25;
}

.free-course-tg-text {
    margin: 0 0 20px;
    color: #667085;
    font-size: 14px;
    line-height: 1.5;
}

.free-course-tg-actions {
    display: grid;
    gap: 10px;
}

.free-course-tg-btn,
.free-course-tg-check {
    display: flex;
    width: 100%;
    min-height: 50px;
    padding: 12px 15px;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: 10px;
    font-family: var(--font-family-medium, 'TTFirsNeue-Medium', sans-serif);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.25;
    text-decoration: none;
    cursor: pointer;
    box-shadow: none;
    transform: none;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.free-course-tg-btn[hidden] {
    display: none;
}

.free-course-tg-btn svg {
    flex: 0 0 auto;
    width: 21px;
    height: 21px;
}

.free-course-tg-btn--link,
.free-course-tg-btn--link:visited {
    color: #fff;
    background: #229ed9;
}

.free-course-tg-btn--link:hover {
    color: #fff;
    background: #188fca;
    box-shadow: none;
}

.free-course-tg-btn--channel,
.free-course-tg-btn--channel:visited {
    color: #1679ad;
    border: 1px solid #b9e3f7;
    background: #eef9fe;
}

.free-course-tg-btn--channel:hover {
    color: #126d9d;
    background: #e2f5fd;
}

.free-course-tg-check {
    position: relative;
    border: 0;
    color: #fff;
    background: #ffad59;
}

.free-course-tg-check:hover {
    background: #f79c40;
    box-shadow: none;
}

.free-course-tg-btn:active,
.free-course-tg-check:active {
    transform: none;
    box-shadow: none;
}

.free-course-tg-check__spinner {
    display: none;
    width: 17px;
    height: 17px;
    box-sizing: border-box;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: freeCourseTgSpin 0.7s linear infinite;
}

.free-course-tg-check.is-loading .free-course-tg-check__spinner {
    display: block;
}

.free-course-tg-check.is-loading {
    cursor: wait;
    opacity: 0.82;
}

.free-course-tg-check:disabled {
    cursor: wait;
}

.free-course-tg-status {
    display: none;
    width: 100%;
    min-height: 50px;
    margin: 10px 0 0;
    padding: 12px 15px;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
    border: 1px solid #c62828;
    border-radius: 10px;
    background: #ffebee;
    color: #c62828;
    font-family: var(--font-family, 'TTFirsNeue-Regular', sans-serif);
    font-size: 14px;
    font-style: normal;
    font-weight: 400;
    line-height: 1.3;
    text-align: center;
}

.free-course-tg-status:not(:empty) {
    display: flex;
}

html.free-course-tg-open,
body.free-course-tg-open {
    overflow: hidden !important;
    overscroll-behavior: none !important;
    height: 100%;
}

body.free-course-tg-open {
    position: fixed !important;
    left: 0;
    right: 0;
    width: 100%;
    touch-action: none;
}

body.free-course-tg-open .free-course-tg-panel {
    touch-action: pan-y;
}

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

@media (max-width: 480px) {
    .free-course-tg-modal {
        padding: 12px;
        align-items: flex-end;
    }

    .free-course-tg-panel {
        max-width: none;
        padding: 25px 17px 18px;
        border-radius: 18px;
    }

    .free-course-tg-icon {
        width: 52px;
        height: 52px;
        margin-bottom: 12px;
        border-radius: 15px;
    }

    .free-course-tg-icon svg {
        width: 28px;
        height: 28px;
    }

    .free-course-tg-title {
        padding: 0 14px;
        font-size: 20px;
    }

    .free-course-tg-text {
        margin-bottom: 16px;
        font-size: 13px;
    }

    .free-course-tg-btn,
    .free-course-tg-check {
        min-height: 48px;
        padding: 11px 12px;
        font-size: 13px;
    }

    .free-course-tg-status {
        min-height: 48px;
        padding: 11px 12px;
        font-size: 13px;
    }
}

@media (max-width: 768px) {
    .replace-confirm-modal {
        padding: 10px;
    }

    .replace-confirm-content {
        max-width: 100%;
        padding: 16px 14px;
        border-radius: 14px;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
    }

    .replace-modal-title {
        font-size: 1rem;
        margin: 0 0 8px 0;
    }

    .replace-modal-message {
        font-size: 0.8125rem;
        margin: 0 0 14px 0;
        line-height: 1.45;
    }

    .replace-modal-buttons {
        flex-direction: column;
        gap: 8px;
    }

    .replace-modal-confirm {
        order: -1;
    }

    .replace-modal-cancel {
        order: 1;
    }

    .replace-modal-cancel,
    .replace-modal-confirm {
        width: 100%;
        min-width: 0;
        font-size: 0.8125rem;
        padding: 10px 14px;
        border-radius: 8px;
    }
}

@media (max-width: 380px) {
    .replace-confirm-content {
        padding: 12px 10px;
        border-radius: 12px;
    }

    .replace-modal-title {
        font-size: 0.9375rem;
    }

    .replace-modal-message {
        font-size: 0.75rem;
        margin-bottom: 12px;
    }

    .replace-modal-cancel,
    .replace-modal-confirm {
        font-size: 0.75rem;
        padding: 9px 12px;
    }
}

@media (max-width: 768px) {
    .purchase-card--free .price-display {
        margin-top: 0 !important;
        padding-top: 0 !important;
        border-top: none !important;
    }

    .purchase-card--free .price-container {
        margin-top: 15px;
    }
}

/* Модальное окно для просмотра изображений */
.image-modal {
    display: none;
    position: fixed !important;
    z-index: 99999 !important;
    left: 0 !important;
    top: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
    overflow: hidden;
    margin: 0 !important;
    padding: 0 !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Как в goods_courses.css (список курсов): одна и та же область под фото */
.image-modal-content {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100% !important;
    height: 100% !important;
    padding: 0;
    box-sizing: border-box;
    margin: 0 !important;
}

.modal-image {
    max-width: 100vw;
    max-height: 100vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.3s ease;
}

@media (min-width: 769px) {
    .modal-image {
        max-width: 80vw;
        max-height: 80vh;
    }
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Крестик imageModal — SVG в разметке, как в goods_courses.css */
button.image-modal-close {
    -webkit-appearance: none;
    appearance: none;
}

/* Медиа-запросы для модального окна */
@media (max-width: 768px) {
    .image-modal-content {
        justify-content: flex-start;
        align-items: center;
        padding-top: max(68px, calc(env(safe-area-inset-top, 0px) + 60px));
        padding-bottom: 10vh;
        padding-inline: 10px;
        box-sizing: border-box;
    }

    .modal-image {
        max-width: 100%;
        max-height: calc(100dvh - max(68px, calc(env(safe-area-inset-top, 0px) + 60px)) - 10vh - env(safe-area-inset-bottom, 0px));
    }

    .course-info-section .block__bottom {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }
}

/* Дополнительные стили для блока информации о курсе */
.course-additional-info {
    display: flex;
    flex-direction: row;
    gap: 20px;

    align-items: center;
}

.info-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 0;
    border-bottom: none;
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    font-size: 14px;
    font-family: TTFirsNeue-Medium;
    color: #666;
}

.info-value {
    font-size: 14px;
    font-family: TTFirsNeue-Medium;
    color: #000;
}

.course-schedule-section {
    margin-top: 30px;
}

.course-schedule-section[style*="display: none"],
.course-schedule-section:not([style*="display: block"]) {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden;
}

.schedule-title {
    font-size: var(--fs-h3); /* 22px */
    font-family: var(--font-family-bold);
    margin-bottom: 20px;
    color: #000;
    line-height: var(--lh-tight);
    letter-spacing: -0.01em;
}

.schedule-calendar {
    margin-top: 20px;
}

/* Кнопка просмотра расписания (как downl на странице курсов) */
.schedule-view-btn-wrapper {
    margin-top: 15px;
}

.schedule-view-btn-wrapper:empty,
.schedule-view-btn-wrapper:has(a[style*="display: none"]):not(:has(a:not([style*="display: none"]))) {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 0 !important;
}

.schedule-view-btn-wrapper .downl {
    color: #000000;
    text-decoration: none;
    cursor: pointer;
}

.schedule-view-btn-wrapper .downl:hover {
    text-decoration: underline;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-top: 20px;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
    align-items: stretch; /* Все ячейки в строке будут одинаковой высоты */
}

/* Заголовки дней недели (только ПК) */
.calendar-grid-desktop .calendar-weekday-header {
    font-family: var(--font-family-bold);
    font-size: 12px;
    color: #666;
    font-weight: 600;
    text-align: center;
    padding: 4px 0;
    min-height: 24px;
    border: none;
    background: transparent;
}

/* Пустые ячейки в начале месяца для выравнивания по дням недели */
.calendar-day-empty {
    background: transparent !important;
    border: none !important;
    min-height: 40px;
    pointer-events: none;
}

.calendar-day-empty::before {
    content: none !important;
}

.calendar-grid-mobile {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
}

.calendar-grid-mobile .calendar-day {
    flex: 0 0 calc(50% - 5px) !important;
    max-width: calc(50% - 5px) !important;
    box-sizing: border-box !important;
}

/* Скрываем пустые дни в мобильной версии */
.calendar-grid-mobile .calendar-day.no-lesson {
    display: none !important;
}

.calendar-day {
    min-height: 40px; /* Минимальная высота */
    min-width: 60px; /* Минимальная ширина */
    height: auto; /* Высота может увеличиваться */
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; /* Выравнивание по верху для роста вниз */
    padding: 8px;
    background: #fff;
    transition: all 0.2s ease;
    position: relative;
    box-sizing: border-box;
}

.calendar-day.no-lesson {
    background: #f5f5f5;
    border-color: #e0e0e0;
}

.calendar-day.has-lesson {
    background: #fff;
    border-color: #000;
    cursor: pointer;
    min-height: 80px;
}

/* Мобильная версия - уменьшаем min-height для элементов с уроками */
@media (max-width: 768px) {
    .calendar-day.has-lesson {
        min-height: 60px;
    }
    
    .schedule-calendar .calendar-day.has-lesson {
        min-height: 40px !important;
    }
}

.calendar-day.has-lesson:hover {
    background: #fff;
    transform: none;
    box-shadow: none;
}

.calendar-day::before {
    content: attr(data-day);
    position: absolute;
    top: 4px;
    left: 6px;
    font-size: 8px;
    color: #999;
    font-family: var(--font-family-bold);
}

.calendar-day.has-lesson::before {
    color: #666;
    font-family: var(--font-family-bold);
}

.lesson-title {
    font-size: 10px;
    color: #000;
    text-align: center;
    margin-top: 15px;
    margin-bottom: 15px;
    line-height: 1.2;
    font-family: var(--font-family-medium);
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    white-space: normal;
    min-width: 0;
    width: 100%;
    padding: 0 2px;
    box-sizing: border-box;
}

.lesson-time {
    font-size: 8px;
    color: #666;
    font-family: var(--font-family-medium);
    position: absolute;
    bottom: 4px;
    right: 6px;
    margin: 0;
}

.no-schedule {
    text-align: center;
    color: #999;
    font-family: var(--font-family);
    font-size: var(--fs-body);
    padding: 40px 20px;
}

.schedule-month-unavailable {
    margin: 0;
    min-height: 96px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Дополнительные мобильные стили для course-main-info */
@media (max-width: 768px) {
    .course-detail-page .no-schedule.schedule-month-unavailable {
        font-size: 0.4rem !important;
    }

    .course-detail-page .course-title-wrapper {
        gap: 5px !important;
    }
    
    .course-additional-info {
        padding: 15px;
        gap: 15px;
        font-size: 0.625rem;
    }
    
    .info-item {
        font-size: 0.625rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .info-label, .info-value {
        font-size: 0.5rem; /* 8px - уменьшен размер даты в мобильной версии */
    }
    
    .course-detail-page .meduim {
        gap: 5px !important;
    }
    
    .course-detail-page .meduim p,
    .course-detail-page .meduim .meduim-pill {
        font-size: 10px !important;
        padding: 3px 10px !important;
    }
    
    .schedule-title {
        font-size: 1.375rem; /* 22px, как section-title */
        margin-bottom: 20px;
    }
    
    .schedule-calendar {
        margin-top: 0;
    }
    
    .period-option.schedule-view-period-btn {
        margin-top: 10px;
    }
    
    .calendar-grid {
        grid-template-columns: repeat(7, 1fr);
        gap: 6px;
        margin-top: 0;
        align-items: stretch; /* Все ячейки в строке будут одинаковой высоты */
    }
    
    .calendar-grid-mobile {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
        margin-top: 0 !important;
    }
    
    .calendar-grid-mobile .calendar-day {
        flex: 0 0 calc(25% - 4.5px) !important;
        max-width: calc(25% - 4.5px) !important;
        width: calc(25% - 4.5px) !important;
        box-sizing: border-box !important;
    }
    
    /* Скрываем пустые дни в мобильной версии */
    .calendar-grid-mobile .calendar-day.no-lesson {
        display: none !important;
    }
    
    .calendar-day {
        min-height: 20px;
        min-width: 40px; /* Минимальная ширина */
        height: auto; /* Высота может увеличиваться */
        padding: 3px;
        padding-bottom: 10px; /* Место для времени внизу */
        border-radius: 4px;
        justify-content: flex-start; /* Выравнивание по верху */
    }
    
    .calendar-day.has-lesson {
        padding-bottom: 0 !important;
        min-height: 60px !important;
    }
    
    .calendar-day.has-lesson:hover {
        transform: none !important;
        box-shadow: none !important;
        background: #fff !important;
    }
    
    .calendar-day::before {
        font-size: 6px;
        font-family: var(--font-family-bold);
        top: 2px;
        left: 3px;
    }
    
    .lesson-title {
        font-size: 8px;
        margin-top: 15px;
        margin-bottom: 15px;
        font-family: var(--font-family);
        word-wrap: break-word;
        overflow-wrap: break-word;
        word-break: break-word;
        white-space: normal;
        min-width: 0;
        width: 100%;
        padding: 0 2px;
        box-sizing: border-box;
    }
    
    .lesson-time {
        font-size: 6px;
        bottom: 2px;
        right: 3px;
        font-family: var(--font-family);
    }
    
    .period-option.schedule-view-period-btn {
        margin-top: 10px;
    }
    
}

/* Маленькие мобильные устройства - должен быть после 768px */
/* Плавное уменьшение размера шрифта для даты и времени в расписании */
@media (max-width: 640px) {
    .calendar-day::before {
        font-size: 7px;
        font-family: var(--font-family-bold);
    }
    
    .lesson-time {
        font-size: 7px;
    }
    
    .schedule-calendar .calendar-day::before {
        font-size: 7px !important;
        font-family: var(--font-family-bold) !important;
    }
    
    .schedule-calendar .lesson-time {
        font-size: 7px !important;
    }
}

@media (max-width: 576px) {
    .calendar-day::before {
        font-size: 6px;
        font-family: var(--font-family-bold);
    }
    
    .lesson-time {
        font-size: 6px;
    }
    
    .schedule-calendar .calendar-day::before {
        font-size: 6px !important;
        font-family: var(--font-family-bold) !important;
    }
    
    .schedule-calendar .lesson-time {
        font-size: 6px !important;
    }
}

/* Кнопки месяцев над расписанием (когда курс > 31 дня) — на всю ширину course-schedule-section, стиль как period-toggle */
.schedule-month-tabs {
    --schedule-month-tabs-gap: 10px;
    --schedule-month-tab-gap-share: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: var(--schedule-month-tabs-gap);
    margin-bottom: 15px;
    align-items: stretch;
    justify-content: stretch;
    width: 100%;
}
.schedule-month-tab {
    flex: 1 1 0;
    min-width: 0;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 14px;
    font-family: var(--font-family);
    font-weight: 500;
    color: #000;
    cursor: pointer;
    transition: all 0.3s ease;
    box-sizing: border-box;
}
.schedule-month-tab:hover {
    border-color: #000;
    background: #fff;
}
.schedule-month-tab.active {
    background: #000;
    color: #fff;
    border: 1px solid #000;
}
.schedule-month-tab:focus-visible {
    outline: 2px solid #000;
    outline-offset: 2px;
}

@media (max-width: 768px) {
    .schedule-month-tabs {
        margin-bottom: 8px;
    }
    .schedule-month-tabs--multirow {
        align-content: stretch;
    }
    .schedule-month-tabs--multirow .schedule-month-tab {
        min-width: 0;
    }
    .schedule-month-tab {
        font-size: 10px;
        padding: 6px 8px;
        border-radius: 6px;
    }
}

@media (max-width: 480px) {
    .schedule-month-tabs {
        --schedule-month-tabs-gap: 4px;
        --schedule-month-tab-gap-share: 3.2px;
        margin-bottom: 6px;
    }
    .schedule-month-tab {
        font-size: 0.4rem;
        padding: 4px 6px;
        border-radius: 4px;
    }
    .course-schedule-section .schedule-calendar {
        margin-top: 6px;
    }
}
.schedule-month-panel {
    display: none;
}
.schedule-month-panel .calendar-grid {
    margin-top: 0;
}
@media (max-width: 480px) {
    .course-detail-page .meduim p,
    .course-detail-page .meduim .meduim-pill,
    .course-detail-left .meduim p,
    .course-detail-left .meduim .meduim-pill,
    .course-detail-layout .meduim p,
    .course-detail-layout .meduim .meduim-pill {
        font-size: 8px !important;
        padding: 2px 8px !important;
        display: inline-flex !important;
        font-family: TTFirsNeue-Medium !important;
    }
    
    .calendar-day::before {
        font-size: 6px;
        font-family: var(--font-family-bold);
    }
    
    .lesson-time {
        font-size: 6px;
    }
    
    .schedule-calendar .calendar-day::before {
        font-size: 6px !important;
        font-family: var(--font-family-bold) !important;
    }
    
    .schedule-calendar .lesson-time {
        font-size: 6px !important;
    }
}
/* Premium: compact curator choice inside tariff selection. */
.premium-curator-picker {
    margin-top: 12px;
}

.premium-curator-picker[hidden],
.premium-curator-picker__list[hidden] {
    display: none !important;
}

.premium-curator-picker__toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 64px;
    padding: 12px;
    box-sizing: border-box;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    background: #f5f5f5;
    color: #111;
    font-family: TTFirsNeue-Medium, sans-serif;
    font-size: var(--fs-body);
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
}

.premium-curator-picker__toggle:hover,
.premium-curator-picker__toggle[aria-expanded="true"] {
    border-color: #000;
    background: #fff;
}

.premium-curator-picker__plus {
    display: inline-flex;
    flex: 0 0 42px;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    overflow: hidden;
    border-radius: 4px;
    background: #ededed;
    color: #111;
    font-size: 20px;
    line-height: 1;
}

.premium-curator-picker__plus--selected {
    flex-basis: 42px;
    width: 42px;
    height: 42px;
    overflow: hidden;
    border-radius: 4px;
    background: #ededed;
    color: #111;
    font-family: var(--font-family-medium);
    font-size: 10px;
}

.premium-curator-picker__selected-photo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.premium-curator-picker__label {
    flex: 1 1 auto;
    min-width: 0;
    font-family: var(--font-family-medium);
    font-size: 13px;
    line-height: 1.2;
}

.premium-curator-picker__price,
.premium-curator-option__price {
    flex: 0 0 auto;
    margin-left: auto;
    color: #f48036;
    font-family: var(--font-family-medium);
    font-size: 11px;
    line-height: 1.2;
    white-space: nowrap;
}

.premium-curator-picker__price[hidden] {
    display: none !important;
}

.premium-curator-picker__list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 260px;
    margin-top: 6px;
    padding: 12px;
    overflow-y: auto;
    box-sizing: border-box;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    background: #f9f9f9;
}

.premium-curator-option {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 9px;
    width: 100%;
    padding: 7px;
    box-sizing: border-box;
    border: 1px solid #e4e4e4;
    border-radius: 6px;
    background: #fff;
    color: #111;
    text-align: left;
    cursor: pointer;
}

.premium-curator-option.is-selected {
    border-color: #ff8c42;
    background: #fff7f1;
}

.premium-curator-option__photo {
    display: flex;
    flex: 0 0 42px;
    align-self: center;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    overflow: hidden;
    border-radius: 4px;
    background: #ededed;
    object-fit: cover;
    font-family: TTFirsNeue-Medium, sans-serif;
    font-size: 11px;
}

.premium-curator-option__body {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
}

.premium-curator-option__headline {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 6px;
    min-width: 0;
}

.premium-curator-option__meta {
    display: flex;
    flex: 0 0 auto;
    min-width: 74px;
    align-self: stretch;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
}

.premium-curator-option--with-badge .premium-curator-option__meta {
    min-width: 104px;
}

.premium-curator-option__name {
    min-width: 0;
    font-family: TTFirsNeue-Medium, sans-serif;
    font-size: 12px;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.premium-curator-option .curator-badge--compact {
    position: absolute;
    top: 6px;
    right: 7px;
    flex: 0 0 auto;
    padding: 3px 7px 2px 8px;
    font-size: 8px;
}

.premium-curator-option__scores,
.premium-curator-picker__empty {
    margin: 0;
    font-family: TTFirsNeue-Regular, sans-serif;
    font-size: 10px;
    line-height: 1.3;
}

.premium-curator-option__scores {
    color: #f48036;
}

.premium-curator-picker__empty {
    color: #777;
}

/* Фото кураторов сохраняют исходные пропорции и не обрезаются квадратом. */
img.premium-curator-option__photo {
    flex: 0 0 auto;
    width: auto;
    max-width: none;
    object-fit: contain;
    overflow: hidden;
    border-radius: 4px;
}

.premium-curator-picker__plus--selected {
    flex-basis: auto;
    width: auto;
    min-width: 42px;
    overflow: visible;
}

.premium-curator-picker__selected-photo {
    width: auto;
    max-width: none;
    object-fit: contain;
    overflow: hidden;
    border-radius: 4px;
}

@media (max-width: 768px) {
    .price-breakdown {
        margin-bottom: 0;
        padding: 0;
        gap: 4px;
        border-radius: 0;
        font-size: 9px;
    }

    .price-breakdown__row {
        gap: 6px;
    }

    .price-breakdown__row--discount {
        padding-top: 0;
    }

    .premium-curator-picker {
        margin-top: 8px;
    }

    .premium-curator-picker__toggle {
        gap: 7px;
        min-height: 44px;
        padding: 5px;
        border-radius: 8px;
        font-size: 12px;
    }

    .premium-curator-picker__plus {
        flex-basis: 34px;
        width: 34px;
        height: 34px;
        font-size: 16px;
    }

    .premium-curator-picker__plus--selected {
        flex-basis: auto;
        width: auto;
        min-width: 34px;
        height: 34px;
    }

    .premium-curator-picker__selected-photo {
        width: auto;
        height: 34px;
    }

    .premium-curator-picker__label {
        font-size: 10px;
    }

    .premium-curator-picker__list {
        gap: 4px;
        max-height: none;
        margin-top: 4px;
        padding: 6px;
        border-radius: 8px;
        overflow-y: visible;
    }

    .premium-curator-option {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        grid-auto-rows: auto;
        align-items: center;
        gap: 7px;
        height: auto !important;
        min-height: 48px !important;
        max-height: none !important;
        padding: 5px 6px !important;
        overflow: visible !important;
    }

    .premium-curator-option--with-badge {
        height: auto;
        min-height: 48px;
        padding: 5px 6px;
        box-sizing: border-box;
    }

    .premium-curator-option--with-badge .premium-curator-option__body {
        gap: 2px;
    }

    .premium-curator-option__body {
        align-self: center;
        height: auto !important;
        min-height: min-content;
        max-height: none !important;
        padding: 0;
        box-sizing: border-box;
        overflow: visible !important;
    }

    .premium-curator-option__photo {
        flex-basis: 34px;
        width: 34px;
        height: 34px;
    }

    img.premium-curator-option__photo {
        flex-basis: auto;
        width: auto;
        max-width: none;
        border-radius: 4px;
    }

    .premium-curator-picker__selected-photo {
        border-radius: 4px;
    }

    .premium-curator-option__name {
        font-size: 11px;
        white-space: normal;
        overflow: visible;
    }

    .premium-curator-option .curator-badge--compact {
        top: 5px;
        right: 5px;
        padding: 2px 6px 1px 7px;
        font-size: 7px;
    }

    .premium-curator-option__meta {
        min-width: 64px;
    }

    .premium-curator-option--with-badge .premium-curator-option__meta {
        min-width: 86px;
    }

    .premium-curator-option__scores,
    .premium-curator-picker__empty {
        font-size: 9px;
        line-height: 1.2;
    }

    .premium-curator-option__scores {
        white-space: normal;
        overflow: visible;
        overflow-wrap: anywhere;
    }

    .premium-curator-picker__price,
    .premium-curator-option__price {
        font-size: 9px;
    }
}

@media (max-width: 380px) {
    .price-breakdown {
        padding-inline: 0;
        font-size: 8px;
    }

    .price-breakdown__row {
        gap: 4px;
    }
}
