/* Стили для страницы курса */

/* =========================
   HERO (фон, заголовок)
   ========================= */
.course-hero {
    position: relative;
    height: clamp(560px, 75vh, 720px);
    background-size: cover;
    background-position: center;
    color: #fff;
    padding-top: 40px;
    z-index: 10;
    /* Разрешаем карточке цены «выползать» за низ hero */
    overflow: visible;
}
.course-hero-gradient { position: absolute; inset: 0; opacity: 0.85; }
.course-hero .container {
    position: relative; z-index: 1;
    height: 100%; display: flex; flex-direction: column;
}
.course-hero-inner {
    display: grid; grid-template-columns: 1fr 440px;
    gap: 30px; align-items: start; width: 100%;
    height: 100%;
}
.course-hero-content {
    max-width: 100%;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding-top: 0;
    margin-top: 8px;
}
.course-hero-sidebar { position: relative; }

/* Заголовок: голова (первая строка) — всегда одной строкой, хвост — с переносами */
.course-hero h1 {
    font-size: 36px;
    margin-bottom: 15px;
    font-weight: 700;
    color: #fff;
    line-height: 1.22;
    word-break: normal;
    overflow-wrap: normal;
}
.course-hero h1 .heading-head { white-space: nowrap; }
.course-hero h1 .heading-tail { white-space: normal; }

@supports (text-wrap: balance) {
  .course-hero h1 { text-wrap: balance; }
}

/* На десктопе первый ряд заголовка «заходит» над колонкой цены */
@media (min-width: 1200px) {
  .course-hero h1 {
    max-width: calc(100% + 470px);     /* 440px (сайдбар) + 30px (gap) */
    margin-right: calc(-440px - 30px);  /* визуально расширяем область текста вправо */
    white-space: normal;
  }
  .course-hero h1 .heading-tail {
    display: inline;
  }
}

