/* Новая главная страница. Фирменные цвета drillmaster: коричневый + жёлтый акцент. */

:root {
	--dm-brown: #5d4a39;
	--dm-brown-dark: #47382b;
	--dm-yellow: #f5c518;
	--dm-text: #151515;
	--dm-muted: #7b7b7b;
	--dm-line: #e6e3df;
	--dm-bg: #f6f4f1;
	--dm-radius: 12px;
}

/* Главная идёт во всю ширину: левая колонка шаблона на ней не нужна */
body.index #left {
	display: none;
}

/*
 * Шаблон держит на #right padding-left: 24px, а на узких экранах ещё и padding-right: 12px,
 * из-за чего справа отступ получался вдвое больше левого. Обнуляем оба:
 * поля задаёт .limiter, и они одинаковы с обеих сторон.
 */
body.index #right {
	display: block;
	width: auto;
	padding-left: 0;
	padding-right: 0;
}

body.index .compliter {
	display: block;
}

/* в шаблоне box-sizing глобально не задан — фиксируем для своих блоков */
.dm-hero *,
.dm-section *,
.dm-final * {
	box-sizing: border-box;
}

.dm-section {
	margin: 0 0 56px;
}

.dm-section__head {
	display: flex;
	align-items: baseline;
	gap: 20px;
	margin-bottom: 24px;
}

.dm-section__title {
	font-family: "robotoMedium", Arial, sans-serif;
	font-size: 30px;
	line-height: 1.2;
	color: var(--dm-text);
	margin: 0;
}

.dm-section__title--sub {
	font-size: 22px;
}

.dm-section__link {
	font-size: 15px;
	color: var(--dm-muted);
	text-decoration: none;
	border-bottom: 1px dashed currentColor;
}

.dm-section__link:hover {
	color: var(--dm-brown);
}

/* ---------- Карусель (общая механика для каталога, брендов, товаров) ---------- */

.dm-carousel {
	position: relative;
}

.dm-carousel__viewport {
	overflow: hidden;
}

.dm-carousel__track {
	display: flex;
	gap: 16px;
	transition: transform .35s ease;
	will-change: transform;
}

.dm-carousel__item {
	flex: 0 0 auto;
	display: flex;
}

.dm-carousel__item > * {
	height: 100%;
}

.dm-carousel__nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 1px solid var(--dm-line);
	background: #fff;
	color: var(--dm-brown);
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
	z-index: 2;
	transition: background .2s, color .2s;
}

.dm-carousel__nav:hover {
	background: var(--dm-brown);
	color: #fff;
}

.dm-carousel__nav[disabled] {
	opacity: .35;
	cursor: default;
}

.dm-carousel__nav[disabled]:hover {
	background: #fff;
	color: var(--dm-brown);
}

.dm-carousel__nav--prev {
	left: -22px;
}

.dm-carousel__nav--next {
	right: -22px;
}

@media (max-width: 1400px) {
	.dm-carousel__nav--prev {
		left: 4px;
	}

	.dm-carousel__nav--next {
		right: 4px;
	}
}

/* ---------- 2. Слайд-бокс ---------- */

.dm-hero {
	display: grid;
	grid-template-columns: minmax(0, 3fr) minmax(0, 1fr);
	gap: 16px;
	margin: 0 0 48px;
}

.dm-hero__slider {
	position: relative;
	border-radius: var(--dm-radius);
	overflow: hidden;
	background: var(--dm-bg);
	min-height: 320px;
}

.dm-hero__slide {
	display: none;
	position: relative;
	min-height: 420px;
}

/* слайд без картинки-подложки заливаем фирменным жёлтым */
.dm-hero__slide--plain {
	background: var(--dm-yellow);
}

/* поверх сплошной заливки осветляющая подложка не нужна — она бы выбелила цвет */
.dm-hero__slide--plain .dm-hero__content::before {
	display: none;
}

.dm-hero__slide.is-active {
	display: block;
}

/*
 * Картинка слайда — фоновая подложка любого формата,
 * текст и кнопка приходят из DETAIL_TEXT элемента инфоблока и лежат поверх.
 */
.dm-hero__bg {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.dm-hero__content {
	position: relative;
	z-index: 1;
	/* боковые отступы с запасом под стрелки переключения, когда слайдов больше одного */
	padding: 48px 76px;
	max-width: 620px;
	min-height: 420px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 6px;
}

/*
 * Светлая подложка под текстом: баннеры бывают любыми — с фотографией,
 * тёмные, пёстрые — и без неё текст сливается с картинкой.
 */
.dm-hero__content::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: linear-gradient(90deg, rgba(255, 255, 255, .92) 0%, rgba(255, 255, 255, .88) 65%, rgba(255, 255, 255, 0) 100%);
}

