/* ===========================================================
 * WC Delhivery Track — Frontend Styles
 * Scoped under .wcdt-track-widget and .wcdt-footer-widget
 * =========================================================== */

.wcdt-track-widget,
.wcdt-footer-widget {
	--wcdt-accent: #2dd4bf;
	--wcdt-accent-hover: #14b8a6;
	--wcdt-success: #10b981;
	--wcdt-success-bg: #d1fae5;
	--wcdt-warning: #f59e0b;
	--wcdt-danger: #ef4444;
	--wcdt-text: #1e293b;
	--wcdt-muted: #64748b;
	--wcdt-border: #e2e8f0;
	--wcdt-bg-card: #f8fafc;
	--wcdt-bg-step-inactive: #cbd5e1;

	font-family: inherit;
	color: var(--wcdt-text);
	line-height: 1.5;
	box-sizing: border-box;
}

.wcdt-track-widget *,
.wcdt-track-widget *::before,
.wcdt-track-widget *::after,
.wcdt-footer-widget *,
.wcdt-footer-widget *::before,
.wcdt-footer-widget *::after {
	box-sizing: border-box;
}

/* -----------------------------------------------------------
 * FULL TRACK SHORTCODE
 * --------------------------------------------------------- */
.wcdt-track-widget {
	max-width: 100%;
	margin: 0 auto;
	padding: 20px 0;
}

.wcdt-track-heading {
	font-size: 18px;
	margin: 0 0 16px;
	color: var(--wcdt-muted);
}

.wcdt-track-form {
	display: flex;
	gap: 12px;
	margin-bottom: 24px;
	flex-wrap: wrap;
}

.wcdt-track-input {
	flex: 0 1 280px;
	padding: 10px 14px;
	border: 1px solid var(--wcdt-border);
	border-radius: 6px;
	font-size: 15px;
	outline: none;
	transition: border-color 0.15s;
}

.wcdt-track-input:focus {
	border-color: var(--wcdt-accent);
}

.wcdt-track-btn {
	padding: 10px 32px;
	background: var(--wcdt-accent);
	color: #fff;
	border: none;
	border-radius: 999px;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.5px;
	cursor: pointer;
	transition: background 0.15s;
}

.wcdt-track-btn:hover:not(:disabled) {
	background: var(--wcdt-accent-hover);
}

.wcdt-track-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* Result summary card */
.wcdt-summary-card {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 20px;
	background: var(--wcdt-bg-card);
	padding: 24px;
	border-radius: 8px;
	margin-bottom: 32px;
	flex-wrap: wrap;
}

.wcdt-summary-left h3 {
	margin: 0 0 12px;
	font-size: 28px;
	font-weight: 700;
	color: var(--wcdt-text);
}

.wcdt-summary-meta {
	margin: 4px 0;
	font-size: 14px;
	color: var(--wcdt-muted);
}

.wcdt-summary-meta strong {
	color: var(--wcdt-text);
}

.wcdt-summary-meta a {
	color: #2563eb;
	text-decoration: none;
	font-weight: 600;
}

.wcdt-summary-meta a:hover {
	text-decoration: underline;
}

.wcdt-eta-box {
	background: var(--wcdt-success-bg);
	color: var(--wcdt-success);
	padding: 12px 20px;
	border-radius: 6px;
	text-align: center;
	min-width: 160px;
}

.wcdt-eta-label {
	font-size: 12px;
	font-weight: 500;
	display: block;
	margin-bottom: 4px;
}

.wcdt-eta-date {
	font-size: 18px;
	font-weight: 700;
	display: block;
}

/* Exception/RTO state for ETA box */
.wcdt-eta-box.is-exception {
	background: #fef3c7;
	color: #b45309;
}

/* Progress bar (5 steps) */
.wcdt-progress {
	display: flex;
	justify-content: space-between;
	position: relative;
	margin: 32px 0;
	padding: 0 4%;
}

.wcdt-progress::before {
	content: '';
	position: absolute;
	top: 7px;
	left: 4%;
	right: 4%;
	height: 2px;
	background: var(--wcdt-border);
	z-index: 0;
}

.wcdt-step {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	flex: 1;
	text-align: center;
}

.wcdt-step-dot {
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: var(--wcdt-bg-step-inactive);
	margin-bottom: 8px;
	transition: background 0.3s;
}

.wcdt-step.is-active .wcdt-step-dot {
	background: var(--wcdt-success);
}

.wcdt-step.is-exception .wcdt-step-dot {
	background: var(--wcdt-warning);
}

.wcdt-step-label {
	font-size: 13px;
	color: var(--wcdt-muted);
}

.wcdt-step.is-active .wcdt-step-label {
	color: var(--wcdt-text);
	font-weight: 500;
}

