/* ======================================================
   CDEK Fulfillment Calculator
   ====================================================== */

/* Prevent CSS display rules from overriding the hidden attribute */
#cdek-calculator [hidden] { display: none !important; }

.cdek-calc {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	max-width: 840px;
	background: #ffffff;
	border-radius: 12px;
	box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
	overflow: hidden;
	color: #1a1a2e;
}

/* ---- Tabs ---- */
.cdek-tabs {
	display: flex;
	background: #f5f7fa;
	border-bottom: 1px solid #e2e8f0;
	overflow-x: auto;
	scrollbar-width: none;
}
.cdek-tabs::-webkit-scrollbar { display: none; }

.cdek-tab {
	display: flex;
	align-items: center;
	gap: 7px;
	padding: 14px 20px;
	border: none;
	background: transparent;
	color: #6b7280;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	white-space: nowrap;
	border-bottom: 3px solid transparent;
	transition: color 0.15s, border-color 0.15s;
	outline: none;
}
.cdek-tab:hover {
	color: #009b4f;
}
.cdek-tab--active {
	color: #009b4f;
	border-bottom-color: #009b4f;
	background: #fff;
}
.cdek-tab svg { flex-shrink: 0; }

/* ---- Form ---- */
.cdek-form {
	padding: 24px;
}
.cdek-form-section {
	margin-bottom: 20px;
}
.cdek-section-title {
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #9ca3af;
	margin-bottom: 12px;
}

.cdek-fields-row {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
}

.cdek-field {
	flex: 1;
	min-width: 110px;
}
.cdek-field--currency {
	min-width: 200px;
}

.cdek-label {
	display: block;
	font-size: 13px;
	font-weight: 500;
	color: #374151;
	margin-bottom: 6px;
}

.cdek-input-wrap {
	position: relative;
	display: flex;
	align-items: center;
}
.cdek-input {
	width: 100%;
	padding: 10px 36px 10px 12px;
	border: 1.5px solid #d1d5db;
	border-radius: 8px;
	font-size: 15px;
	color: #111827;
	background: #fff;
	transition: border-color 0.15s, box-shadow 0.15s;
	box-sizing: border-box;
	appearance: none;
	-moz-appearance: textfield;
}
.cdek-input::-webkit-inner-spin-button,
.cdek-input::-webkit-outer-spin-button { opacity: 0; }
.cdek-input:focus {
	outline: none;
	border-color: #009b4f;
	box-shadow: 0 0 0 3px rgba(0, 155, 79, 0.12);
}
.cdek-unit {
	position: absolute;
	right: 10px;
	font-size: 12px;
	color: #9ca3af;
	pointer-events: none;
}

.cdek-select {
	width: 100%;
	padding: 10px 12px;
	border: 1.5px solid #d1d5db;
	border-radius: 8px;
	font-size: 14px;
	color: #111827;
	background: #fff;
	cursor: pointer;
	transition: border-color 0.15s;
}
.cdek-select:focus {
	outline: none;
	border-color: #009b4f;
	box-shadow: 0 0 0 3px rgba(0, 155, 79, 0.12);
}

.cdek-form-bottom {
	display: flex;
	align-items: flex-end;
	gap: 16px;
	flex-wrap: wrap;
	margin-top: 8px;
}

.cdek-btn-primary {
	flex-shrink: 0;
	padding: 12px 32px;
	background: #009b4f;
	color: #fff;
	border: none;
	border-radius: 8px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s, transform 0.1s;
	white-space: nowrap;
}
.cdek-btn-primary:hover { background: #007d3f; }
.cdek-btn-primary:active { transform: scale(0.98); }

.cdek-volume-hint {
	margin-top: 10px;
	font-size: 13px;
	color: #6b7280;
	min-height: 18px;
}

/* ---- Loading ---- */
.cdek-loading {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	padding: 32px;
	color: #6b7280;
}
.cdek-spinner {
	width: 24px;
	height: 24px;
	border: 3px solid #e5e7eb;
	border-top-color: #009b4f;
	border-radius: 50%;
	animation: cdek-spin 0.7s linear infinite;
}
@keyframes cdek-spin { to { transform: rotate(360deg); } }

/* ---- Error ---- */
.cdek-error {
	margin: 0 24px 24px;
	padding: 14px 16px;
	background: #fef2f2;
	border: 1px solid #fecaca;
	border-radius: 8px;
	color: #dc2626;
	font-size: 14px;
}

/* ---- Results ---- */
.cdek-results {
	border-top: 1px solid #e5e7eb;
	padding: 24px;
	background: #f9fafb;
}

.cdek-results-header {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 16px;
}
.cdek-results-title {
	margin: 0;
	font-size: 17px;
	font-weight: 700;
	color: #111827;
}
.cdek-results-mode {
	font-size: 13px;
	color: #6b7280;
	background: #e5e7eb;
	padding: 3px 10px;
	border-radius: 20px;
}

.cdek-breakdown {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin-bottom: 16px;
}

.cdek-breakdown-row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	padding: 10px 0;
	border-bottom: 1px solid #e5e7eb;
	gap: 12px;
}
.cdek-breakdown-row:last-child { border-bottom: none; }

.cdek-row-info { flex: 1; }
.cdek-row-label {
	font-weight: 600;
	font-size: 14px;
	color: #1f2937;
}
.cdek-row-detail {
	font-size: 12px;
	color: #6b7280;
	margin-top: 2px;
}
.cdek-row-price {
	font-size: 15px;
	font-weight: 700;
	color: #1f2937;
	white-space: nowrap;
}

.cdek-total-block {
	background: #fff;
	border-radius: 8px;
	padding: 4px 16px;
	margin-bottom: 12px;
	box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.cdek-total-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 14px 0;
}
.cdek-total-label {
	font-size: 15px;
	font-weight: 600;
	color: #374151;
}
.cdek-total-value {
	font-size: 24px;
	font-weight: 800;
	color: #009b4f;
}

.cdek-disclaimer {
	font-size: 12px;
	color: #9ca3af;
	margin: 0;
	line-height: 1.5;
}

/* ---- Responsive ---- */
@media (max-width: 560px) {
	.cdek-tab { padding: 12px 14px; font-size: 13px; }
	.cdek-form { padding: 16px; }
	.cdek-fields-row { gap: 10px; }
	.cdek-field { min-width: 90px; }
	.cdek-form-bottom { flex-direction: column; }
	.cdek-btn-primary { width: 100%; text-align: center; }
	.cdek-results { padding: 16px; }
}