.dm-hero__caption-title,
.dm-hero__content .bigTextColor {
	font-family: "robotoMedium", Arial, sans-serif;
	font-size: 40px;
	line-height: 1.1;
	color: var(--dm-text);
}

.dm-hero__content .mediumTextColor {
	font-size: 26px;
	line-height: 1.2;
	color: var(--dm-brown);
}

.dm-hero__content .smallText {
	font-size: 16px;
	line-height: 1.5;
	color: var(--dm-text);
	opacity: .8;
	margin-top: 10px;
}

.dm-hero__content .cButton {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	align-self: flex-start;
	height: 48px;
	padding: 0 28px;
	margin-top: 22px;
	border-radius: 8px;
	background: var(--dm-brown);
	color: #fff;
	font-size: 15px;
	text-decoration: none;
}

.dm-hero__content .cButton:hover {
	background: var(--dm-brown-dark);
	color: #fff;
}

.dm-hero__dots {
	position: absolute;
	left: 50%;
	transform: translateX(-50%);
	bottom: 20px;
	display: flex;
	gap: 8px;
	/* подложка, чтобы точки читались поверх фотографий на баннерах */
	padding: 7px 11px;
	border-radius: 999px;
	background: rgba(255, 255, 255, .75);
	z-index: 2;
}

.dm-hero__dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	border: none;
	/* баннеры бывают светлые — точки и стрелки делаем тёмными, иначе они пропадают */
	background: rgba(21, 21, 21, .3);
	cursor: pointer;
	padding: 0;
}

.dm-hero__dot.is-active {
	background: var(--dm-brown);
}

.dm-hero__nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 44px;
	height: 44px;
	border: none;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
	color: var(--dm-brown);
	font-size: 20px;
	cursor: pointer;
	z-index: 2;
}

.dm-hero__nav--prev {
	left: 16px;
}

.dm-hero__nav--next {
	right: 16px;
}

