/* MedicalMag — раздел «Обучающие курсы»: уроки выглядят как уроки. Логика — /local/mm-courses/lib.php */

/* ---------- метка на картинке и под заголовком ---------- */
.mm-course-badge {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 4px 10px 4px 8px; border-radius: 6px;
	background: #172b21; color: #fff;
	font-size: 12px; font-weight: 600; line-height: 16px; white-space: nowrap;
}
.mm-course-badge--video { background: var(--mm-brand, #4c8945); }
.catalog-block__item .mm-course-badge { position: relative; z-index: 2; pointer-events: none; }
/* в фото уроков сверху впечатана надпись «Видеообучение» — метку опускаем вниз картинки */
.mm-course-card .image-list-wrapper { position: relative; }
.mm-course-card .image-list-wrapper > .sticker { top: auto !important; bottom: 8px; left: 8px; }

.mm-course-subtitle { line-height: 18px; }

/* ---------- карточка урока ---------- */
.mm-course-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 12px; }
.mm-course-facts__link { font-size: 13px; color: #555; text-decoration: none; border-bottom: 1px solid #d6dbd2; }
.mm-course-facts__link:hover { color: var(--mm-brand, #4c8945); border-color: currentColor; }

.mm-course-aside { display: grid; gap: 10px; }
.mm-course-device,
.mm-course-center {
	display: flex; align-items: center; gap: 12px;
	padding: 10px 12px; border: 1px solid #e3e7df; border-radius: 8px;
	color: #172b21; text-decoration: none; background: #fff;
	transition: border-color .15s ease;
}
.mm-course-device:hover,
.mm-course-center:hover { border-color: var(--mm-brand, #4c8945); color: #172b21; }
.mm-course-device__img { flex: 0 0 56px; width: 56px; height: 56px; border-radius: 6px; overflow: hidden; background: #f4f6f1; }
.mm-course-device__img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.mm-course-device__play {
	flex: 0 0 36px; width: 36px; height: 36px; border-radius: 50%;
	display: inline-flex; align-items: center; justify-content: center;
	background: var(--mm-brand, #4c8945); color: #fff;
}
.mm-course-device__play svg { margin-left: 2px; }
.mm-course-device__text { display: flex; flex-direction: column; min-width: 0; }
.mm-course-device__label { font-size: 12px; color: #777; line-height: 16px; }
.mm-course-device__name { font-size: 13px; font-weight: 600; line-height: 18px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mm-course-center { flex-direction: column; align-items: flex-start; gap: 2px; background: #f4f6f1; border-color: #f4f6f1; }
.mm-course-center__title { font-size: 13px; font-weight: 600; line-height: 18px; }
.mm-course-center__title::after { content: " →"; }
.mm-course-center__text { font-size: 12px; line-height: 16px; color: #666; }

/* ---------- верх раздела ---------- */
.mm-courses-top { margin: 0 0 24px; }
.mm-courses-intro { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.mm-courses-intro__item {
	display: flex; flex-direction: column; gap: 4px;
	padding: 16px 18px; border-radius: 8px; background: #f4f6f1; color: #172b21; text-decoration: none;
}
.mm-courses-intro__item--link { border: 1px solid transparent; transition: border-color .15s ease; }
.mm-courses-intro__item--link:hover { border-color: var(--mm-brand, #4c8945); color: #172b21; }
.mm-courses-intro__title { font-size: 15px; font-weight: 600; line-height: 20px; }
.mm-courses-intro__text { font-size: 13px; line-height: 18px; color: #555; }

.mm-courses-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mm-courses-chips + .mm-courses-chips { margin-top: 12px; }
.mm-courses-chips__label { font-size: 13px; color: #777; margin-right: 4px; }
.mm-courses-chip {
	display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 14px;
	border: 1px solid #dfe4db; border-radius: 8px; background: #fff;
	font-size: 13px; font-weight: 500; color: #172b21; text-decoration: none; white-space: nowrap;
}
.mm-courses-chips--methods:not(.is-open) .mm-courses-chip--extra:not(.mm-courses-chip--active) { display: none; }
.mm-courses-chips--methods.is-open .mm-courses-chip--toggle { display: none; }
.mm-courses-chip--toggle { cursor: pointer; color: var(--mm-brand, #4c8945); font-family: inherit; }
a.mm-courses-chip:hover { border-color: var(--mm-brand, #4c8945); color: #172b21; }
.mm-courses-chip--active { background: #172b21; border-color: #172b21; color: #fff; }
.mm-courses-chip__count { font-size: 12px; color: #8a8f87; }
.mm-courses-chip--active .mm-courses-chip__count { color: rgba(255, 255, 255, .7); }

@media (max-width: 767px) {
	.mm-courses-intro { grid-template-columns: 1fr; gap: 8px; }
	.mm-courses-intro__item { padding: 12px 14px; }
	.mm-courses-chips { flex-wrap: nowrap; overflow-x: auto; margin-right: -16px; padding-right: 16px; scrollbar-width: none; }
	.mm-courses-chips::-webkit-scrollbar { display: none; }
	.mm-courses-chips__label { flex: 0 0 auto; }
}

/* ссылки-карточки: тема Aspro подчёркивает текст внутри ссылок */
/* 🚨 border-bottom обнуляем только у текста внутри: сами плашки .mm-course-device/.mm-course-center — с рамкой */
.mm-course-device, .mm-course-center, .mm-courses-intro__item--link { text-decoration: none !important; }
.mm-course-device span, .mm-course-device a:not(.mm-course-device__img), .mm-course-center span,
.mm-courses-intro__item--link span { text-decoration: none !important; border-bottom: 0 !important; }

/* ---------- карточка урока: плашки фактов, видео, об уроке ---------- */
.mm-course-facts__link--video { color: var(--mm-brand, #4c8945); border-color: currentColor; }
.mm-course-fact-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.mm-course-fact { display: flex; flex-direction: column; padding: 8px 12px; border-radius: 8px; background: #f4f6f1; min-width: 110px; }
.mm-course-fact__title { font-size: 12px; line-height: 16px; color: #777; }
.mm-course-fact__value { font-size: 14px; line-height: 20px; font-weight: 600; color: #172b21; }

.mm-course-video__player {
	position: relative; display: block; width: 100%; max-width: 860px; aspect-ratio: 16 / 9;
	padding: 0; border: 0; border-radius: 12px; overflow: hidden; cursor: pointer;
	background: radial-gradient(circle at 50% 45%, #2b4436, #111c16);
}
.mm-course-video__player img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #fff; opacity: .55; }
.mm-course-video__play {
	position: absolute; left: 50%; top: 50%; width: 76px; height: 76px; margin: -38px 0 0 -38px; border-radius: 50%;
	display: flex; align-items: center; justify-content: center; background: var(--mm-brand, #4c8945); color: #fff;
	box-shadow: 0 8px 24px rgba(0, 0, 0, .25); transition: transform .15s ease;
}
.mm-course-video__play svg { margin-left: 4px; }
.mm-course-video__player:hover .mm-course-video__play { transform: scale(1.06); }
.mm-course-video__label {
	position: absolute; left: 16px; bottom: 14px; padding: 4px 10px; border-radius: 6px;
	background: rgba(17, 28, 22, .75); color: #fff; font-size: 13px; font-weight: 500;
}
.mm-course-video__frame { display: block; width: 100%; max-width: 860px; aspect-ratio: 16 / 9; border: 0; border-radius: 12px; background: #000; }
.mm-course-video__note { max-width: 860px; margin: 12px 0 0; font-size: 13px; line-height: 18px; color: #666; }

.mm-course-about__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 40px; max-width: 1000px; }
.mm-course-about__title { margin: 0 0 12px; font-size: 16px; font-weight: 600; }
.mm-course-about__col .mm-course-about__title:not(:first-child) { margin-top: 24px; }
.mm-course-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.mm-course-list li { position: relative; padding-left: 20px; font-size: 15px; line-height: 22px; }
.mm-course-list li::before { content: ""; position: absolute; left: 4px; top: 9px; width: 6px; height: 6px; border-radius: 50%; background: var(--mm-brand, #4c8945); }
.mm-course-list--check li::before { top: 5px; left: 0; width: 12px; height: 7px; border-radius: 0; background: none; border-left: 2px solid var(--mm-brand, #4c8945); border-bottom: 2px solid var(--mm-brand, #4c8945); transform: rotate(-45deg); }
.mm-course-trainer { margin: 0; font-size: 15px; line-height: 22px; }

.mm-course-program { margin: 0; padding: 0; list-style: none; counter-reset: mmprog; max-width: 860px; border-top: 1px solid #e3e7df; }
.mm-course-program li { counter-increment: mmprog; display: flex; gap: 16px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid #e3e7df; font-size: 15px; line-height: 22px; }
.mm-course-program li::before { content: counter(mmprog); flex: 0 0 24px; font-weight: 600; color: var(--mm-brand, #4c8945); }
.mm-course-program li > span:first-child { flex: 1; }
.mm-course-program__time { color: #777; font-size: 14px; white-space: nowrap; }

.mm-course-steps { margin: 0; padding: 0; list-style: none; counter-reset: mmstep; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; max-width: 1000px; }
.mm-course-steps li { counter-increment: mmstep; padding: 16px; border-radius: 8px; background: #f4f6f1; font-size: 14px; line-height: 20px; }
.mm-course-steps li::before { content: counter(mmstep); display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; margin-bottom: 10px; border-radius: 50%; background: var(--mm-brand, #4c8945); color: #fff; font-weight: 600; }

.mm-course-faq { max-width: 860px; border-top: 1px solid #e3e7df; }
.mm-course-faq details { border-bottom: 1px solid #e3e7df; }
.mm-course-faq summary { padding: 14px 32px 14px 0; font-size: 15px; font-weight: 600; cursor: pointer; list-style: none; position: relative; }
.mm-course-faq summary::-webkit-details-marker { display: none; }
.mm-course-faq summary::after { content: "+"; position: absolute; right: 4px; top: 10px; font-size: 22px; font-weight: 400; color: var(--mm-brand, #4c8945); }
.mm-course-faq details[open] summary::after { content: "−"; }
.mm-course-faq p { margin: 0 0 14px; font-size: 15px; line-height: 22px; color: #444; }

/* ---------- карточка аппарата: урок с кнопкой ---------- */
.mm-course-device--lesson .mm-course-device__text { flex: 1; color: #172b21; text-decoration: none; }
.mm-course-device__play { text-decoration: none; }
.mm-course-device__buy .btn { white-space: nowrap; padding: 0 12px; }

@media (max-width: 767px) {
	.mm-course-about__grid { grid-template-columns: 1fr; }
	.mm-course-video__play { width: 60px; height: 60px; margin: -30px 0 0 -30px; }
	.mm-course-device--lesson { flex-wrap: wrap; }
}

/* ---------- карточка урока: средняя колонка ---------- */
.mm-course-main { display: grid; gap: 16px; margin-top: 20px; }
.mm-course-teaser p { margin: 0 0 6px; font-size: 15px; line-height: 22px; color: #444; }
.mm-course-device--main { align-items: flex-start; padding: 12px; }
.mm-course-device--main .mm-course-device__img { flex-basis: 72px; width: 72px; height: 72px; }
.mm-course-device--main .mm-course-device__name { font-size: 14px; color: #172b21; text-decoration: none; }
.mm-course-device--main .mm-course-device__name:hover { color: var(--mm-brand, #4c8945); }
.mm-course-device__video { margin-top: 6px; font-size: 13px; color: var(--mm-brand, #4c8945); text-decoration: none; }
.mm-course-ask { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-radius: 8px; background: #f4f6f1; }
.mm-course-ask__text { display: flex; flex-direction: column; gap: 2px; font-size: 13px; line-height: 18px; color: #555; }
.mm-course-ask__text b { font-size: 14px; color: #172b21; }

@media (max-width: 767px) { .mm-course-ask { flex-direction: column; align-items: flex-start; } }
.mm-course-ask__btn {
	flex: 0 0 auto; display: inline-flex; align-items: center; min-height: 36px; padding: 0 16px; cursor: pointer;
	border: 1px solid #cfd6ca; border-radius: 8px; background: #fff; color: #172b21; font-size: 14px; font-weight: 600; white-space: nowrap;
}
.mm-course-ask__btn:hover { border-color: var(--mm-brand, #4c8945); color: var(--mm-brand, #4c8945); }
.mm-course-related { display: grid; gap: 10px; font-size: 14px; color: #172b21; }
.mm-course-related .mm-courses-chip { min-height: 30px; padding: 0 10px; font-size: 12px; }
.mm-courses-chip--all { color: var(--mm-brand, #4c8945); }
@media (max-width: 767px) { .mm-course-related .mm-courses-chips { flex-wrap: wrap; margin-right: 0; padding-right: 0; } }

/* урок в корзине: кнопка «В корзине» спокойнее, рядом «×» — убрать (скрипт — /local/mm-product/mm-product.js) */
.mm-course-device__buy { display: inline-flex; align-items: center; gap: 6px; }
.mm-course-device__remove {
	display: none; width: 30px; height: 30px; padding: 0; border: 1px solid #cfd6ca; border-radius: 50%; background: #fff;
	font: inherit; font-size: 18px; line-height: 26px; color: #777; cursor: pointer;
}
.mm-course-device__remove:hover { border-color: #c0392b; color: #c0392b; }
.mm-course-device__buy.active .mm-course-device__remove { display: inline-block; }
.mm-course-device__buy.active .btn { background: #fff !important; color: var(--mm-brand, #4c8945) !important; border: 1px solid var(--mm-brand, #4c8945) !important; opacity: 1 !important; }
.mm-product-main > .grid-list__item { overflow: visible; padding-bottom: 1px; }
.mm-course-device--lesson { box-sizing: border-box; }