.course-subtitle {
    font-size: 18px; margin-bottom: 20px; opacity: 0.9; color: #fff;
}
.course-features { display: flex; flex-wrap: wrap; margin-bottom: 16px; }
.feature { display: flex; align-items: center; margin-right: 20px; margin-bottom: 10px; color: #fff; }
.feature i { margin-right: 8px; font-size: 18px; }

/* В hero описание белым */
.course-hero .course-description {
    font-size: 18px; line-height: 1.6; margin-bottom: 16px; opacity: 0.9; color: #fff;
}

/* Автор */
.course-author { margin-top: 8px; }
.author-label { font-size: 14px; opacity: 0.85; margin-bottom: 8px; color: #fff; }
.author-info { display: flex; align-items: center; }
.author-info img { width: 50px; height: 50px; border-radius: 50%; margin-right: 15px; object-fit: cover; }
.author-name { font-weight: 500; margin-bottom: 5px; color: #fff; }
.author-rating { display: flex; align-items: center; color: #fff; }
.author-rating i { color: #ffcc32; margin-right: 5px; }

/* Просмотров */
.course-views {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 90px;
    color: #fff;
    font-size: 14px;
}
.course-views i { color: #fff; opacity: 0.9; }

/* =========================
   ОСНОВНОЙ КОНТЕНТ
   ========================= */
.course-content { background-color: #f5f5f5; padding: 60px 0; position: relative; z-index: auto; }
.course-content-wrapper { display: flex; margin-top: 30px; position: relative; }
.course-info-column { flex: 1; padding-right: 30px; }
.course-price-column { width: 440px; position: relative; }

/* =========================
   КАРТОЧКА ЦЕНЫ + ОБЁРТКА
   ========================= */
.course-info-block, .course-tabs, .course-author-block, .course-price-card {
    background-color: #fff; border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    padding: 25px; margin-bottom: 30px;
}
.course-price-card { background-color: #f7f7f7; }

/* Обёртка для иконок + карточки цены */
.price-wrapper { position: static; width: 100%; max-width: 440px; margin-left: auto; }
.course-hero-sidebar .price-wrapper {
    position: absolute; right: 0; top: 0; width: 440px; z-index: 100;
}
/* Липкий режим (когда переносим обёртку в body) */
.sticky-price-card { position: fixed; z-index: 999; }

/* Тулбар иконок над карточкой (по центру) */
.price-card-toolbar {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 0 0 12px 0;
}
.circle-icon {
    width: 40px; height: 40px; border-radius: 50%;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.85);
    color: #fff; display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all .2s ease; outline: none;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.2) inset;
}
.circle-icon i { font-size: 16px; line-height: 1; pointer-events: none; }
.circle-icon:hover { background: rgba(255,255,255,0.14); transform: translateY(-1px); }
.circle-icon.fav-active { background: rgba(255, 255, 255, 0.2); }

/* На светлом фоне (course-content) — желтые иконки и обводка */
.price-card-toolbar.on-light .circle-icon {
    color: #ffcc32;
    border-color: #ffcc32;
    box-shadow: 0 0 0 1px rgba(255, 204, 50, 0.25) inset;
}
.price-card-toolbar.on-light .circle-icon:hover {
    background: rgba(255, 204, 50, 0.12);
}

/* Что вы узнаете — 2 колонки + зелёные галочки */
.what-you-learn-content { color: #555; }
.what-you-learn-content p { margin-bottom: 15px; }
.what-you-learn-content ul {
    list-style: none; padding-left: 0; margin: 0 0 10px 0;
    columns: 2; column-gap: 28px;
}
.what-you-learn-content li {
    position: relative; padding-left: 32px; margin: 0 0 10px 0; break-inside: avoid; color: #444;
}
.what-you-learn-content li::before {
    content: "✓"; position: absolute; left: 0; top: 0.15em;
    width: 22px; height: 22px; border-radius: 50%; background: #22c55e; color: #fff;
    font-weight: 700; font-size: 14px; line-height: 22px; text-align: center;
}

/* Вкладки */
.tab-buttons { display: flex; border-bottom: 1px solid #eee; margin-bottom: 20px; gap: 8px; flex-wrap: wrap; }
.tab-btn {
    padding: 10px 20px; background: none; border: none; border-bottom: 3px solid transparent;
    cursor: pointer; font-weight: 500; color: #666; transition: all 0.3s ease;
}
.tab-btn:hover { color: #212a34; }
.tab-btn.active { color: #212a34; border-bottom-color: #ffcc32; }
.tab-content { padding: 10px 0; }
.tab-pane { display: none; line-height: 1.6; color: #555; }
.tab-pane.active { display: block; }
#description p, #program p { margin-bottom: 15px; }
#description ul, #program ul { padding-left: 20px; margin-bottom: 15px; }
#description li, #program li { margin-bottom: 8px; }
#description strong, #program strong { font-weight: 700; color: #212a34; }

/* Нумерованные списки — зелёные кружки */
.tab-pane ol, #description ol, #program ol {
    list-style: none; counter-reset: item; padding-left: 0; margin: 0 0 14px 0;
}
.tab-pane ol li, #description ol li, #program ol li {
    counter-increment: item; position: relative; padding-left: 44px; margin: 8px 0;
}
.tab-pane ol li::before, #description ol li::before, #program ol li::before {
    content: counter(item);
    position: absolute; left: 0; top: 0.1em; width: 28px; height: 28px; border-radius: 50%;
    background: #22c55e; color: #fff; font-weight: 700; font-size: 14px; line-height: 28px; text-align: center;
}

/* Таблица особенностей */
.features-table { width: 100%; margin-top: 20px; }
.feature-row { display: flex; border-bottom: 1px dashed #eee; padding: 10px 0; }
.feature-row:last-child { border-bottom: none; }
.feature-name { width: 40%; font-weight: 500; color: #212a34; }
.feature-value { width: 60%; color: #555; }

/* Блок "Кто автор онлайн-курса?" */
.course-author-block h2 {
    font-size: 24px;
    margin: 0 0 10px 0; /* отступ под заголовком */
    color: #212a34;
}

/* Общая карточка для автора/школы */
.course-author-block .author-details {
    display: flex;
    align-items: flex-start;
    gap: 16px;                     /* современная замена margin-right у img */
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 16px;
}

/* Отступ между заголовком и первой карточкой */
.course-author-block h2 + .author-details {
    margin-top: 14px;
}

/* Между автором и школой — отступ и разделитель */
.course-author-block .author-details + .author-details {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px dashed #e5e7eb; /* мягкий разделитель */
}

/* Меньшая аватарка */
.course-author-block .author-details img {
    width: 96px;
    height: 96px;
    border-radius: 10px;
    object-fit: cover;
    flex: 0 0 auto;
}

/* Текстовая часть */
.course-author-block .author-details h3 {
    font-size: 18px;
    margin: 0 0 6px 0;
    color: #212a34;
}
.course-author-block .author-details p {
    margin: 0 0 12px 0;
    line-height: 1.6;
    color: #555;
}

/* Адаптив: ещё компактнее на мобильных */
@media (max-width: 768px) {
    .course-author-block .author-details img {
        width: 84px;
        height: 84px;
    }
}

.author-courses-btn:hover { background-color: #e0e0e0; text-decoration: none; }

/* Цена */
.price-header { font-size: 16px; font-weight: 600; color: #212a34; margin: 0 0 10px 0; }
.price-current { font-size: 32px; font-weight: 800; color: #212a34; margin: 0 0 6px 0; }
.price-current.free { color: #27ae60; }
.price-original { font-size: 18px; color: #999; text-decoration: line-through; margin: 0 0 12px 0; }
.discount-badge { display: inline-block; background-color: #ff9800; color: #fff; padding: 3px 8px; border-radius: 4px; font-size: 14px; margin: 0 0 15px 0; }
.price-description { color: #666; margin-bottom: 20px; }
.access-btn {
    display: block; width: 100%; padding: 12px; text-align: center;
    background-color: #27ae60; color: #fff; border-radius: 5px; font-weight: 500;
    margin-bottom: 25px; transition: all 0.3s ease; text-decoration: none;
}
.access-btn:hover { background-color: #219653; transform: translateY(-2px); text-decoration: none; }
.features-title { font-size: 18px; margin-bottom: 15px; color: #212a34; }
.course-features-list { list-style: none; padding: 0; }
.course-features-list li { display: flex; align-items: center; margin-bottom: 12px; color: #555; }
.course-features-list li i { width: 20px; margin-right: 10px; color: #999; }

/* Жёлтый блок вебинара */
.webinar-info {
    display: block; width: 100%; background: #ffda44; color: #111;
    border: 1px solid #e6c700; border-radius: 10px; padding: 12px 14px; margin-bottom: 16px;
}
.webinar-title { font-size: 14px; font-weight: 600; color: #111; margin-bottom: 6px; }
.webinar-when { font-size: 16px; font-weight: 700; color: #111; }
.webinar-time { font-weight: 700; margin-left: 6px; }

/* =========================
   КАРТОЧКИ/СЛАЙДЕРЫ
   ========================= */
.course-card {
    width: 320px; min-width: 320px; background-color: #fff; border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1); margin: 0 10px; overflow: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer; text-decoration: none; color: inherit; display: flex; flex-direction: column; flex-shrink: 0; height: auto;
}
.course-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.15); }

.course-image { height: 150px; position: relative; overflow: hidden; }
.course-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; position: relative; z-index: 1; }
.course-card:hover .course-image img { transform: scale(1.08); }
.course-image-gradient { position: absolute; inset: 0; opacity: 0.85; z-index: 2; mix-blend-mode: multiply; }
.course-category {
    position: absolute; top: 10px; left: 10px; background-color: rgba(0,0,0,0.7);
    color: #fff; padding: 5px 10px; border-radius: 3px; font-size: 12px; z-index: 3;
}
.course-format { position: absolute; bottom: 10px; left: 10px; color: #fff; font-size: 14px; font-weight: 500; z-index: 3; }

.course-info { padding: 15px; display: flex; flex-direction: column; }
.course-title { font-size: 18px; margin-bottom: 10px; color: #212a34; line-height: 1.3; }
.course-provider { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 14px; color: #666; }
.course-rating { display: flex; align-items: center; }
.course-rating i { color: #ffcc32; margin-right: 5px; }

.course-card .course-description { font-size: 14px; color: #666; margin-bottom: 15px; line-height: 1.4; }

.course-details { display: flex; margin-bottom: 15px; }
.course-duration, .course-lessons { display: flex; align-items: center; font-size: 14px; color: #666; margin-right: 20px; }
.course-duration i, .course-lessons i { margin-right: 5px; color: #999; }
.course-price { font-weight: 700; font-size: 16px; margin-top: auto; }
.course-price.free { color: #27ae60; }
.course-price.paid { color: #212a34; }
.course-price.subscription { color: #2196f3; }

/* Слайдер */
.courses-slider { position: relative; margin-bottom: 20px; overflow: hidden; width: 100%; }
.courses-slider-container { display: flex; transition: transform 0.5s ease; padding: 20px 0; }
.courses-slider-navigation { display: flex; justify-content: center; margin-top: 10px; gap: 12px; }
.courses-slider-prev, .courses-slider-next {
    width: 40px; height: 40px; border-radius: 50%; background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); border: none; display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.3s ease;
}
.courses-slider-prev:hover, .courses-slider-next:hover { background-color: #ffcc32; }

/* Секции каруселей */
.author-courses, .category-courses { background-color: #f5f5f5; padding: 10px 0 60px; }
.section-header-simple { margin-bottom: 10px; }
.section-header-simple h2 { font-size: 28px; color: #212a34; margin: 0 0 10px 0; }

/* =========================
   FAQ (Ответы на вопросы)
   ========================= */
.course-faq-block { background: #fff; }
.faq-list { border-top: 1px dashed #e5e7eb; }
.faq-item { border-bottom: 1px dashed #e5e7eb; }
.faq-q {
    width: 100%; background: none; border: none; text-align: left;
    padding: 14px 36px 14px 0; font-size: 16px; font-weight: 600; color: #212a34; cursor: pointer; position: relative;
}
.faq-q .faq-caret {
    position: absolute; right: 0; top: 50%; transform: translateY(-50%) rotate(0deg);
    width: 22px; height: 22px; border-radius: 50%;
    background: #f3f4f6; color: #475569; display: inline-flex; align-items: center; justify-content: center;
}
.faq-q .faq-caret::before { content: "▾"; font-size: 14px; line-height: 1; }
.faq-item.open .faq-q .faq-caret { transform: translateY(-50%) rotate(180deg); }

.faq-a { overflow: hidden; max-height: 0; transition: max-height 0.3s ease; color: #555; }
.faq-item.open .faq-a { padding: 0 0 14px 0; max-height: 1000px; }
.faq-a p { margin: 8px 0; line-height: 1.65; }

/* Адаптивность (заменено с 1200 на 1199, чтобы ширина 1200 считалась десктопом) */
@media (max-width: 1199px) {
    .course-hero { height: auto; padding: 60px 0; }
    .course-hero-inner { grid-template-columns: 1fr; }

    .course-content-wrapper { flex-direction: column; }
    .course-info-column { padding-right: 0; margin-bottom: 30px; }
    .course-price-column { width: 100%; }

    .price-wrapper { position: static; width: 100%; max-width: 100%; z-index: auto; }
    .sticky-price-card { position: static; width: 100% !important; left: auto !important; top: auto !important; z-index: auto !important; }

    .what-you-learn-content ul { columns: 1; }

    .course-hero h1 {
      max-width: 100%;
      margin-right: 0;
    }
}
@media (max-width: 768px) {
    .course-features { flex-direction: column; }
    .feature { margin-bottom: 10px; }
    .author-details { flex-direction: column; }
    .author-details img { margin-bottom: 15px; }
    .tab-buttons { flex-wrap: wrap; }
    .tab-btn { flex: 1 0 auto; text-align: center; }
}

/* Не даём блоку вебинара превращаться в оверлей */
.course-price-card .webinar-info {
  position: relative !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
  inset: auto !important;

  display: block !important;
  width: auto !important;
  height: auto !important;
  z-index: 1 !important;

  background: #fff8e6;
  border: 1px solid #f3d38a;
  border-radius: 10px;
  padding: 12px 14px;
  margin: 0 0 12px 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}

.course-price-card .webinar-title {
  font-weight: 700;
  font-size: 14px;
  color: #824600;
  margin: 0 0 4px 0;
}

.course-price-card .webinar-when {
  font-size: 13px;
  color: #6a4b00;
}

.course-price-card .webinar-time {
  margin-left: 6px;
  font-weight: 600;
}

/* На всякий случай не даём карточке цены «залезать» над всем остальным без необходимости */
.course-price-card { position: relative; z-index: 1; }
.course-hero-gradient { pointer-events: none; }

/* Отступ между несколькими авторами/школами в hero */
.course-author .author-info + .author-info {
    margin-top: 8px;
}

/* Блок "Кто автор онлайн-курса?" — делаем карточки аккуратнее */
.course-author-block h2 { margin-bottom: 12px; }
.course-author-block h2 + .author-details { margin-top: 16px; }

.course-author-block .author-details {
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
}
.course-author-block .author-details:last-child { margin-bottom: 0; }

/* Чуть отодвинем картинку от заголовка секции */
.course-author-block .author-details img {
    margin-top: 4px;
    width: 160px;
    height: 160px;
    border-radius: 10px;
    margin-right: 20px;
    object-fit: cover;
}

/* CTA-кнопки в блоке автора/школы */
.author-courses-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    padding: 10px 20px;
    border: 2px solid #aacc18;
    border-radius: 9999px;      /* овальная */
    background: transparent;    /* прозрачная */
    color: #aacc18;

    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.2px;
    text-decoration: none !important; /* чтобы ссылка не выделялась */
    line-height: 1;

    transition: all .2s ease;
    box-shadow: none;
}

/* Состояние visited — тот же цвет, чтобы не “синела” */
.author-courses-btn:visited {
    color: #aacc18;
    text-decoration: none;
}

/* Наведение/фокус — заливаем цветом, делаем текст белым */
.author-courses-btn:hover,
.author-courses-btn:focus-visible {
    background: #aacc18;
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(170, 204, 24, 0.18);
    outline: none;
}

/* Активное нажатие — легкий “клик” эффект */
.author-courses-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(170, 204, 24, 0.18);
}

/* Небольшой отступ от текста блоков */
.course-author-block .author-details .author-courses-btn {
    margin-top: 8px;
}
