/**
 * Estado de reparación — rediseño (tarjetas apiladas: búsqueda, resultado,
 * ayuda). Namespace .st-estq. Autocontenido (border-box).
 */

.st-estq,
.st-estq *,
.st-estq *::before,
.st-estq *::after {
	box-sizing: border-box;
}

.st-estq {
	--st-blue: #2563EB;
	--st-navy: var(--wp--preset--color--navy);
	--st-gray: var(--wp--preset--color--gray);
	--st-border: var(--wp--preset--color--border);
	--st-red: var(--wp--preset--color--primary);
	max-width: 1180px;
	margin-inline: auto;
	display: flex;
	flex-direction: column;
	gap: 28px;
}

/* La tarjeta de ayuda es un bloque aparte y trae su propio `.st-estq`, así que
   ya no es hermana de las otras dos y el `gap` de arriba no la alcanza.

   La separación NO puede colgar de un selector de hermano (`.st-estq + .st-estq`):
   en el editor el bloque de la consulta no lleva esa clase —su envoltorio es
   `.wp-block-servitotal-estado-reparacion`— y la tarjeta salía pegada. Con
   `:not(:first-child)` funciona igual en el sitio y en el editor, y una tarjeta
   que vaya sola sigue sin margen sobrante. */
.st-estq.wp-block-servitotal-ayuda:not(:first-child) {
	margin-top: 28px;
}

.st-estq__card {
	background: #fff;
	border: 1px solid var(--st-border);
	border-radius: 20px;
	padding: 40px 44px;
	box-shadow: 0 10px 30px rgba(8, 21, 52, .04);
}

/* ---- Tarjeta 1: búsqueda --------------------------------------------- */
.st-estq__title {
	margin: 0;
	text-align: center;
	font-size: 30px;
	font-weight: 800;
	color: var(--st-navy);
}

.st-estq__em {
	color: var(--st-red);
}

.st-estq__subtitle {
	margin: 8px 0 26px;
	text-align: center;
	color: var(--st-gray);
}

.st-estq__formtitle {
	margin: 0 0 14px;
	font-size: 15px;
	font-weight: 700;
	color: var(--st-navy);
}

.st-estq__row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
}

.st-estq__lbl {
	display: block;
	font-size: 13px;
	color: var(--st-gray);
	margin-bottom: 7px;
}

.st-estq__control {
	width: 100%;
	border: 1px solid var(--st-border);
	border-radius: 12px;
	padding: 13px 15px;
	font-size: 15px;
	color: var(--wp--preset--color--contrast);
	background: #fff;
}

.st-estq__control::placeholder {
	color: #a7abb2;
}

.st-estq__control:focus {
	outline: none;
	border-color: var(--st-red);
	box-shadow: 0 0 0 3px rgba(234, 43, 39, .12);
}

.st-estq__select {
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	padding-right: 40px;
	cursor: pointer;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23EA2B27' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 15px center;
}

.st-estq__btn {
	width: 100%;
	margin-top: 20px;
	border: none;
	border-radius: 14px;
	padding: 15px;
	font-size: 16px;
	font-weight: 700;
	color: #fff;
	background: var(--st-red);
	cursor: pointer;
	transition: background .15s ease;
}

.st-estq__btn:hover {
	background: var(--wp--preset--color--primary-dark);
}

.st-estq__btn[disabled] {
	opacity: .6;
	cursor: not-allowed;
}

.st-estq__err {
	margin-top: 14px;
	background: #fef2f2;
	border: 1px solid #fca5a5;
	color: #b91c1c;
	border-radius: 10px;
	padding: 11px 14px;
	font-size: 13px;
}

/* ---- Tarjeta 2: resultado (estados) ---------------------------------- */
.st-estq__state {
	text-align: center;
	color: var(--st-gray);
	padding: 40px 12px;
}

.st-estq__stateico {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: var(--wp--preset--color--surface);
	color: var(--st-gray);
	margin-bottom: 14px;
}

.st-estq__stateico svg {
	width: 26px;
	height: 26px;
}

.st-estq__state p {
	margin: 0 auto;
	max-width: 380px;
	line-height: 1.55;
}

.st-estq__spinner {
	display: inline-block;
	width: 42px;
	height: 42px;
	margin-bottom: 14px;
	border: 3px solid var(--st-border);
	border-top-color: var(--st-red);
	border-radius: 50%;
	animation: st-estq-spin .8s linear infinite;
}

@keyframes st-estq-spin { to { transform: rotate(360deg); } }

.st-estq__rhd {
	margin: 0 0 22px;
	font-size: 22px;
	font-weight: 700;
	color: var(--st-navy);
}

.st-estq__rhd--muted {
	color: var(--st-gray);
}

.st-estq__back {
	background: none;
	border: none;
	padding: 0;
	margin: 0 0 14px;
	color: var(--st-red);
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
}

.st-estq__back:hover { text-decoration: underline; }

