/* ==============================================
   MN Smart Checkout — Styles
   ============================================== */

/* ------------------------------------------
   Estimator Widget Wrapper
------------------------------------------ */
.mnsc-estimator {
	background: #ffffff;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	padding: 28px;
	font-family: inherit;
}

.mnsc-estimator-title {
	font-size: 1.15em;
	font-weight: 700;
	color: #111827;
	margin: 0 0 20px;
	padding-bottom: 14px;
	border-bottom: 2px solid #e5e7eb;
}

/* ------------------------------------------
   Form Fields
------------------------------------------ */
.mnsc-field-group {
	margin-bottom: 16px;
}

.mnsc-field-label {
	display: block;
	font-size: 0.875em;
	font-weight: 600;
	color: #374151;
	margin-bottom: 6px;
}

.mnsc-input {
	width: 100%;
	padding: 10px 14px;
	border: 1.5px solid #d1d5db;
	border-radius: 8px;
	font-size: 0.9375em;
	color: #111827;
	background: #ffffff;
	transition: border-color 0.2s, box-shadow 0.2s;
	box-sizing: border-box;
	-webkit-appearance: none;
}

.mnsc-input:focus {
	outline: none;
	border-color: #2563eb;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* ------------------------------------------
   Area Search (Kecamatan/Kelurahan)
------------------------------------------ */
.mnsc-area-search-container {
	position: relative;
}

.mnsc-area-spinner {
	position: absolute;
	right: 12px;
	top: 50%;
	transform: translateY(-50%);
	width: 16px;
	height: 16px;
	border: 2px solid #e5e7eb;
	border-top-color: #2563eb;
	border-radius: 50%;
	animation: mnsc-spin 0.65s linear infinite;
}

.mnsc-area-dropdown {
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	right: 0;
	background: #ffffff;
	border: 1.5px solid #d1d5db;
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
	max-height: 260px;
	overflow-y: auto;
	z-index: 10000;
}

.mnsc-dropdown-item {
	padding: 10px 14px;
	cursor: pointer;
	transition: background 0.15s;
	border-bottom: 1px solid #f3f4f6;
}

.mnsc-dropdown-item:last-child {
	border-bottom: none;
}

.mnsc-dropdown-item:hover {
	background: #f0f4ff;
}

.mnsc-dropdown-item-sub {
	display: block;
	font-weight: 700;
	font-size: 0.875em;
	color: #111827;
}

.mnsc-dropdown-item-loc {
	display: block;
	font-size: 0.78em;
	color: #6b7280;
	margin-top: 2px;
}

.mnsc-dropdown-msg {
	padding: 12px 14px;
	color: #6b7280;
	font-size: 0.875em;
	text-align: center;
}

/* Area selected badge */
.mnsc-area-selected-badge {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 9px 13px;
	background: #eff6ff;
	border: 1.5px solid #bfdbfe;
	border-radius: 8px;
	margin-top: 6px;
}

.mnsc-area-selected-text {
	flex: 1;
	font-size: 0.875em;
	color: #1d4ed8;
	font-weight: 600;
}

.mnsc-area-clear-btn {
	background: none;
	border: 1px solid #bfdbfe;
	border-radius: 5px;
	color: #6b7280;
	cursor: pointer;
	font-size: 0.78em;
	padding: 3px 8px;
	transition: all 0.15s;
}

.mnsc-area-clear-btn:hover {
	background: #fee2e2;
	border-color: #fca5a5;
	color: #dc2626;
}

/* ------------------------------------------
   Button
------------------------------------------ */
.mnsc-form-footer {
	margin-top: 22px;
}

.mnsc-check-btn {
	width: 100%;
	padding: 13px 24px;
	background: #2563eb;
	color: #ffffff;
	border: none;
	border-radius: 8px;
	font-size: 0.9375em;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
	letter-spacing: 0.01em;
}

.mnsc-check-btn:hover {
	background: #1d4ed8;
	box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.mnsc-check-btn:active {
	transform: scale(0.98);
}

.mnsc-check-btn:disabled {
	opacity: 0.65;
	cursor: not-allowed;
}

/* ------------------------------------------
   Results Section
------------------------------------------ */
.mnsc-results {
	margin-top: 22px;
	border-top: 1.5px solid #e5e7eb;
	padding-top: 18px;
}

.mnsc-results-loading {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 0;
	color: #6b7280;
	font-size: 0.875em;
}

.mnsc-spinner {
	display: inline-block;
	width: 18px;
	height: 18px;
	border: 2.5px solid #e5e7eb;
	border-top-color: #2563eb;
	border-radius: 50%;
	animation: mnsc-spin 0.65s linear infinite;
	flex-shrink: 0;
}

.mnsc-results-error {
	padding: 12px 16px;
	background: #fef2f2;
	border: 1.5px solid #fecaca;
	border-radius: 8px;
	color: #dc2626;
	font-size: 0.875em;
}

/* ------------------------------------------
   Rate Cards
------------------------------------------ */
.mnsc-rates-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.mnsc-rates-header {
	font-size: 0.8em;
	font-weight: 600;
	color: #6b7280;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	margin-bottom: 4px;
}

.mnsc-rate-card {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 16px;
	background: #f8faff;
	border: 1.5px solid #e5e7eb;
	border-radius: 10px;
	cursor: pointer;
	transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.mnsc-rate-card:hover {
	border-color: #93c5fd;
	background: #eff6ff;
}

.mnsc-rate-card.is-selected {
	border-color: #2563eb;
	background: #eff6ff;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.mnsc-rate-info {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
}

.mnsc-rate-name {
	font-weight: 700;
	font-size: 0.9em;
	color: #111827;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.mnsc-rate-eta {
	font-size: 0.775em;
	color: #6b7280;
}

.mnsc-rate-price {
	font-weight: 800;
	font-size: 0.975em;
	color: #2563eb;
	white-space: nowrap;
	flex-shrink: 0;
}

/* ------------------------------------------
   WC Checkout Area Search UI
------------------------------------------ */
.mnsc-area-wrap {
	margin-top: 8px;
	margin-bottom: 16px;
}

.mnsc-area-row {
	margin-bottom: 0 !important;
}

/* ------------------------------------------
   Spinner animation
------------------------------------------ */
@keyframes mnsc-spin {
	to { transform: rotate(360deg); }
}

.mnsc-area-spinner {
	animation: mnsc-spin 0.65s linear infinite;
}

/* ------------------------------------------
   Responsive
------------------------------------------ */
@media (max-width: 600px) {
	.mnsc-estimator {
		padding: 18px;
	}

	.mnsc-rate-card {
		flex-direction: row;
		flex-wrap: nowrap;
	}

	.mnsc-rate-name {
		font-size: 0.825em;
	}

	.mnsc-rate-price {
		font-size: 0.9em;
	}
}
