/* СДЭК v2 — окно выбора пункта выдачи. Цвета: СДЭК #1ab248, постамат #0a7a3a, поиск #e0282e. */

.cdd-choose {
	display: inline-block;
	min-height: 40px;
	margin: 4px 0 6px 22px;
	padding: 4px 12px;
	border: 1px solid #1ab248;
	border-radius: 4px;
	background: #fff;
	color: #13893a;
	font-size: 13px;
	font-weight: normal;
	line-height: 1.4;
	cursor: pointer;
}
.cdd-choose:hover { background: #1ab248; color: #fff; }

body.cdd-open { overflow: hidden; }

.cdd-overlay {
	display: none;
	position: fixed;
	top: 0; right: 0; bottom: 0; left: 0;
	/* Выше виджетов чатов и cookie-плашек сайта (у них бывает 999999). */
	z-index: 2147483000;
	background: rgba(0, 0, 0, .5);
}
.cdd-modal {
	position: absolute;
	top: 50%; left: 50%;
	width: 1100px;
	max-width: calc(100% - 40px);
	height: 85vh;
	max-height: 800px;
	transform: translate(-50%, -50%);
	display: flex;
	flex-direction: column;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, .3);
	font-size: 14px;
	line-height: 1.4;
	color: #222;
	overflow: hidden;
}
.cdd-modal * { box-sizing: border-box; }

