/* Общие улучшения интерфейса (aq_ui.js): окно выбора региона, «Повторить заказ» на мобильных, карточка товара */

/* ---------- Окно выбора региона ---------- */

.aq-region-popup {
	padding-right: 36px;
	max-width: 380px;
}
.aq-region-close {
	position: absolute;
	top: 6px;
	right: 8px;
	width: 32px;
	height: 32px;
	border: 0;
	background: transparent;
	color: #64748b;
	font-size: 24px;
	line-height: 32px;
	cursor: pointer;
}
.aq-region-close:hover {
	color: #1e293b;
}
.aq-region-other {
	align-self: center;
	font-size: 13px;
	color: #009640;
	text-decoration: underline;
}
@media (max-width: 767px) {
	/* на смартфоне — карточкой снизу, над нижним меню, а не поверх шапки */
	.aq-region-popup {
		position: fixed;
		top: auto;
		left: 8px;
		right: 8px;
		/* над нижним меню и кнопкой чата */
		bottom: calc(var(--aq-bottom-menu-h, 66px) + 36px);
		margin: 0;
		max-width: none;
		z-index: 1000;
	}
	.aq-region-popup::before {
		display: none;
	}
	.aq-region-popup .region-notification-assumption {
		align-items: flex-start;
	}
}

/* ---------- «Повторить заказ» на мобильных: плавающая кнопка внизу ---------- */

.aq-repeat-mobile {
	display: none;
}
@media (max-width: 1023px) {
	.aq-repeat-mobile:not([hidden]) {
		display: flex;
		align-items: center;
		position: fixed;
		left: 12px;
		bottom: calc(var(--aq-bottom-menu-h, 66px) + 12px);
		z-index: 29;
		border-radius: 999px;
		background: #009640;
		box-shadow: 0 6px 18px rgba(0, 150, 64, .35);
		transition: transform .25s ease, opacity .25s ease;
	}
	.aq-repeat-mobile.is-scrolled-away {
		transform: translateY(calc(100% + 90px));
		opacity: 0;
		pointer-events: none;
	}
	.aq-repeat-mobile .aq-repeat-header {
		height: 44px;
		padding: 0 6px 0 16px;
		border: 0;
		background: transparent;
		color: #fff;
		font-size: 14px;
	}
	.aq-repeat-mobile .aq-repeat-header:hover {
		background: transparent;
		color: #fff;
	}
	.aq-repeat-mobile-close {
		width: 36px;
		height: 44px;
		border: 0;
		background: transparent;
		color: rgba(255, 255, 255, .85);
		font-size: 20px;
		line-height: 44px;
		cursor: pointer;
	}
}

/* ---------- Карточка товара ---------- */

/* длинное описание сворачиваем, чтобы цена и «В корзину» не уезжали за экран */
.aq-collapsible.is-collapsed {
	max-height: 216px;
	overflow: hidden;
	position: relative;
}
.aq-collapsible.is-collapsed::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 72px;
	background: linear-gradient(rgba(255, 255, 255, 0), #fff);
	pointer-events: none;
}
.aq-collapsible-toggle {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-top: 10px;
	padding: 0;
	border: 0;
	background: none;
	color: #009640;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}
.aq-collapsible-toggle:hover {
	color: #007a34;
}

@media (min-width: 993px) and (max-width: 1400px) {
	/* ноутбуки: фото слева, справа сначала цена и «В корзину», под ними описание
	   (раньше цена переносилась под описание и уходила за первый экран) */
	.product-detail-container {
		display: grid;
		grid-template-columns: 340px minmax(0, 1fr);
		grid-template-areas: "gallery price" "gallery info";
		grid-template-rows: auto 1fr;
		column-gap: 30px;
		row-gap: 20px;
		align-items: start;
	}
	.product-detail-col-gallery {
		grid-area: gallery;
	}
	.product-detail-col-price {
		grid-area: price;
		width: auto;
	}
	.product-detail-col-info {
		grid-area: info;
		width: auto;
		border-radius: 10px !important;
	}
	.product-detail-gallery-main {
		border-radius: 10px !important;
	}
}

@media (max-width: 992px) {
	/* на планшете и смартфоне: фото → цена и «В корзину» → описание */
	.product-detail-container {
		display: flex;
		flex-direction: column;
	}
	.product-detail-col-gallery {
		order: 1;
	}
	.product-detail-col-price {
		order: 2;
		margin-bottom: 20px;
	}
	.product-detail-col-info {
		order: 3;
		border-radius: 10px !important;
	}
	.product-detail-gallery-main {
		border-radius: 10px !important;
	}
}

@media (max-width: 768px) {
	/* выключка по ширине на узком экране даёт большие пробелы между словами */
	.product-detail-preview-text,
	.product-detail-preview-text p,
	.product-detail-preview-text div,
	.product-detail-preview-text span {
		text-align: left !important;
	}
}

/* слайдеры товаров («С этим товаром покупают» и др.): карточки одной высоты, кнопка внизу */
.catalog-offer-list .swiper-wrapper {
	align-items: stretch;
}
.catalog-offer-list .swiper-slide {
	height: auto;
	display: flex;
}
.catalog-offer-list .swiper-slide > .catalog-item,
.catalog-offer-list .catalog-item > .catalog-item-block-wrapper,
.catalog-offer-list .catalog-item-block-wrapper > .catalog-item-block-inner,
.catalog-offer-list .catalog-item-block-inner > .catalog-item-block--bottom,
.catalog-offer-list .catalog-item-block--bottom > .catalog-item-block-main {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	width: 100%;
}
.catalog-offer-list .catalog-item-block-main > .catalog-item-block-buttons {
	margin-top: auto;
}
