/* ======================================================
   CDEK Delivery Calculator (business)
   ====================================================== */

#cdek-calc-widget [hidden] { display: none !important; }

#cdek-calc-widget,
#cdek-calc-widget *,
#cdek-calc-widget *::before,
#cdek-calc-widget *::after {
	box-sizing: border-box;
}

.cdek-delivery-calc {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	width: 100%;
	color: #1a1a2e;
	background: #ffffff;
	border-radius: 1.2rem;
	padding: 4rem 8rem 2.2rem;
}

.cdc-title {
	margin: 0 0 11.8rem;
	font-family: 'Geologica', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-weight: 500;
	font-size: 4.8rem;
	line-height: 1.2;
	letter-spacing: -0.03em;
	color: #23211e;
}

/* ---- Two-column layout ---- */
.cdc-layout {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 2.4rem;
}

.cdc-layout-main {
	flex: 0 0 94rem;
	width: 94rem;
	max-width: 100%;
	min-width: 0;
}

.cdc-layout-sidebar {
	flex: 0 0 40rem;
	width: 40rem;
	position: sticky;
	top: 2rem;
}

/* ---- Params row ---- */
.cdc-params-row {
	display: flex;
	gap: 2rem;
	flex-wrap: wrap;
	margin-bottom: 4rem;
}

.cdc-field {
	flex: 1;
	min-width: 11rem;
}
.cdc-params-row .cdc-field {
	flex: 0 0 30rem;
	width: 30rem;
	min-width: 0;
}

.cdc-field--highlight {
	background: #E0FAE1;
	border-radius: 2rem;
	padding: 1.7rem 2.5rem;
}
.cdc-field--muted {
	background: #f5f6f7;
	border-radius: 2rem;
	padding: 1.7rem 2.5rem;
}

.cdc-field-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 1.9rem;
}

.cdc-field--highlight .cdc-label,
.cdc-field--muted .cdc-label {
	margin-bottom: 0;
}

.cdc-label {
	display: block;
	font-family: 'Geologica', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-weight: 300;
	font-size: 1.6rem;
	line-height: 1.5;
	letter-spacing: 0;
	color: #656462;
	margin-bottom: 0.6rem;
}

.cdc-input--plain {
	padding: 0;
	border: none;
	background: none;
	width: 100%;
	font-family: 'Geologica', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-weight: 300;
	font-size: 2.2rem;
	line-height: 1.5;
	letter-spacing: -0.01em;
	color: #23211e;
}
.cdc-input--plain:focus {
	outline: none;
	box-shadow: none;
}
.cdc-input--plain::placeholder {
	font-weight: 400;
	color: #9ca3af;
}

/* ---- Direction dropdown (same widget as DBS "Доставка") ---- */
.cdc-select-wrap {
	position: relative;
}
.cdc-mode-wrap {
	position: relative;
}
.cdc-select--plain {
	width: 100%;
	padding: 0 2.2rem 0 0;
	border: none;
	background: none;
	font-family: 'Geologica', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-weight: 300;
	font-size: 2.2rem;
	line-height: 1.5;
	letter-spacing: -0.01em;
	color: #23211e;
	appearance: none;
	-webkit-appearance: none;
	text-align: left;
	cursor: pointer;
}
.cdc-select--plain:focus {
	outline: none;
	box-shadow: none;
}
.cdc-select-wrap .cdc-select-arrow {
	position: absolute;
	right: 0;
	top: 50%;
	transform: translateY(-50%);
	display: inline-flex;
	pointer-events: none;
}

.cdc-mode-dropdown {
	position: absolute;
	top: calc(100% + 1rem);
	left: -1.8rem;
	right: -1.8rem;
	z-index: 20;
	background: #f5f6f7;
	border-radius: 2rem;
	padding: 1.2rem;
	box-shadow: 0 0.8rem 2.4rem rgba(0,0,0,0.1);
}
.cdc-mode-option {
	padding: 1.2rem 1.4rem;
	border-radius: 1.2rem;
	font-family: 'Geologica', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-weight: 300;
	font-size: 2.2rem;
	line-height: 1.5;
	letter-spacing: -0.01em;
	color: #23211e;
	cursor: pointer;
}
.cdc-mode-option:hover {
	background: #ecebe9;
}
.cdc-mode-option--active {
	color: #af5512;
}