.cdd-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 8px 8px 8px 16px;
	border-bottom: 1px solid #eee;
}
.cdd-title { font-size: 17px; font-weight: bold; }
.cdd-close {
	width: 40px;
	height: 40px;
	min-height: 40px;
	padding: 0;
	border: 0;
	background: none;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	color: #888;
}
.cdd-close:hover { color: #222; }

.cdd-search {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 12px 16px 0;
	margin: 0;
}
.cdd-search input {
	height: 40px;
	padding: 0 10px;
	border: 1px solid #ccc;
	border-radius: 4px;
	font-size: 14px;
}
.cdd-search input:focus { border-color: #1ab248; outline: none; }
.cdd-city { flex: 0 1 200px; }
.cdd-query { flex: 1 1 260px; }
.cdd-find, .cdd-select {
	min-height: 40px;
	padding: 0 16px;
	border: 0;
	border-radius: 4px;
	background: #1ab248;
	color: #fff;
	font-size: 14px;
	cursor: pointer;
	white-space: nowrap;
}
.cdd-find:hover, .cdd-select:hover { background: #13893a; }
.cdd-select { padding: 0 12px; }
.cdd-select[disabled] { opacity: .5; cursor: default; }
/* «Найти» — текстом, на телефоне — значком; «Рядом со мной» — значком и текстом. */
.cdd-find .cdd-icon { display: none; }
.cdd-find, .cdd-near { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.cdd-near {
	min-height: 40px;
	padding: 0 12px;
	border: 1px solid #1ab248;
	border-radius: 4px;
	background: #fff;
	color: #13893a;
	font-size: 14px;
	cursor: pointer;
	white-space: nowrap;
}
.cdd-near:hover { background: #f4fbf6; }
.cdd-near[disabled], .cdd-near.cdd-busy { opacity: .6; cursor: progress; }
.cdd-icon { flex: 0 0 auto; display: block; }

.cdd-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 8px;
	padding: 8px 16px;
}
.cdd-filters {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 4px 18px;
	min-width: 0;
}
.cdd-types label { margin: 0 14px 0 0; font-weight: normal; cursor: pointer; }
.cdd-types label:last-child { margin-right: 0; }
.cdd-cod { margin: 0; font-weight: normal; cursor: pointer; }
.cdd-cod input { margin: 0 4px 0 0; vertical-align: -2px; }
.cdd-tabs { display: none; }
.cdd-tab {
	min-height: 40px;
	padding: 5px 14px;
	border: 1px solid #1ab248;
	background: #fff;
	color: #13893a;
	cursor: pointer;
}
.cdd-tab:first-child { border-radius: 4px 0 0 4px; }
.cdd-tab:last-child { border-radius: 0 4px 4px 0; margin-left: -1px; }
.cdd-tab-active { background: #1ab248; color: #fff; }

.cdd-body {
	flex: 1;
	min-height: 0;
	display: flex;
	border-top: 1px solid #eee;
}
.cdd-list {
	width: 380px;
	flex: 0 0 380px;
	overflow-y: auto;
	border-right: 1px solid #eee;
	-webkit-overflow-scrolling: touch;
}
.cdd-map { position: relative; flex: 1; min-width: 0; }
.cdd-map-canvas { position: absolute; top: 0; right: 0; bottom: 0; left: 0; }
.cdd-map-msg {
	display: none;
	position: absolute;
	top: 12px; left: 50%;
	transform: translateX(-50%);
	z-index: 1000;
	padding: 6px 12px;
	border-radius: 4px;
	background: rgba(255, 255, 255, .95);
	box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
}
.cdd-no-map .cdd-map { display: none; }
.cdd-no-map .cdd-list { width: auto; flex: 1; border-right: 0; }

.cdd-point {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 16px;
	border-bottom: 1px solid #f2f2f2;
	cursor: pointer;
}
.cdd-point:hover { background: #f4fbf6; }
.cdd-point.cdd-active { background: #e7f7ec; }
.cdd-point.cdd-current { box-shadow: inset 3px 0 0 #1ab248; }
.cdd-point-info { flex: 1; min-width: 0; }
.cdd-point-type { font-size: 12px; color: #13893a; }
.cdd-point-type.cdd-type-postamat { color: #0a7a3a; font-weight: bold; }
.cdd-point-address { word-wrap: break-word; }
.cdd-point-schedule, .cdd-point-metro, .cdd-point-code { font-size: 12px; color: #666; margin-top: 2px; }
.cdd-point-comment {
	font-size: 12px;
	color: #888;
	margin-top: 2px;
	word-wrap: break-word;
	/* В списке — не больше двух строк; в балуне — целиком. */
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.cdd-point-comment.cdd-full { display: block; -webkit-line-clamp: none; overflow: visible; }
.cdd-point-extra { font-size: 12px; color: #888; margin-top: 2px; }
.cdd-balloon { font-size: 14px; line-height: 1.4; max-width: 280px; }
.cdd-balloon .cdd-select { margin-top: 8px; }
.cdd-msg { padding: 20px 16px; color: #666; }
.cdd-error { color: #c00; }
.cdd-nearest { padding: 10px 16px; background: #fff8e5; color: #7a5a00; }
.cdd-notice { padding: 10px 16px; }
.cdd-hint {
	padding: 10px 16px;
	border-bottom: 1px solid #f3e6c0;
	background: #fff8e5;
	color: #7a5a00;
	font-size: 13px;
}

/* Метки Leaflet (размер задаёт скрипт: 16px, на сенсорном экране 24px) */
.cdd-pin {
	border: 2px solid #fff;
	border-radius: 50%;
	background: #1ab248;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .4);
}
.cdd-pin-pvz { background: #1ab248; }
.cdd-pin-postamat { background: #0a7a3a; }
.cdd-pin-search { background: #e0282e; }

/* Подсказки городов */
.cdd-city-wrap { position: relative; flex: 0 1 220px; }
.cdd-city-wrap .cdd-city { width: 100%; }
.cdd-suggest {
	position: absolute;
	top: calc(100% + 2px); left: 0;
	z-index: 1100;
	min-width: 100%;
	width: max-content;
	max-width: min(420px, 90vw);
	max-height: 320px;
	overflow-y: auto;
	margin: 0; padding: 4px 0;
	list-style: none;
	background: #fff;
	border: 1px solid #ccc;
	border-radius: 4px;
	box-shadow: 0 6px 20px rgba(0, 0, 0, .15);
}
.cdd-suggest[hidden] { display: none; }
.cdd-suggest li {
	display: flex; justify-content: space-between; gap: 12px;
	padding: 7px 12px;
	cursor: pointer;
	line-height: 1.3;
}
.cdd-suggest li:hover, .cdd-suggest li.cdd-active { background: #e7f7ec; }
.cdd-suggest mark { background: none; color: inherit; font-weight: bold; padding: 0; }
.cdd-suggest-region { color: #888; font-size: 12px; white-space: nowrap; }

/* Карточка товара: «Доставка СДЭК: Город (изменить)» */
.cdd-product {
	margin: 12px 0;
	padding: 10px 12px;
	border: 1px solid #d3eedc;
	border-radius: 6px;
	background: #f5fbf7;
	font-size: 14px;
	line-height: 1.4;
	color: #222;
}
.cdd-product * { box-sizing: border-box; }
.cdd-product-title { color: #13893a; font-weight: bold; }
.cdd-product-change { font-size: 12px; margin-left: 4px; }
.cdd-product-quote { color: #333; margin-top: 2px; }
.cdd-product-form { margin-top: 8px; }
.cdd-product-form[hidden] { display: none; }
.cdd-product .cdd-city-wrap { max-width: 320px; }
.cdd-product .cdd-product-city {
	width: 100%;
	height: 40px;
	padding: 0 10px;
	border: 1px solid #ccc;
	border-radius: 4px;
	font-size: 14px;
}
.cdd-product .cdd-product-city:focus { border-color: #1ab248; outline: none; }

/*
 * Телефон: шапка окна (заголовок 44 px + строка поиска + строка фильтров) — не выше 150 px
 * при 375×812. Город и адрес — в одной строке, «Найти» и «Рядом» — значки 40×40;
 * фильтры и вкладки — в одной строке, фильтры при нехватке места листаются вбок
 * внутри своей полосы (страница вбок не прокручивается).
 */
@media (max-width: 767px) {
	.cdd-modal {
		top: 0; left: 0;
		width: 100%; max-width: 100%;
		height: 100%; max-height: none;
		transform: none;
		border-radius: 0;
	}
	.cdd-head {
		flex: 0 0 auto;
		height: 44px;
		padding: 2px 2px 2px 12px;
	}
	.cdd-title {
		min-width: 0;
		font-size: 16px;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}
	.cdd-close { flex: 0 0 40px; }

	.cdd-search {
		flex: 0 0 auto;
		flex-wrap: nowrap;
		gap: 6px;
		padding: 6px 12px 0;
	}
	.cdd-search input { min-width: 0; padding: 0 8px; }
	.cdd-city-wrap { flex: 0 1 38%; min-width: 0; }
	.cdd-query { flex: 1 1 0; width: 0; }
	.cdd-find, .cdd-near {
		flex: 0 0 40px;
		width: 40px;
		height: 40px;
		padding: 0;
	}
	.cdd-find .cdd-icon { display: block; }
	.cdd-find .cdd-btn-text, .cdd-near .cdd-btn-text { display: none; }

	.cdd-bar {
		flex: 0 0 auto;
		flex-wrap: nowrap;
		gap: 6px;
		padding: 6px 12px;
	}
	.cdd-filters {
		flex: 1 1 auto;
		flex-wrap: nowrap;
		gap: 4px;
		overflow-x: auto;
		overflow-y: hidden;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
	}
	.cdd-filters::-webkit-scrollbar { display: none; }
	.cdd-filters.cdd-more {
		-webkit-mask-image: linear-gradient(to right, #000 80%, transparent);
		mask-image: linear-gradient(to right, #000 80%, transparent);
	}
	/* Фильтр типов — кнопками: кружки радио скрыты, выбранная кнопка залита. */
	.cdd-types { display: flex; flex: 0 0 auto; gap: 4px; }
	.cdd-types label { position: relative; display: flex; margin: 0; }
	.cdd-types input {
		position: absolute;
		top: 0; left: 0;
		width: 1px; height: 1px;
		margin: 0;
		opacity: 0;
	}
	.cdd-type-text {
		display: flex;
		align-items: center;
		min-height: 40px;
		max-width: 110px;
		padding: 2px 8px;
		border: 1px solid #1ab248;
		border-radius: 4px;
		background: #fff;
		color: #13893a;
		font-size: 13px;
		line-height: 1.15;
	}
	.cdd-types input:checked + .cdd-type-text { background: #1ab248; color: #fff; }
	.cdd-types input:focus + .cdd-type-text { box-shadow: 0 0 0 2px rgba(26, 178, 72, .35); }
	.cdd-brand { display: none; }
	/* Оплата при получении — первой: она важнее типа пункта. */
	.cdd-cod {
		order: -1;
		display: flex;
		align-items: center;
		flex: 0 0 auto;
		max-width: 150px;
		min-height: 40px;
		padding: 2px 8px;
		border: 1px solid #ccc;
		border-radius: 4px;
		font-size: 13px;
		line-height: 1.15;
	}
	.cdd-cod input { flex: 0 0 auto; width: 18px; height: 18px; margin: 0 6px 0 0; }
	.cdd-cod.cdd-cod-on { border-color: #1ab248; background: #e7f7ec; }
	.cdd-tabs { display: flex; flex: 0 0 auto; }
	.cdd-tab { padding: 0 10px; font-size: 14px; }

	.cdd-list { width: auto; flex: 1; border-right: 0; }
	.cdd-view-map .cdd-list { display: none; }
	.cdd-view-list .cdd-map { display: none; }
	/* Шрифт меньше 16px заставляет iPhone приближать страницу при вводе. */
	.cdd-search input, .cdd-product .cdd-product-city { font-size: 16px; }
	.cdd-choose { padding: 9px 16px; font-size: 15px; }
}