.dm-hero__side {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.dm-hero__card {
	flex: 1;
	border-radius: var(--dm-radius);
	padding: 24px;
	background: var(--dm-brown);
	color: #fff;
	text-decoration: none;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	min-height: 130px;
}

.dm-hero__card--light {
	background: #fff;
	border: 1px solid var(--dm-line);
	color: var(--dm-text);
}

.dm-hero__card-title {
	font-family: "robotoMedium", Arial, sans-serif;
	font-size: 19px;
	line-height: 1.3;
}

.dm-hero__card-text {
	font-size: 14px;
	opacity: .85;
	margin-top: 8px;
}

.dm-hero__card-more {
	margin-top: 16px;
	font-size: 14px;
	color: var(--dm-yellow);
}

.dm-hero__card--light .dm-hero__card-more {
	color: var(--dm-brown);
}

@media (max-width: 1100px) {
	.dm-hero {
		grid-template-columns: 1fr;
	}

	.dm-hero__side {
		flex-direction: row;
	}
}

@media (max-width: 700px) {
	.dm-hero__slide,
	.dm-hero__content {
		min-height: 300px;
	}

	/* на узком экране стрелки ложились поверх текста — листаем точками и свайпом */
	.dm-hero__nav {
		display: none;
	}

	.dm-hero__content {
		padding: 28px 20px 48px;
		max-width: none;
	}

	.dm-hero__caption-title,
	.dm-hero__content .bigTextColor {
		font-size: 28px;
	}

	.dm-hero__content .mediumTextColor {
		font-size: 20px;
	}

	.dm-hero__side {
		flex-direction: column;
	}
}

/* ---------- 3. Карусель каталога ---------- */

.dm-cat-card {
	width: 230px;
	background: var(--dm-bg);
	border-radius: var(--dm-radius);
	padding: 20px;
	text-decoration: none;
	color: var(--dm-text);
	display: flex;
	flex-direction: column;
	min-height: 250px;
	transition: box-shadow .2s;
}

.dm-cat-card:hover {
	box-shadow: 0 6px 20px rgba(0, 0, 0, .1);
}

.dm-cat-card__name {
	font-family: "robotoMedium", Arial, sans-serif;
	font-size: 17px;
	line-height: 1.25;
	margin-bottom: 4px;
}

.dm-cat-card__count {
	font-size: 13px;
	color: var(--dm-muted);
}

.dm-cat-card__pic {
	margin-top: auto;
	height: 140px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.dm-cat-card__pic img {
	max-width: 100%;
	max-height: 140px;
	object-fit: contain;
	mix-blend-mode: multiply;
}

/* раздел без обложки: крупный нейтральный знак вместо пустоты */
.dm-cat-card__pic--empty {
	width: 88px;
	height: 88px;
	border-radius: 50%;
	background: #fff;
	color: #cfc8c0;
	font-size: 38px;
	line-height: 88px;
	text-align: center;
}

/* ---------- 4. О нас ---------- */

.dm-about {
	border: 1px solid var(--dm-line);
	border-radius: var(--dm-radius);
	padding: 32px;
}

.dm-about__title {
	font-family: "robotoMedium", Arial, sans-serif;
	font-size: 26px;
	text-transform: uppercase;
	color: var(--dm-text);
	margin: 0 0 24px;
	line-height: 1.25;
}

.dm-about__grid {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: 24px;
}

.dm-about__cell--accent {
	background: var(--dm-brown);
	color: #fff;
	border-radius: var(--dm-radius);
	padding: 20px;
}

.dm-about__cell-title {
	font-family: "robotoMedium", Arial, sans-serif;
	font-size: 15px;
	line-height: 1.35;
	margin-bottom: 8px;
}

.dm-about__cell-text {
	font-size: 13px;
	color: var(--dm-muted);
	line-height: 1.45;
}

.dm-about__cell--accent .dm-about__cell-text {
	color: rgba(255, 255, 255, .85);
}

.dm-about__icon {
	width: 32px;
	height: 32px;
	margin-bottom: 12px;
	object-fit: contain;
}

/* Галочка вместо иконки, пока в инфоблоке «Преимущества» не заполнены картинки */
.dm-about__icon--stub {
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: rgba(93, 74, 57, .1);
	color: var(--dm-brown);
	font-size: 16px;
	line-height: 1;
}

.dm-about__icon--stub::before {
	content: "\2713";
}

.dm-about__text {
	margin-top: 24px;
	font-size: 14px;
	line-height: 1.6;
	color: var(--dm-muted);
	max-width: 900px;
}

@media (max-width: 1200px) {
	.dm-about__grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 700px) {
	.dm-about {
		padding: 20px;
	}

	.dm-about__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 18px;
	}

	.dm-about__title {
		font-size: 20px;
	}
}

/* на узких экранах две колонки дают ~125px на плитку — текст в них не помещается */
@media (max-width: 560px) {
	.dm-about__grid {
		grid-template-columns: 1fr;
	}
}

/* ---------- 5. Бренды ---------- */

.dm-brand-card {
	width: 190px;
	height: 96px;
	border: 1px solid var(--dm-line);
	border-radius: var(--dm-radius);
	display: flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
	color: var(--dm-text);
	font-family: "robotoMedium", Arial, sans-serif;
	font-size: 17px;
	text-align: center;
	padding: 12px;
	transition: border-color .2s, box-shadow .2s;
}

.dm-brand-card:hover {
	border-color: var(--dm-brown);
	box-shadow: 0 4px 14px rgba(0, 0, 0, .08);
}

.dm-brand-card img {
	max-width: 100%;
	max-height: 70px;
	object-fit: contain;
}

/* ---------- 6. Спецпредложения ---------- */

.dm-stocks {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
	gap: 16px;
	margin-bottom: 40px;
}

.dm-stock-card {
	background: var(--dm-bg);
	border-radius: var(--dm-radius);
	overflow: hidden;
	text-decoration: none;
	color: var(--dm-text);
	display: flex;
	flex-direction: column;
}

.dm-stock-card__pic {
	height: 130px;
	background: var(--dm-brown);
	display: block;
	object-fit: cover;
	width: 100%;
}

.dm-stock-card__body {
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	flex: 1;
}

.dm-stock-card__name {
	font-size: 15px;
	line-height: 1.35;
}

.dm-stock-card__date {
	margin-top: auto;
	font-size: 13px;
	color: var(--dm-muted);
}

.dm-product-card {
	width: 230px;
	border: 1px solid var(--dm-line);
	border-radius: var(--dm-radius);
	padding: 16px;
	text-decoration: none;
	color: var(--dm-text);
	display: flex;
	flex-direction: column;
	gap: 10px;
	min-height: 330px;
	transition: box-shadow .2s;
}

.dm-product-card:hover {
	box-shadow: 0 6px 20px rgba(0, 0, 0, .1);
}

.dm-product-card__pic {
	height: 180px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.dm-product-card__pic img {
	max-width: 100%;
	max-height: 180px;
	object-fit: contain;
	mix-blend-mode: multiply;
}

.dm-product-card__price {
	font-family: "robotoMedium", Arial, sans-serif;
	font-size: 19px;
}

.dm-product-card__price--request {
	font-size: 15px;
	color: var(--dm-muted);
}

.dm-product-card__name {
	font-size: 14px;
	line-height: 1.4;
}

/* ---------- 7. Завершающий блок ---------- */

.dm-subscribe {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	background: var(--dm-bg);
	border-radius: var(--dm-radius);
	padding: 24px 32px;
	margin-bottom: 24px;
	box-sizing: border-box;
}

.dm-subscribe * {
	box-sizing: border-box;
}

.dm-subscribe__text {
	display: flex;
	align-items: center;
	gap: 14px;
	font-family: "robotoMedium", Arial, sans-serif;
	font-size: 18px;
	line-height: 1.35;
	color: var(--dm-text);
	max-width: 620px;
}

.dm-subscribe__icon {
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
	border-radius: 8px;
	background: var(--dm-brown);
	color: var(--dm-yellow);
	font-size: 20px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.dm-subscribe__row {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
}

.dm-subscribe__input {
	height: 48px;
	width: 320px;
	max-width: 100%;
	padding: 0 18px;
	border: 1px solid var(--dm-line);
	border-radius: 8px;
	background: #fff;
	font-size: 15px;
	color: var(--dm-text);
}

.dm-subscribe__input:focus {
	outline: none;
	border-color: var(--dm-brown);
}

.dm-subscribe__btn {
	flex: 0 0 auto;
}

@media (max-width: 900px) {
	.dm-subscribe {
		padding: 20px;
	}

	.dm-subscribe__text {
		font-size: 16px;
	}

	.dm-subscribe__input {
		width: 100%;
	}

	.dm-subscribe__row {
		width: 100%;
	}
}

.dm-final {
	background: var(--dm-bg);
	border-radius: var(--dm-radius);
	padding: 40px;
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 40px;
	align-items: center;
	margin-bottom: 48px;
}

.dm-final__title {
	font-family: "robotoMedium", Arial, sans-serif;
	font-size: 26px;
	margin: 0 0 12px;
	color: var(--dm-text);
}

.dm-final__text {
	font-size: 15px;
	color: var(--dm-muted);
	line-height: 1.6;
	margin: 0;
}

.dm-final__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.dm-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 48px;
	padding: 0 28px;
	border-radius: 8px;
	background: var(--dm-brown);
	color: #fff;
	font-size: 15px;
	text-decoration: none;
	border: none;
	cursor: pointer;
	transition: background .2s;
}

.dm-btn:hover {
	background: var(--dm-brown-dark);
	color: #fff;
}

.dm-btn--ghost {
	background: transparent;
	color: var(--dm-brown);
	border: 1px solid var(--dm-brown);
}

.dm-btn--ghost:hover {
	background: var(--dm-brown);
	color: #fff;
}

.dm-final__contacts {
	display: grid;
	gap: 12px;
	font-size: 15px;
}

.dm-final__contacts a {
	color: var(--dm-text);
	text-decoration: none;
}

.dm-final__contacts a:hover {
	color: var(--dm-brown);
}

.dm-final__label {
	display: block;
	font-size: 13px;
	color: var(--dm-muted);
	margin-bottom: 2px;
}

@media (max-width: 900px) {
	.dm-final {
		grid-template-columns: 1fr;
		padding: 24px;
	}
}

/* ------------------------------------------------------------------
   Кнопки редактирования блоков (видны только в режиме правки)
   ------------------------------------------------------------------ */

.dm-editable {
	position: relative;
}

.dm-edit-bar {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 30;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 10px;
	border-radius: 6px;
	background: rgba(33, 33, 33, .92);
	box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
	opacity: 0;
	visibility: hidden;
	transition: opacity .15s ease, visibility .15s ease;
	pointer-events: none;
}

.dm-editable:hover > .dm-edit-bar {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

.dm-edit-bar__title {
	color: #bdbdbd;
	font-size: 12px;
	white-space: nowrap;
}

.dm-edit-bar__link {
	color: #fff;
	font-size: 12px;
	text-decoration: none;
	padding: 3px 8px;
	border: 1px solid rgba(255, 255, 255, .35);
	border-radius: 4px;
	white-space: nowrap;
}

.dm-edit-bar__link:hover {
	background: #f5c518;
	border-color: #f5c518;
	color: #212121;
}

@media (max-width: 700px) {
	.dm-edit-bar {
		position: static;
		opacity: 1;
		visibility: visible;
		pointer-events: auto;
		margin: 0 0 10px;
		flex-wrap: wrap;
	}
}