/* ---- City autocomplete ---- */
.cdc-city-wrap {
	position: relative;
}

.cdc-route-arrow {
	position: absolute;
	top: 50%;
	left: calc(100% + 1rem);
	transform: translate(-50%, -50%);
	width: 4rem;
	height: 4rem;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	z-index: 1;
	pointer-events: none;
}
.cdc-route-arrow svg {
	display: block;
}

.cdc-city-suggestions {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	z-index: 200;
	background: #fff;
	border: 0.15rem solid #009b4f;
	border-top: none;
	border-radius: 0 0 0.8rem 0.8rem;
	list-style: none;
	margin: 0;
	padding: 0.4rem 0;
	box-shadow: 0 0.4rem 1.2rem rgba(0, 0, 0, 0.1);
}
.cdc-city-suggestions li a {
	display: block;
	padding: 0.8rem 1.2rem;
	font-size: 1.3rem;
	color: #1f2937;
	text-decoration: none;
	transition: background 0.1s;
}
.cdc-city-suggestions li a:hover {
	background: #f0fdf4;
	color: #009b4f;
}

/* ---- Package block (Груз) ---- */
.cdc-package-block {
	background: #f5f6f7;
	border-radius: 2rem;
	padding: 1.7rem 2.5rem;
	transition: background 0.15s;
	margin-bottom: 4rem;
}
.cdc-package-block--filled {
	background: #E0FAE1;
}

.cdc-package-block-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 1.9rem;
}

.cdc-package-block-label {
	font-family: 'Geologica', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-weight: 300;
	font-size: 1.6rem;
	line-height: 1.5;
	letter-spacing: 0;
	color: #656462;
}

.cdc-package-toggle-link {
	font-family: 'Geologica', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-weight: 400;
	font-size: 1.6rem;
	line-height: 1.5;
	letter-spacing: 0;
	color: #af5512;
	text-decoration: none;
	cursor: pointer;
}
.cdc-package-toggle-link:hover {
	text-decoration: underline;
}

.cdc-package-preset-mode {
	position: relative;
}

.cdc-package-select {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0;
	background: none;
	border: none;
	font-family: 'Geologica', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-weight: 300;
	font-size: 2.2rem;
	line-height: 1.5;
	letter-spacing: -0.01em;
	color: #a7a6a5;
	cursor: pointer;
	text-align: left;
}
.cdc-package-select-text--filled {
	color: #1a1a2e;
}
.cdc-package-select-name {
	position: relative;
	display: inline-flex;
	align-items: center;
	font-family: 'Geologica', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-weight: 300;
	font-size: 2.2rem;
	line-height: 1.5;
	letter-spacing: -0.01em;
	color: #656462;
}
.cdc-package-select-dims {
	display: inline-flex;
	align-items: baseline;
	gap: 3rem;
	min-width: 0;
	font-family: 'Geologica', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-weight: 300;
	font-size: 2.2rem;
	line-height: 1.5;
	letter-spacing: -0.01em;
	color: #23211e;
}
.cdc-dim-group {
	display: inline-flex;
	align-items: baseline;
	gap: 1rem;
}
.cdc-dim {
	display: inline-flex;
	align-items: baseline;
	gap: 0.2rem;
}
.cdc-dim--weight {
	color: #af5512;
}
.cdc-package-select-arrow {
	display: inline-flex;
	align-items: center;
	flex-shrink: 0;
	margin-left: 1rem;
}

.cdc-package-dropdown {
	position: absolute;
	top: calc(100% + 0.8rem);
	left: -2.5rem;
	right: -2.5rem;
	z-index: 20;
	background: #fff;
	border: 0.1rem solid #e5e7eb;
	border-radius: 1rem;
	max-height: 26rem;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 3.5rem;
	padding: 2.5rem;
	box-shadow: 0 0.8rem 2.4rem rgba(0,0,0,0.1);
	overflow-x: hidden;
}