/* ---- Tracker --------------------------------------------------------- */
.st-estq__track {
	display: flex;
}

.st-estq__step {
	flex: 1;
	position: relative;
	text-align: center;
}

.st-estq__step::before {
	content: "";
	position: absolute;
	top: 28px;
	left: -50%;
	width: 100%;
	height: 3px;
	background: var(--st-border);
	z-index: 0;
}

.st-estq__step:first-child::before { display: none; }

.st-estq__step.is-done::before,
.st-estq__step.is-active::before {
	background: var(--st-blue);
}

.st-estq__stepico {
	position: relative;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	margin: 0 auto 10px;
	border-radius: 50%;
	background: #eef0f3;
	color: #9aa1ac;
}

.st-estq__stepico svg { width: 24px; height: 24px; }

.st-estq__step.is-done .st-estq__stepico {
	background: var(--st-blue);
	color: #fff;
}

.st-estq__step.is-active .st-estq__stepico {
	background: #1e97eb;
	color: #fff;
	box-shadow: 0 0 0 6px rgba(37, 151, 235, .18);
}

.st-estq__steplbl {
	margin: 0;
	font-size: 13px;
	font-weight: 600;
	color: var(--st-gray);
	line-height: 1.25;
}

.st-estq__step.is-done .st-estq__steplbl,
.st-estq__step.is-active .st-estq__steplbl {
	color: var(--st-navy);
}

.st-estq__divider {
	border: none;
	border-top: 1px solid var(--st-border);
	margin: 30px 0;
}

/* ---- Columnas: historial + info -------------------------------------- */
.st-estq__cols {
	display: grid;
	grid-template-columns: 38% 1fr;
	gap: 34px;
}

.st-estq__colhd {
	margin: 0 0 20px;
	font-size: 15px;
	font-weight: 700;
	color: var(--st-navy);
}

/* Historial (narrativa de fases) */
.st-estq__histrow {
	display: flex;
	gap: 14px;
	position: relative;
}

.st-estq__histdot {
	flex: 0 0 auto;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	border: 2px solid #cfd3da;
	background: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	margin-top: 2px;
}

.st-estq__histdot svg { width: 13px; height: 13px; opacity: 0; }

.st-estq__histrow.is-done .st-estq__histdot,
.st-estq__histrow.is-active .st-estq__histdot {
	background: var(--st-blue);
	border-color: var(--st-blue);
}

.st-estq__histrow.is-done .st-estq__histdot svg,
.st-estq__histrow.is-active .st-estq__histdot svg { opacity: 1; }

.st-estq__histrow:not(:last-child) .st-estq__histdot::after {
	content: "";
	position: absolute;
	left: 10px;
	top: 24px;
	width: 0;
	border-left: 2px dashed #cfd3da;
	height: calc(100% - 22px);
}

.st-estq__histrow.is-done:not(:last-child) .st-estq__histdot::after {
	border-color: var(--st-blue);
}

