/* =========================================================
   СВФУ УСЛУГИ — СТРАНИЦА КУРСА
   Подключается ПОСЛЕ index.css (шапка, корзина, подвал, .container,
   .section-title, .btn-blue берутся оттуда).
   Mobile-first: базовые стили для телефона, шире — через min-width.
   ========================================================= */

/* ---------- Иконки (SVG-спрайт) ---------- */
.icon { width: 1em; height: 1em; flex: none; fill: none; stroke: currentColor;
        stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

:where(.course-page) :focus-visible { outline: 3px solid rgba(21, 90, 122, .45); outline-offset: 2px; }

.course-page { padding-top: 16px; }

/* ---------- Хлебные крошки ---------- */
.breadcrumbs { display: flex; align-items: center; gap: 6px; margin-bottom: 14px;
               font-size: .8rem; color: #71808a; min-width: 0; }
.breadcrumbs a { color: #155a7a; font-weight: 500; text-decoration: none; white-space: nowrap; }
.breadcrumbs .icon { font-size: .8rem; color: #9aa8b0; }
.breadcrumbs .current { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Hero ---------- */
.course-hero { margin-bottom: 16px; overflow: hidden; background: #fff; border-radius: 18px;
               box-shadow: 0 5px 18px rgba(0, 0, 0, .07); }
.main-image-wrapper { aspect-ratio: 16 / 10; background: #e9eff2; }
.main-course-image { width: 100%; height: 100%; object-fit: cover; }
.no-image { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center;
            gap: 8px; color: #78909c; font-size: .85rem; background: linear-gradient(135deg, #e9f0f4, #dce7ed); }
.no-image .icon { font-size: 2.6rem; }

.image-thumbnails { display: flex; gap: 8px; padding: 10px 14px 0; overflow-x: auto;
                    scroll-snap-type: x mandatory; scrollbar-width: none; }
.image-thumbnails::-webkit-scrollbar { display: none; }
.image-thumbnail { flex: 0 0 76px; height: 56px; padding: 0; overflow: hidden; opacity: .65;
                   border: 2px solid transparent; border-radius: 9px; background: #e9eff2; scroll-snap-align: start; }
.image-thumbnail.active { opacity: 1; border-color: #09304a; }
.image-thumbnail img { width: 100%; height: 100%; object-fit: cover; }

.course-main-info { padding: 18px 16px 20px; }
.course-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.course-status, .course-level { padding: 5px 11px; border-radius: 20px; font-size: .76rem; font-weight: 600;
                                background: #edf4f7; color: #155a7a; }
.course-status { background: #09304a; color: #fff; }

.course-title { margin-bottom: 8px; color: #09304a; font-size: clamp(1.45rem, 6vw, 2.2rem); font-weight: 700; line-height: 1.2; }
.course-short-description { margin-bottom: 14px; color: #66747c; font-size: .95rem; line-height: 1.55; }

.course-rating { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-bottom: 14px; font-size: .85rem; }
.stars { display: inline-flex; gap: 2px; font-size: 1rem; }
.star { display: inline-flex; color: #c5d0d6; }
.star.filled { color: #f5b301; }
.star.filled .icon { fill: currentColor; }
.rating-value { color: #09304a; font-weight: 700; }
.rating-count { color: #71808a; }

.course-price-block { display: flex; align-items: baseline; gap: 10px; margin-bottom: 16px; }
.current-price { color: #09304a; font-size: 1.9rem; font-weight: 700; line-height: 1; }
.old-price { color: #8a98a0; font-size: 1rem; text-decoration: line-through; }

.course-quick-info { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.quick-info-item, .course-location { display: flex; align-items: center; gap: 10px; padding: 11px; border-radius: 12px; background: #f5f8fa; min-width: 0; }
.course-location { margin-bottom: 8px; }
.quick-info-icon, .location-icon, .file-icon, .highlight-icon { width: 36px; height: 36px; flex: none; display: flex;
        align-items: center; justify-content: center; border-radius: 9px; background: #edf4f7; color: #155a7a; font-size: 1.05rem; }
.quick-info-label, .location-label { display: block; color: #71808a; font-size: .72rem; line-height: 1.3; }
.quick-info-item strong, .course-location strong { display: block; color: #17242c; font-size: .88rem; line-height: 1.3; overflow-wrap: anywhere; }
.location-address { display: block; color: #66747c; font-size: .8rem; }

.participants-info { margin: 14px 0; }
.participants-header { display: flex; justify-content: space-between; margin-bottom: 6px; color: #53616a; font-size: .84rem; }
.participants-header strong { color: #09304a; }
.participants-progress { height: 8px; overflow: hidden; border-radius: 8px; background: #e4ebef; }
.participants-progress-bar { height: 100%; border-radius: 8px; background: #09304a; }

/* ---------- Кнопки ---------- */
.course-actions { display: flex; gap: 10px; margin: 16px 0; }
.primary-button, .sidebar-register-button, .sticky-register-button {
    min-height: 52px; padding: 0 20px; border: none; border-radius: 9px; background: #09304a; color: #fff;
    font-size: .95rem; font-weight: 600; transition: background-color .2s ease; }
.primary-button { flex: 1; }
.sidebar-register-button { width: 100%; }
.primary-button:hover, .sidebar-register-button:hover, .sticky-register-button:hover { background: #155a7a; }
.primary-button:disabled, .sidebar-register-button:disabled, .sticky-register-button:disabled { background: #9fb0b9; cursor: not-allowed; }
.primary-button.registered, .sidebar-register-button.registered, .sticky-register-button.registered { background: #2e8b5e; }

.favorite-button { width: 52px; height: 52px; flex: none; display: flex; align-items: center; justify-content: center;
                   border: 1px solid #d8e0e4; border-radius: 9px; background: #fff; color: #155a7a; font-size: 1.3rem; }
.favorite-button.active { border-color: #e53935; color: #e53935; }
.favorite-button.active .icon { fill: currentColor; }

.course-benefits { display: flex; flex-direction: column; gap: 8px; }
.benefit { display: flex; align-items: center; gap: 9px; color: #46545c; font-size: .88rem; }
.benefit-icon { width: 20px; height: 20px; flex: none; display: flex; align-items: center; justify-content: center;
                border-radius: 50%; background: #e3f4ea; color: #2e8b5e; font-size: .72rem; }
.benefit-icon .icon { stroke-width: 3; }

/* ---------- Контент + сайдбар ---------- */
.course-content-layout { display: grid; gap: 16px; }
.course-content-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.course-sidebar { display: flex; flex-direction: column; gap: 16px; }

.content-card, .sidebar-card { padding: 20px 16px; background: #fff; border-radius: 18px; box-shadow: 0 5px 18px rgba(0, 0, 0, .07); }
.content-card h2 { margin-bottom: 16px; padding-left: 12px; border-left: 4px solid #09304a; color: #09304a; font-size: 1.2rem; font-weight: 700; line-height: 1.25; }
.sidebar-card h3 { margin-bottom: 12px; color: #09304a; font-size: 1.05rem; }
.empty-content { color: #71808a; font-size: .9rem; }

/* Текст из админки (| safe) */
.rich p, .rich li { color: #46545c; font-size: .95rem; line-height: 1.65; }
.rich p { margin-bottom: 12px; }
.rich h3, .rich h4 { margin: 18px 0 8px; color: #09304a; font-size: 1.05rem; }
.rich ul, .rich ol { margin-bottom: 12px; padding-left: 1.25em; }
.rich li { margin-bottom: 6px; }
.rich a { color: #155a7a; }
.rich img { height: auto; margin: 12px 0; border-radius: 12px; }
.rich table { display: block; width: 100%; overflow-x: auto; border-collapse: collapse; font-size: .88rem; }
.rich th, .rich td { padding: 8px 10px; border: 1px solid #e2e8ec; text-align: left; }
.rich > :last-child { margin-bottom: 0; }
.learning-content ul { padding-left: 0; list-style: none; }
.learning-content li { position: relative; padding-left: 28px; }
.learning-content li::before { content: ""; position: absolute; left: 0; top: .28em; width: 18px; height: 18px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23155a7a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E") center / contain no-repeat; }

/* ---------- Расписание ---------- */
.sessions-list, .teachers-list, .course-files, .reviews-list { display: flex; flex-direction: column; gap: 10px; }
.session-item { display: grid; gap: 8px; padding: 14px; border: 1px solid #e4eaee; border-radius: 14px; }
.session-day { color: #09304a; font-weight: 700; }
.session-end-date { color: #71808a; }
.session-info h3 { margin-bottom: 6px; color: #17242c; font-size: .95rem; }
.session-details { display: flex; flex-wrap: wrap; gap: 6px 14px; color: #5d6a72; font-size: .8rem; }
.session-details span { display: inline-flex; align-items: center; gap: 5px; }
.session-details .icon { color: #155a7a; }
.session-price strong { color: #09304a; font-size: 1.05rem; }

/* ---------- Преподаватели ---------- */
.teacher-card { display: flex; gap: 14px; padding: 14px; border: 1px solid #e4eaee; border-radius: 14px; }
.teacher-avatar, .review-avatar { width: 56px; height: 56px; flex: none; display: flex; align-items: center; justify-content: center;
    overflow: hidden; border-radius: 50%; background: #09304a; color: #fff; font-size: 1.2rem; font-weight: 700; }
.teacher-avatar img, .review-avatar img { width: 100%; height: 100%; object-fit: cover; }
.teacher-info { min-width: 0; }
.teacher-info h3 { color: #09304a; font-size: 1rem; }
.teacher-info > span { display: block; margin-bottom: 6px; color: #155a7a; font-size: .82rem; }
.teacher-info p { color: #66747c; font-size: .86rem; line-height: 1.55; }
.teacher-experience { display: inline-block; margin-top: 8px; padding: 3px 10px; border-radius: 20px; background: #edf4f7; color: #155a7a; font-size: .76rem; font-weight: 500; }

/* ---------- Материалы ---------- */
.course-file { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 10px 12px; border: 1px solid #e4eaee;
               border-radius: 12px; color: inherit; text-decoration: none; }
.course-file:active { background: #f0f6fa; }
.file-info { flex: 1; min-width: 0; }
.file-info strong { display: block; color: #17242c; font-size: .92rem; overflow-wrap: anywhere; }
.file-info span { color: #71808a; font-size: .76rem; }
.file-download { color: #155a7a; font-size: 1.1rem; }

/* ---------- FAQ ---------- */
.faq-item { border-bottom: 1px solid #edf0f2; }
.faq-item:last-child { border-bottom: none; }
.faq-question { width: 100%; min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
                padding: 12px 0; border: none; background: none; color: #09304a; font-size: .95rem; font-weight: 600; text-align: left; }
.faq-arrow { display: flex; flex: none; color: #155a7a; transition: transform .25s ease; }
.faq-item.open .faq-arrow { transform: rotate(45deg); }
.faq-answer { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .25s ease; }
.faq-item.open .faq-answer { grid-template-rows: 1fr; }
.faq-answer-inner { min-height: 0; overflow: hidden; }
.faq-answer-text { padding-bottom: 14px; color: #46545c; font-size: .92rem; line-height: 1.6; }

/* ---------- Отзывы ---------- */
.reviews-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.reviews-header h2 { margin-bottom: 4px; }
.reviews-header span { color: #71808a; font-size: .82rem; }
.reviews-rating { display: flex; align-items: center; gap: 8px; }
.reviews-rating strong { color: #09304a; font-size: 1.5rem; }
.review-item { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid #edf0f2; }
.review-item:last-child { border-bottom: none; }
.review-avatar { width: 40px; height: 40px; font-size: 1rem; }
.review-body { flex: 1; min-width: 0; }
.review-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 10px; }
.review-top strong { color: #17242c; font-size: .92rem; }
.review-date { color: #8a98a0; font-size: .75rem; }
.review-stars { margin: 3px 0 6px; font-size: .9rem; }
.review-body p { color: #46545c; font-size: .9rem; line-height: 1.55; }
.empty-reviews { padding: 18px 0; text-align: center; }
.empty-reviews .icon { font-size: 2.4rem; color: #b7c1c7; }
.empty-reviews h3 { margin: 8px 0 4px; color: #34424b; font-size: 1rem; }
.empty-reviews p { color: #71808a; font-size: .85rem; }

/* ---------- Сайдбар ---------- */
.sidebar-register { display: none; }
.sidebar-price { display: flex; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.sidebar-price strong { color: #09304a; font-size: 1.7rem; }
.sidebar-old-price { color: #8a98a0; text-decoration: line-through; }
.sidebar-note { margin-top: 10px; color: #71808a; font-size: .8rem; text-align: center; }
.course-meta-list { list-style: none; }
.course-meta-list li { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid #edf0f2; }
.course-meta-list li:last-child { border-bottom: none; }
.course-meta-list span { color: #71808a; font-size: .86rem; }
.course-meta-list strong { color: #17242c; font-size: .88rem; text-align: right; }
.sidebar-highlight { display: flex; gap: 14px; background: linear-gradient(135deg, #09304a, #155a7a); color: #fff; }
.sidebar-highlight h3 { margin-bottom: 4px; color: #fff; }
.sidebar-highlight p { color: rgba(255, 255, 255, .82); font-size: .86rem; line-height: 1.5; }
.sidebar-highlight .highlight-icon { width: 44px; height: 44px; background: rgba(255, 255, 255, .13); color: #fff; font-size: 1.3rem; }
.help-text { margin-bottom: 14px; color: #66747c; font-size: .86rem; line-height: 1.55; }
.help-button { min-height: 46px; display: flex; align-items: center; justify-content: center; border: 1px solid #09304a; border-radius: 9px;
               color: #09304a; font-size: .9rem; font-weight: 600; text-decoration: none; transition: background-color .2s ease, color .2s ease; }
.help-button:hover { background: #09304a; color: #fff; }

/* ---------- Нижняя панель записи (телефон) ---------- */
.sticky-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 80; display: flex; align-items: center; gap: 14px;
              padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid #dde4e8;
              box-shadow: 0 -6px 20px rgba(0, 0, 0, .1); transform: translateY(110%); transition: transform .25s ease; }
.sticky-bar.visible { transform: none; }
.sticky-price { display: flex; flex-direction: column; line-height: 1.2; }
.sticky-price small { color: #8a98a0; font-size: .75rem; text-decoration: line-through; }
.sticky-price strong { color: #09304a; font-size: 1.2rem; white-space: nowrap; }
.sticky-register-button { flex: 1; min-height: 48px; }
.footer { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }

/* ---------- Уведомление ---------- */
.notification { position: fixed; left: 50%; bottom: calc(88px + env(safe-area-inset-bottom)); z-index: 700; width: max-content; max-width: min(92vw, 420px);
                padding: 12px 18px; border-radius: 10px; background: #09304a; color: #fff; font-size: .88rem; box-shadow: 0 10px 28px rgba(0, 0, 0, .25);
                opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: opacity .2s ease, transform .2s ease; }
.notification.show { opacity: 1; transform: translate(-50%, 0); }

/* =========================================================
   ПЛАНШЕТ И ШИРЕ
   ========================================================= */
@media (min-width: 720px) {
    .course-main-info { padding: 24px; }
    .content-card, .sidebar-card { padding: 24px; }
    .course-benefits { flex-direction: row; flex-wrap: wrap; gap: 8px 20px; }
    .session-item { grid-template-columns: 170px 1fr auto; align-items: center; gap: 16px; }
}

/* =========================================================
   ДЕСКТОП
   ========================================================= */
@media (min-width: 901px) {
    .course-page { padding-top: 24px; }
    .course-hero { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
    .course-gallery { padding: 24px 0 24px 24px; }
    .main-image-wrapper { overflow: hidden; border-radius: 14px; }
    .image-thumbnails { padding: 12px 0 0; }
    .course-main-info { padding: 28px; }
    .course-content-layout { grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
    .course-sidebar { position: sticky; top: 16px; }
    .sidebar-register { display: block; }
    .sticky-bar { display: none; }
    .footer { padding-bottom: 25px; }
    .notification { bottom: 28px; }
}

@media (hover: hover) {
    .course-file:hover { background: #f0f6fa; }
    .favorite-button:hover { border-color: #155a7a; }
}

@media (prefers-reduced-motion: reduce) {
    .faq-answer, .faq-arrow, .sticky-bar, .notification { transition: none; }
}
