/* SEO-тексти категорій і посадкових (у блоці опису теми .ds-category-description-text) */

/*
 * Тема ставить опис у флекс-рядок поруч із фото категорії; флекс-елемент не стискається вужче за вміст,
 * і широка таблиця виштовхувала текст за білий блок. Тепер колонка опису — не ширша за блок, таблиця прокручується.
 */
#ds-category-description {
	flex: 1 1 auto;
	min-width: 0;
	max-width: 100%;
}

/*
 * Фото категорії тема ставить окремою колонкою — під ним пропадає вся ширина, таблиця стискається.
 * Для тексту модуля: фото вгорі зліва, вступ його обтікає, розділи й таблиця — на всю ширину блоку.
 */
.ds-category-description:has(.mst-text) {
	/* flow-root: блок охоплює плаваюче фото й коли текст згорнутий */
	display: flow-root !important;
}

.ds-category-description:has(.mst-text) #ds-category-description {
	padding-left: 0 !important;
}

/* У теми overflow: hidden (для «Розгорнути») — такий блок не обтікає фото, а стає колонкою поруч; clip обрізає так само */
.ds-category-description:has(.mst-text) .ds-category-description-text {
	overflow: clip;
}

.ds-category-description:has(.mst-text) .ds-category-description-img img {
	max-width: 100%;
	height: auto;
}

@media (min-width: 768px) {
	.ds-category-description:has(.mst-text) .ds-category-description-img {
		float: left;
		max-width: 180px;
		margin: 0 24px 12px 0;
	}

	.mst-text h2,
	.mst-compare,
	.mst-faq,
	.mst-links {
		clear: both;
	}
}

.mst-text {
	max-width: 100%;
	overflow-wrap: break-word;
	font-size: 15px;
	line-height: 1.65;
}

.mst-text h2 {
	margin: 1.6rem 0 .75rem;
	font-size: 20px;
	font-weight: 600;
	line-height: 1.3;
	color: var(--ds-dark-text-color, #1d2939);
}

.mst-text h3 {
	margin: 1.2rem 0 .6rem;
	font-size: 17px;
	font-weight: 600;
	color: var(--ds-dark-text-color, #1d2939);
}

.mst-text > h2:first-child {
	margin-top: 0;
}

.mst-text p,
.mst-text ul,
.mst-text ol {
	margin: 0 0 .9rem;
}

.mst-text ul,
.mst-text ol {
	padding-left: 1.25rem;
}

.mst-text li + li {
	margin-top: .35rem;
}

.mst-text strong {
	font-weight: 600;
	color: var(--ds-dark-text-color, #1d2939);
}

/* Посилання видно як посилання */
.mst-text a:not(.button):not(.btn) {
	color: var(--ds-links-color, var(--ds-primary-color, #00a8e8));
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
	text-decoration-color: rgba(0, 168, 232, .45);
	transition: color .15s, text-decoration-color .15s;
}

.mst-text a:not(.button):not(.btn):hover {
	color: var(--ds-primary-dark-color, var(--ds-primary-color, #0090c8));
	text-decoration-color: currentColor;
}

/* Порівняння моделей */
.mst-compare {
	margin: 1.1rem 0 1.4rem;
}

.mst-compare-title {
	margin-bottom: .5rem !important;
}

.mst-compare .table-responsive {
	max-width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	border: 1px solid var(--ds-border-color, #e3e8ef);
	border-radius: 12px;
}

.mst-table {
	margin: 0;
	min-width: 520px;
	font-size: 14px;
}

.mst-table th {
	background: var(--ds-light-bg-color, #f4f7fb);
	font-weight: 600;
	color: var(--ds-dark-text-color, #1d2939);
}

.mst-table th,
.mst-table td {
	padding: 10px 14px;
	vertical-align: middle;
	border-color: var(--ds-border-color, #e3e8ef);
}

.mst-text .mst-compare-product {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 180px;
	text-decoration: none !important;
}

.mst-compare-product img {
	flex: 0 0 auto;
	width: 56px;
	height: 56px;
	object-fit: contain;
	background: #fff;
	border-radius: 8px;
}

.mst-compare-product span {
	text-decoration: underline;
	text-decoration-color: rgba(0, 168, 232, .45);
	text-underline-offset: 3px;
}

.mst-price {
	white-space: nowrap;
}

.mst-price-new {
	font-weight: 600;
	color: var(--ds-dark-text-color, #1d2939);
}

.mst-price-old {
	font-size: 12px;
	color: var(--ds-secondary-text-color, #667085);
}

.mst-stock {
	color: var(--ds-secondary-text-color, #667085);
}

/* Часті запитання — розгортаються */
.mst-faq {
	margin: 1.4rem 0;
}

.mst-faq details {
	border: 1px solid var(--ds-border-color, #e3e8ef);
	border-radius: 12px;
	background: #fff;
}

.mst-faq details + details {
	margin-top: 8px;
}

.mst-faq summary {
	position: relative;
	display: block;
	padding: 14px 48px 14px 18px;
	font-weight: 600;
	color: var(--ds-dark-text-color, #1d2939);
	cursor: pointer;
	list-style: none;
}

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

.mst-faq summary::before,
.mst-faq summary::after {
	content: "";
	position: absolute;
	top: 50%;
	right: 20px;
	width: 14px;
	height: 2px;
	margin-top: -1px;
	background: var(--ds-primary-color, #00a8e8);
	border-radius: 2px;
	transition: transform .2s;
}

.mst-faq summary::after {
	transform: rotate(90deg);
}

.mst-faq details[open] summary::after {
	transform: rotate(0deg);
}

.mst-faq details > div {
	padding: 0 18px 14px;
}

.mst-faq details > div p:last-child {
	margin-bottom: 0;
}

/* Дивіться також — посадкові й підкатегорії */
.mst-links {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 1.4rem 0 .4rem;
}

.mst-links p {
	flex: 0 0 100%;
	margin: 0 0 2px;
}

.mst-text .mst-links a:not(.button):not(.btn) {
	display: inline-block;
	padding: 6px 14px;
	font-size: 13px;
	line-height: 1.4;
	color: var(--ds-dark-text-color, #1d2939);
	text-decoration: none;
	background: var(--ds-light-bg-color, #f4f7fb);
	border: 1px solid var(--ds-border-color, #e3e8ef);
	border-radius: 999px;
	transition: border-color .15s, color .15s;
}

.mst-text .mst-links a:not(.button):not(.btn):hover {
	color: var(--ds-primary-color, #00a8e8);
	border-color: var(--ds-primary-color, #00a8e8);
}

/* Текст головної (модуль макета): згорнутий, «Показати повністю» */
.mst-home {
	position: relative;
	margin: 0 0 24px;
	padding: 24px;
	background: #fff;
	border-radius: 12px;
}

.mst-home-body {
	position: relative;
	max-height: 260px;
	overflow: hidden;
}

.mst-home-body::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 90px;
	background: linear-gradient(rgba(255, 255, 255, 0), #fff);
	pointer-events: none;
}

.mst-home-open .mst-home-body {
	max-height: none;
}

.mst-home-open .mst-home-body::after {
	display: none;
}

.mst-home-more {
	margin-top: 12px;
	padding: 0;
	font-size: 14px;
	font-weight: 500;
	color: var(--ds-links-color, var(--ds-primary-color, #00a8e8));
	text-decoration: underline;
	text-underline-offset: 3px;
	background: none;
	border: 0;
	cursor: pointer;
}

