/* ============================================================
   WooCommerce Order Tracking – Frontend Styles
   ============================================================ */

:root {
	--wcot-primary:   #7952b3;
	--wcot-success:   #2ecc71;
	--wcot-warning:   #f39c12;
	--wcot-danger:    #e74c3c;
	--wcot-muted:     #adb5bd;
	--wcot-bg:        #f8f9fa;
	--wcot-border:    #dee2e6;
	--wcot-radius:    10px;
	--wcot-shadow:    0 4px 20px rgba(0,0,0,.08);
}

/* ---- Wrapper ---- */
.wcot-tracking-wrap {
	max-width: 720px;
	margin: 0 auto;
	padding: 2rem 1rem;
}

/* ---- Order meta ---- */
.wcot-order-meta {
	display: flex;
	align-items: baseline;
	gap: .75rem;
	flex-wrap: wrap;
	margin-bottom: 2rem;
}
.wcot-order-meta h2 { margin: 0; }
.wcot-order-date { color: #666; font-size: .9rem; }

/* ---- Timeline ---- */
.wcot-timeline {
	display: flex;
	align-items: flex-start;
	justify-content: center;
	gap: 0;
	margin-bottom: 1.5rem;
	flex-wrap: nowrap;
	overflow-x: auto;
	padding-bottom: .5rem;
}

.wcot-step {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: .35rem;
	min-width: 90px;
	text-align: center;
	position: relative;
}

.wcot-step__icon {
	width: 52px; height: 52px;
	border-radius: 50%;
	display: flex; align-items: center; justify-content: center;
	font-size: 1.4rem;
	border: 3px solid var(--wcot-border);
	background: #fff;
	transition: all .3s ease;
	position: relative;
	z-index: 1;
}

.wcot-step--done .wcot-step__icon {
	background: var(--wcot-success);
	border-color: var(--wcot-success);
	color: #fff;
	font-size: 1.2rem;
}

.wcot-step--active .wcot-step__icon {
	background: var(--wcot-primary);
	border-color: var(--wcot-primary);
	color: #fff;
	box-shadow: 0 0 0 5px rgba(121,82,179,.2);
	animation: wcot-pulse 2s infinite;
}

.wcot-step--pending .wcot-step__icon {
	background: #fff;
	color: var(--wcot-muted);
}

@keyframes wcot-pulse {
	0%, 100% { box-shadow: 0 0 0 5px rgba(121,82,179,.2); }
	50%       { box-shadow: 0 0 0 10px rgba(121,82,179,.05); }
}

.wcot-step__label {
	font-size: .78rem;
	font-weight: 600;
	color: #555;
	white-space: nowrap;
}
.wcot-step--done .wcot-step__label   { color: var(--wcot-success); }
.wcot-step--active .wcot-step__label { color: var(--wcot-primary); }
.wcot-step--pending .wcot-step__label{ color: var(--wcot-muted); }

.wcot-step__current-badge {
	background: var(--wcot-primary);
	color: #fff;
	font-size: .65rem;
	padding: 2px 8px;
	border-radius: 20px;
	font-weight: 700;
	letter-spacing: .04em;
}

.wcot-step__detail { font-size: .72rem; color: #888; margin-top: .2rem; line-height: 1.4; }

/* Connector line */
.wcot-step__connector {
	flex: 1;
	height: 3px;
	background: var(--wcot-border);
	margin-top: 24px; /* align with icon center */
	min-width: 24px;
	position: relative;
	overflow: hidden;
	border-radius: 3px;
}
.wcot-step__connector--done {
	background: var(--wcot-success);
}
.wcot-step__connector-fill {
	position: absolute;
	left: 0; top: 0; bottom: 0;
	background: linear-gradient(90deg, var(--wcot-success), var(--wcot-primary));
	border-radius: 3px;
	transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
	width: 0%; /* animated in by JS */
}
.wcot-step__connector--done .wcot-step__connector-fill {
	width: 100% !important;
	background: var(--wcot-success);
}

/* ---- Progress bar ---- */
.wcot-progress-wrap {
	background: var(--wcot-border);
	border-radius: 50px;
	height: 8px;
	overflow: hidden;
	margin-bottom: 2rem;
}
.wcot-progress-bar {
	height: 100%;
	width: var(--wcot-progress, 0%);
	background: linear-gradient(90deg, var(--wcot-primary), var(--wcot-success));
	border-radius: 50px;
	transition: width .6s ease;
}

/* ---- Cancel section ---- */
.wcot-cancel-section { margin: 1rem 0 2rem; }

.wcot-cancel-notice {
	font-size: .9rem;
	color: var(--wcot-warning);
	margin-bottom: .75rem;
}
.wcot-cancel-expired  { color: var(--wcot-muted); font-size: .9rem; }
.wcot-cancel-requested{ color: var(--wcot-success); font-weight: 600; }

.wcot-return-section { margin: 1.5rem 0 2rem; }
.wcot-return-notice {
	background: #fff8e6;
	border-left: 4px solid var(--wcot-warning);
	padding: .75rem 1rem;
	border-radius: 6px;
	font-size: .9rem;
	margin-bottom: 1rem;
}
.wcot-return-btn {
	background: var(--wcot-warning);
	color: #fff;
	border: none;
	padding: .6rem 1.4rem;
	border-radius: 6px;
	cursor: pointer;
	font-weight: 600;
}
.wcot-return-btn:hover { opacity: .9; }
.wcot-return-card { border-left: 4px solid var(--wcot-warning); }
.wcot-terminal-return { background: #fff8e6; border-color: var(--wcot-warning); color: #7d5a00; }
.wcot-pickup-highlight { font-weight: 700; color: var(--wcot-primary); font-size: 1.05rem; }

/* Return flow timeline (customer) */
.wcot-return-flow-section {
	margin: 2rem 0 1.5rem;
	padding-top: 1.5rem;
	border-top: 2px dashed var(--wcot-border);
}
.wcot-return-flow-title {
	font-size: 1.05rem;
	font-weight: 700;
	margin: 0 0 1.25rem;
	color: #7d5a00;
}
.wcot-return-timeline .wcot-step { min-width: 72px; }
.wcot-return-timeline .wcot-step__label { font-size: .62rem; }
.wcot-progress-bar--return {
	background: linear-gradient(90deg, var(--wcot-warning), var(--wcot-success));
}
.wcot-status-return_requested,
.wcot-status-return_scheduled,
.wcot-status-return_picked_up,
.wcot-status-return_received,
.wcot-status-return_approved { background: #fff3cd; color: #856404; }
.wcot-status-refund_processed { background: #cff4fc; color: #055160; }
.wcot-status-return_rejected { background: #f8d7da; color: #842029; }

.wcot-cancel-btn {
	background: var(--wcot-danger) !important;
	color: #fff !important;
	border-color: var(--wcot-danger) !important;
	border-radius: 6px !important;
}
.wcot-cancel-btn:hover { opacity: .88; }

.wcot-track-btn {
	background: var(--wcot-primary) !important;
	color: #fff !important;
	border-color: var(--wcot-primary) !important;
	font-size: .82rem !important;
	padding: 6px 14px !important;
}

/* ---- Status badge (orders list) ---- */
.wcot-status-badge {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 20px;
	font-size: .75rem;
	font-weight: 700;
}
.wcot-status-ordered    { background: #e9ecef; color: #495057; }
.wcot-status-processing { background: #fff3cd; color: #856404; }
.wcot-status-dispatched { background: #cff4fc; color: #055160; }
.wcot-status-delivered  { background: #d1e7dd; color: #0a3622; }
.wcot-status-cancelled  { background: #f8d7da; color: #842029; }

/* ---- Modal ---- */
.wcot-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
}
.wcot-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,.45);
	cursor: pointer;
}
.wcot-modal__content {
	position: relative;
	background: #fff;
	border-radius: var(--wcot-radius);
	box-shadow: var(--wcot-shadow);
	padding: 2rem;
	width: min(90vw, 480px);
	z-index: 1;
}
.wcot-modal__close {
	position: absolute;
	top: .75rem; right: 1rem;
	background: none; border: none;
	font-size: 1.5rem; cursor: pointer;
	color: #888; line-height: 1;
}
.wcot-modal__content h3 { margin-top: 0; }
.wcot-modal__content textarea {
	width: 100%; box-sizing: border-box;
	border: 1px solid var(--wcot-border);
	border-radius: 6px;
	padding: .5rem .75rem;
	font-size: .9rem;
	resize: vertical;
}
.wcot-modal__actions {
	display: flex; gap: .75rem; margin-top: 1rem; flex-wrap: wrap;
}
.wcot-feedback {
	margin-top: 1rem;
	padding: .6rem 1rem;
	border-radius: 6px;
	font-size: .9rem;
}
.wcot-feedback--success { background: #d1e7dd; color: #0a3622; }
.wcot-feedback--error   { background: #f8d7da; color: #842029; }

/* Orders table */
.wcot-orders-table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
.wcot-orders-table th,
.wcot-orders-table td {
	padding: .6rem .75rem;
	border-bottom: 1px solid var(--wcot-border);
	font-size: .88rem;
	text-align: left;
	vertical-align: middle;
}
.wcot-orders-table th { background: var(--wcot-bg); font-weight: 700; }

/* ---- Responsive ---- */
@media (max-width: 600px) {
	.wcot-timeline { gap: 0; }
	.wcot-step { min-width: 60px; }
	.wcot-step__icon { width: 40px; height: 40px; font-size: 1.1rem; }
	.wcot-step__label { font-size: .65rem; }
	.wcot-step__connector { min-width: 12px; }
}

/* =====================================================================
   DISPATCH & DELIVERY DETAIL CARDS  (v1.0.1)
   ===================================================================== */

.wcot-details-card {
	background: #fff;
	border: 1px solid var(--wcot-border);
	border-radius: var(--wcot-radius);
	padding: 1.4rem 1.5rem;
	margin-top: 1.5rem;
	box-shadow: 0 2px 10px rgba(0,0,0,.05);
}

.wcot-dispatch-card { border-left: 4px solid var(--wcot-warning); }
.wcot-delivery-card  { border-left: 4px solid var(--wcot-success); }

.wcot-details-card__title {
	font-size: 1rem;
	font-weight: 700;
	margin: 0 0 1rem;
	display: flex;
	align-items: center;
	gap: .5rem;
	color: #1a1a2e;
}

.wcot-details-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: .75rem 1.5rem;
}

@media (max-width: 600px) {
	.wcot-details-grid { grid-template-columns: 1fr; }
}

.wcot-details-item {
	display: flex;
	flex-direction: column;
	gap: .2rem;
}

.wcot-details-item--full {
	grid-column: 1 / -1;
}

.wcot-details-label {
	font-size: .72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .05em;
	color: #6b7280;
}

.wcot-details-value {
	font-size: .93rem;
	color: #111827;
	font-weight: 500;
}

.wcot-awb {
	font-family: monospace;
	padding: .15rem .5rem;
	border-radius: 4px;
	display: inline-block;
	letter-spacing: .03em;
}

/* Document / proof preview */
.wcot-doc-preview { margin-top: .4rem; }

.wcot-doc-image {
	max-width: 100%;
	max-height: 200px;
	border-radius: 8px;
	border: 1px solid var(--wcot-border);
	object-fit: contain;
	display: block;
	cursor: zoom-in;
	transition: opacity .2s;
}
.wcot-doc-image:hover { opacity: .88; }

.wcot-doc-link {
	display: inline-flex;
	align-items: center;
	gap: .4rem;
	font-size: .88rem;
}

.truck-flip {transform: scaleX(-1);}

.wcot-step--done .wcot-step__icon {
    background: var(--wcot-success);
    border-color: var(--wcot-success);
    color: #fff;
    font-size: 1.2rem;
    transform: matrix(1, 0, 0, 1, 0, 0);
    display: flex;
}

.wcot-modal__content textarea{
	margin-top: 20px;
}