/* Timeline */
.wcdt-timeline {
	margin: 24px 0 0;
	padding: 0 0 0 20px;
	list-style: none;
	position: relative;
}

.wcdt-timeline::before {
	content: '';
	position: absolute;
	left: 5px;
	top: 8px;
	bottom: 8px;
	width: 2px;
	background: var(--wcdt-border);
}

.wcdt-timeline-item {
	position: relative;
	margin-bottom: 16px;
	padding: 16px 20px;
	background: #fff;
	border: 1px solid var(--wcdt-border);
	border-radius: 6px;
}

.wcdt-timeline-item::before {
	content: '';
	position: absolute;
	left: -20px;
	top: 22px;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--wcdt-success);
	border: 2px solid #fff;
	box-shadow: 0 0 0 1px var(--wcdt-success);
}

.wcdt-timeline-title {
	margin: 0 0 4px;
	font-size: 15px;
	font-weight: 600;
	color: var(--wcdt-text);
}

.wcdt-timeline-location {
	margin: 0 0 8px;
	font-size: 14px;
	color: var(--wcdt-muted);
}

.wcdt-timeline-time {
	margin: 0;
	font-size: 13px;
	color: var(--wcdt-muted);
}

/* Powered-by footer link */
.wcdt-powered-by {
	margin-top: 24px;
	text-align: right;
	font-size: 12px;
	color: var(--wcdt-muted);
}

.wcdt-powered-by a {
	color: #2563eb;
	text-decoration: none;
}

.wcdt-powered-by a:hover {
	text-decoration: underline;
}

/* Error / loading states */
.wcdt-error {
	padding: 12px 16px;
	background: #fef2f2;
	color: #b91c1c;
	border: 1px solid #fecaca;
	border-radius: 6px;
	font-size: 14px;
	margin-top: 12px;
}

.wcdt-loading {
	padding: 20px;
	text-align: center;
	color: var(--wcdt-muted);
	font-size: 14px;
}

/* -----------------------------------------------------------
 * FOOTER SHORTCODE — input + button + 3-line status
 * --------------------------------------------------------- */
.wcdt-footer-widget {
	font-size: 14px;
	max-width: 100%;
}

.wcdt-footer-form {
	display: flex;
	gap: 8px;
	margin-bottom: 12px;
	flex-wrap: wrap;
}

.wcdt-footer-input {
	flex: 1 1 140px;
	min-width: 0;
	padding: 8px 12px;
	border: 1px solid var(--wcdt-border);
	border-radius: 6px;
	font-size: 14px;
	outline: none;
	transition: border-color 0.15s;
	background: #fff;
}

.wcdt-footer-input:focus {
	border-color: var(--wcdt-accent);
}

.wcdt-footer-widget .wcdt-footer-btn,
button.wcdt-footer-btn {
	padding: 8px 20px;
	background: var(--wcdt-accent) !important;
	background-color: var(--wcdt-accent) !important;
	color: #fff !important;
	border: none !important;
	border-radius: 999px !important;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.5px;
	cursor: pointer;
	transition: background 0.15s;
	white-space: nowrap;
	box-shadow: none;
	text-transform: uppercase;
}

.wcdt-footer-widget .wcdt-footer-btn:hover:not(:disabled),
button.wcdt-footer-btn:hover:not(:disabled) {
	background: var(--wcdt-accent-hover) !important;
	background-color: var(--wcdt-accent-hover) !important;
	color: #fff !important;
}

.wcdt-footer-widget .wcdt-footer-btn:disabled,
button.wcdt-footer-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

.wcdt-footer-result {
	font-size: 13px;
	line-height: 1.6;
}

.wcdt-footer-row {
	display: flex;
	gap: 6px;
	margin: 2px 0;
}

.wcdt-footer-row-label {
	color: var(--wcdt-muted);
	font-weight: 500;
	flex-shrink: 0;
}

.wcdt-footer-row-value {
	color: var(--wcdt-text);
	word-break: break-word;
}

.wcdt-footer-loading {
	color: var(--wcdt-muted);
	font-style: italic;
	font-size: 13px;
}

.wcdt-footer-error {
	color: #b91c1c;
	font-size: 13px;
	padding: 8px 10px;
	background: #fef2f2;
	border: 1px solid #fecaca;
	border-radius: 4px;
}

/* -----------------------------------------------------------
 * MOBILE RESPONSIVE
 * --------------------------------------------------------- */
@media (max-width: 640px) {
	.wcdt-summary-card {
		flex-direction: column;
	}

	.wcdt-eta-box {
		width: 100%;
	}

	.wcdt-step-label {
		font-size: 11px;
	}

	.wcdt-progress {
		padding: 0 2%;
	}
}