.cdc-package-option {
	position: relative;
	display: grid;
	grid-template-columns: 15rem 4.5rem 3.7rem 1.5rem 3.7rem 1.5rem 3.7rem 4.5rem 5rem;
	align-items: center;
	padding: 0;
	font-size: 1.3rem;
	cursor: pointer;
}
.cdc-package-option:hover {
	background: #f5f6f7;
	color: #b95a13;
}
.cdc-package-option--header {
	font-family: 'Geologica', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-weight: 300;
	font-size: 2.2rem;
	line-height: 1.5;
	letter-spacing: -0.01em;
	color: #656462;
	cursor: default;
}
.cdc-package-option--header span:nth-child(1) { grid-column: 1; }
.cdc-package-option--header span:nth-child(2) { grid-column: 3; }
.cdc-package-option--header span:nth-child(3) { grid-column: 5; }
.cdc-package-option--header span:nth-child(4) { grid-column: 7; }
.cdc-package-option--header span:nth-child(5) { grid-column: 9; }
.cdc-package-option--header:hover {
	background: none;
	color: #9ca3af;
}
.cdc-package-option-name {
	position: relative;
	display: flex;
	align-items: center;
	grid-column: 1;
	font-family: 'Geologica', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-weight: 300;
	font-size: 2.2rem;
	line-height: 1.5;
	letter-spacing: -0.01em;
	color: #656462;
}
.cdc-package-option-dim {
	font-family: 'Geologica', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-weight: 300;
	font-size: 2.2rem;
	line-height: 1.5;
	letter-spacing: -0.01em;
	color: #23211e;
}
.cdc-package-option-name + .cdc-package-option-dim { grid-column: 3; }
.cdc-package-option-name + .cdc-package-option-dim + .cdc-package-option-dim { grid-column: 5; }
.cdc-package-option-name + .cdc-package-option-dim + .cdc-package-option-dim + .cdc-package-option-dim { grid-column: 7; }
.cdc-package-option-weight {
	grid-column: 9;
	font-family: 'Geologica', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-weight: 300;
	font-size: 2.2rem;
	line-height: 1.5;
	letter-spacing: -0.01em;
	color: #af5512;
}

/* ---- Info icon / tooltip ---- */
.cdc-info-icon {
	position: relative;
	display: inline-block;
	top: -0.8rem;
	margin-left: 0.2rem;
	font-family: 'Geologica', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-weight: 400;
	font-style: normal;
	font-size: 1.6rem;
	line-height: 1.5;
	letter-spacing: 0;
	color: #af5512;
	cursor: help;
}
.cdc-tooltip {
	display: none;
	position: absolute;
	bottom: calc(100% + 0.8rem);
	left: 50%;
	transform: translateX(-50%);
	background: #23211e;
	color: #fff;
	font-size: 1.4rem;
	font-weight: 400;
	font-style: normal;
	line-height: 1.4;
	padding: 1.2rem 1.6rem;
	border-radius: 1rem;
	white-space: normal;
	width: max-content;
	max-width: 26rem;
	z-index: 40;
	box-shadow: 0 0.4rem 1.2rem rgba(0,0,0,0.15);
	cursor: auto;
}
.cdc-info-icon:hover .cdc-tooltip,
.cdc-info-icon:focus .cdc-tooltip {
	display: block;
}

/* ---- Exact size mode ---- */
.cdc-exact-row {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 3rem;
}
.cdc-exact-field {
	display: inline-flex;
	align-items: baseline;
	gap: 0.2rem;
}
.cdc-exact-unit {
	font-family: 'Geologica', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-weight: 300;
	font-size: 2.2rem;
	line-height: 1.5;
	letter-spacing: -0.01em;
	color: #656462;
}
.cdc-exact-input {
	width: 9rem;
	padding: 0 0 0.2rem;
	border: none;
	border-bottom: 0.1rem solid #d8d7d5;
	background: none;
	font-family: 'Geologica', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-weight: 300;
	font-size: 2.2rem;
	line-height: 1.5;
	letter-spacing: -0.01em;
	color: #23211e;
	appearance: none;
	-moz-appearance: textfield;
}
.cdc-exact-input::-webkit-inner-spin-button,
.cdc-exact-input::-webkit-outer-spin-button {
	-webkit-appearance: none;
	margin: 0;
}
.cdc-exact-input:focus {
	outline: none;
	border-bottom-color: #af5512;
}
.cdc-exact-input::placeholder {
	color: #a7a6a5;
}