.st-estq__histbody {
	padding-bottom: 22px;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.st-estq__histdate {
	font-size: 11px;
	color: var(--st-gray);
}

.st-estq__histdate:empty { display: none; }

.st-estq__histtitle {
	font-size: 14px;
	font-weight: 700;
	color: var(--st-navy);
}

.st-estq__histrow.is-active .st-estq__histtitle { color: var(--st-blue); }

.st-estq__histrow.is-todo .st-estq__histtitle { color: #9aa1ac; }

.st-estq__histdesc {
	font-size: 12px;
	color: var(--st-gray);
	line-height: 1.45;
}

/* Información del servicio */
.st-estq__info {
	border: 1px solid var(--st-border);
	border-radius: 16px;
	padding: 26px 28px;
}

.st-estq__order {
	margin: 0 0 18px;
	font-size: 24px;
	font-weight: 800;
	color: var(--st-red);
}

.st-estq__head {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 18px 24px;
	padding-bottom: 20px;
	border-bottom: 1px solid var(--st-border);
}

.st-estq__headmain { display: flex; flex-direction: column; gap: 12px; }

.st-estq__headside { display: flex; flex-direction: column; gap: 14px; }

.st-estq__kv { display: flex; flex-direction: column; gap: 2px; }

.st-estq__k {
	display: block;
	font-size: 12px;
	color: var(--st-gray);
}

.st-estq__v {
	display: block;
	font-size: 14px;
	font-weight: 700;
	color: var(--st-navy);
}

.st-estq__hi {
	display: flex;
	align-items: flex-start;
	gap: 10px;
}

.st-estq__hiico {
	flex: 0 0 auto;
	width: 34px;
	height: 34px;
	border-radius: 9px;
	background: var(--wp--preset--color--surface);
	color: var(--st-gray);
	display: flex;
	align-items: center;
	justify-content: center;
}

.st-estq__hiico svg { width: 17px; height: 17px; }

/* Filas con icono */
.st-estq__inforow {
	display: grid;
	grid-template-columns: 22px 150px 1fr;
	align-items: start;
	gap: 12px;
	padding: 16px 0;
	border-bottom: 1px solid var(--st-border);
}

.st-estq__inforow:last-child { border-bottom: none; }

.st-estq__rowico { color: var(--st-gray); margin-top: 1px; }

.st-estq__rowico svg { width: 18px; height: 18px; }

.st-estq__rowlbl { font-size: 14px; color: var(--st-gray); }

.st-estq__rowval { font-size: 14px; font-weight: 600; color: var(--st-navy); line-height: 1.4; }

/* Garantía */
.st-estq__warranty {
	margin-top: 18px;
	background: #fef9e6;
	border-radius: 12px;
	padding: 18px;
	text-align: center;
}

.st-estq__wtitle {
	margin: 0 0 4px;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	font-weight: 700;
	color: var(--st-navy);
}

.st-estq__wico { color: var(--st-blue); display: inline-flex; }

.st-estq__wico svg { width: 18px; height: 18px; }

.st-estq__wval { margin: 4px 0 2px; font-size: 13px; color: var(--st-navy); }

.st-estq__wlink { margin: 0; font-size: 12px; }

.st-estq__wlink a { color: var(--st-blue); }

/* ---- Lista de órdenes (búsqueda por documento) ---------------------- */
.st-estq__list { display: flex; flex-direction: column; gap: 10px; }

.st-estq__listitem {
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	gap: 4px 14px;
	width: 100%;
	text-align: left;
	background: #fff;
	border: 1px solid var(--st-border);
	border-radius: 12px;
	padding: 14px 18px;
	cursor: pointer;
	transition: border-color .15s ease, box-shadow .15s ease;
}

.st-estq__listitem:hover {
	border-color: var(--st-red);
	box-shadow: 0 6px 16px rgba(8, 21, 52, .07);
}

.st-estq__li-order { grid-column: 1; grid-row: 1; font-weight: 800; color: var(--st-red); font-size: 15px; }
.st-estq__li-prod { grid-column: 2; grid-row: 1; font-weight: 600; color: var(--st-navy); font-size: 14px; }
.st-estq__li-meta { grid-column: 1 / 3; grid-row: 2; font-size: 12px; color: var(--st-gray); }
.st-estq__listitem .st-estq__li-arrow { grid-column: 3; grid-row: 1 / 3; color: var(--st-gray); font-size: 20px; }

.st-estq__muted { color: var(--st-gray); font-size: 13px; }

/* ---- Tarjeta 3: ayuda ------------------------------------------------ */
.st-estq__helphd {
	margin: 0;
	text-align: center;
	font-size: 22px;
	font-weight: 700;
	color: var(--st-navy);
}

.st-estq__helpsub {
	margin: 6px 0 22px;
	text-align: center;
	color: var(--st-gray);
}

.st-estq__helprow {
	display: flex;
	align-items: center;
	gap: 16px;
	border: 1px solid var(--st-border);
	border-radius: 14px;
	padding: 16px 20px;
	margin-bottom: 12px;
	text-decoration: none;
	transition: border-color .15s ease, box-shadow .15s ease;
}

.st-estq__helprow:last-child { margin-bottom: 0; }

.st-estq__helprow:hover {
	border-color: var(--st-red);
	box-shadow: 0 6px 16px rgba(8, 21, 52, .06);
}

.st-estq__helpico {
	flex: 0 0 auto;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: color-mix(in srgb, var(--st-red) 10%, #fff);
	color: var(--st-red);
}

.st-estq__helpico.is-wa {
	background: color-mix(in srgb, #25d366 14%, #fff);
	color: #1faa52;
}

.st-estq__helpico svg { width: 22px; height: 22px; }

.st-estq__helptxt { flex: 1; display: flex; flex-direction: column; }

.st-estq__helpname { font-size: 15px; font-weight: 700; color: var(--st-navy); }

.st-estq__helpmeta { font-size: 12px; color: var(--st-gray); }

.st-estq__helparrow { color: var(--st-gray); font-size: 18px; }

/* ---- Responsive ------------------------------------------------------ */
@media (max-width: 860px) {
	.st-estq__card { padding: 26px 20px; }
	.st-estq__row { grid-template-columns: 1fr; }
	.st-estq__cols { grid-template-columns: 1fr; gap: 28px; }
	.st-estq__head { grid-template-columns: 1fr; }
	.st-estq__inforow { grid-template-columns: 20px 130px 1fr; }
	.st-estq__track { overflow-x: auto; padding-bottom: 6px; }
	.st-estq__step { min-width: 96px; }
}

@media (max-width: 520px) {
	.st-estq__title { font-size: 24px; }
	.st-estq__inforow { grid-template-columns: 20px 1fr; }
	.st-estq__inforow .st-estq__rowval { grid-column: 2; }
}