/* ---- Tariff tiles grid ---- */
.cdc-tariffs {
	display: flex;
	flex-wrap: wrap;
	gap: 2rem;
}

.cdc-tariff-tile {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	width: 22rem;
	height: 19.8rem;
	box-sizing: border-box;
	background: #f5f6f7;
	border: none;
	border-radius: 2rem;
	padding: 1.7rem 2.5rem;
	cursor: pointer;
	text-align: left;
	transition: background 0.15s;
	font-family: 'Geologica', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.cdc-tariff-tile--active {
	background: #E0FAE1;
}

.cdc-tariff-tile-price {
	font-weight: 500;
	font-size: 2.2rem;
	line-height: 1.5;
	letter-spacing: -0.01em;
	color: #23211e;
}

.cdc-tariff-tile-date {
	margin-top: 0.6rem;
	font-weight: 300;
	font-size: 1.6rem;
	line-height: 1.5;
	color: #656462;
}

.cdc-tariff-tile-route {
	margin-top: 0.8rem;
	font-weight: 300;
	font-size: 1.6rem;
	line-height: 1.3;
	color: #656462;
}

/* ---- Sidebar: total + button ---- */
.cdc-results {
	padding: 0;
}
.cdc-results-header {
	margin-bottom: 4rem;
}
.cdc-total-value {
	font-family: 'Geologica', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-weight: 500;
	font-size: 4.8rem;
	line-height: 1.2;
	letter-spacing: -0.03em;
	color: #af5512;
}
.cdc-results-note {
	margin-top: 0.4rem;
	font-family: 'Geologica', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-weight: 300;
	font-size: 2.2rem;
	line-height: 1.5;
	letter-spacing: -0.01em;
	color: #656462;
}

.cdc-btn-get {
	display: block;
	width: 100%;
	padding: 1.4rem 3rem 1.7rem;
	background: #faf6f0;
	color: #23211e;
	border: none;
	border-radius: 5rem;
	font-family: 'Geologica', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-weight: 400;
	font-size: 2rem;
	line-height: 1.5;
	letter-spacing: 0;
	cursor: pointer;
	text-align: center;
	transition: background 0.15s, transform 0.1s;
	margin-top: 5rem;
}
.cdc-btn-get:hover { background: #f2ebe1; }
.cdc-btn-get:active { transform: scale(0.98); }

/* ---- Loading ---- */
.cdc-loading {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 1.2rem;
	padding: 3.2rem 2rem;
	color: #6b7280;
}
.cdc-spinner {
	width: 2.2rem;
	height: 2.2rem;
	border: 0.3rem solid #e5e7eb;
	border-top-color: #af5512;
	border-radius: 50%;
	animation: cdc-spin 0.7s linear infinite;
}
@keyframes cdc-spin { to { transform: rotate(360deg); } }

/* ---- Error ---- */
.cdc-error {
	padding: 1.4rem 1.6rem;
	background: #fef2f2;
	border: 0.1rem solid #fecaca;
	border-radius: 0.8rem;
	color: #dc2626;
	font-size: 1.4rem;
}

/* ---- Responsive ---- */
@media (max-width: 576px) {
	.cdc-layout {
		flex-direction: column;
	}
	.cdc-layout-sidebar {
		width: 100%;
		flex: 1 1 auto;
		position: static;
	}
	.cdek-delivery-calc { padding: 1.6rem; }
	.cdc-field { min-width: 9rem; }
	.cdc-tariff-tile { width: 100%; height: auto; }
}
