/* =====================================================================
   KYROSCH — SEGUIMIENTO DE PEDIDO (página pública)
   Misma identidad premium de Compra Asistida (Fraunces + Inter, papel
   crema, bronce envejecido), llevada a un panel de seguimiento tipo
   logística de primer nivel: resumen, barra de progreso y línea de
   tiempo interactiva.
===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,600;0,9..144,700;1,9..144,500&family=Inter:wght@400;500;600;700;800&display=swap');

.st-page{
  --font-display: "Fraunces", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --paper:        #f6f1e7;
  --surface:      #ffffff;
  --surface-alt:  #fbf8f2;

  --line:      #e5dbc4;
  --line-soft: #efe7d5;

  --ink:       #1b1712;
  --ink-soft:  #5c5344;
  --ink-faint: #9a8f79;

  --brass:      #a4753a;
  --brass-deep: #c9a24d;
  --brass-soft: #f1e2c2;

  --success:    #1f7a4d;
  --success-bg: #e7f4ec;
  --danger:     #b23b2c;
  --danger-bg:  #fbeae6;
  --warning:    #a06a10;
  --warning-bg: #faf0da;
  --info:       #3a6ea5;
  --info-bg:    #e7eef8;

  --r-xl: 28px;
  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;

  --shadow-card: 0 1px 2px rgba(27,23,18,.04), 0 12px 32px -16px rgba(27,23,18,.18);
  --ease: cubic-bezier(.16,1,.3,1);

  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(circle at 12% 6%, rgba(164,117,58,.07), transparent 42%),
    radial-gradient(circle at 88% 96%, rgba(164,117,58,.06), transparent 45%);
  padding-bottom: 40px;
}
p {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  font-weight: 100;
}
h2 {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  font-weight: 100;
  text-transform: uppercase;
}
.st-page *{ box-sizing: border-box; }

/* Varias secciones de esta página (loading, error, resultado, banner,
   fila de tracking) usan el atributo HTML [hidden] para mostrarse u
   ocultarse desde JS. Como esas mismas secciones también tienen una
   clase que define "display: flex", ambas reglas quedan con la misma
   especificidad (0,1,0) y, al ser CSS de autor, le ganan al [hidden]
   por defecto del navegador (que es solo hoja de estilos de usuario).
   Resultado: el panel de "cargando" (u otros) se queda visible aunque
   JS ya le haya puesto hidden=true. Esta regla de mayor especificidad
   fuerza que [hidden] siempre gane. */
[hidden]{
  display: none !important;
}

@media (prefers-reduced-motion: reduce){
  .st-page *{ animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* =====================================================================
   HERO / BUSCADOR
===================================================================== */
.st-hero{
  padding: 100px 20px 40px;
  text-align: center;
}
.st-hero-inner{
  max-width: 640px;
  margin: 0 auto;
}
.st-eyebrow{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--brass-deep);
  background: var(--brass-soft);
  padding: 6px 14px;
  border-radius: 999px;
}
.st-eyebrow i{ width: 14px; height: 14px; }

.st-hero h1{
  font-family: var(--font-display);
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 100;
  font-style: italic;
  margin: 25px 0 10px;
  color: var(--ink);
}
.st-hero h1 em{
  font-style: italic;
  color: var(--brass-deep);
}
.st-hero p{
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.6;
  margin-bottom: 26px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  font-weight: 100;
}

.st-search{
  display: flex;
  gap: 10px;
  max-width: 520px;
  margin: 0 auto;
}
.st-search-field{
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 0 16px;
  box-shadow: var(--shadow-card);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.st-search-field:focus-within{
  border-color: var(--brass);
  box-shadow: 0 0 0 3px rgba(164,117,58,.15);
}
.st-search-field i{ width: 18px; height: 18px; color: var(--ink-faint); flex-shrink: 0; }
.st-search-field input{
  border: none;
  outline: none;
  background: transparent;
  padding: 15px 0;
  font-family: var(--font-body);
  font-size: 15px;
  width: 100%;
  color: var(--ink);
}
.st-search-field input::placeholder{ color: var(--ink-faint); }

.st-hint{
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--ink-faint);
}

/* Botones */
.st-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--r-lg);
  padding: 15px 22px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
  white-space: nowrap;
  text-decoration: none;
}
.st-btn i{ width: 17px; height: 17px; }
.st-btn--gold{
  background: linear-gradient(135deg, var(--brass), var(--brass-deep));
  color: #fff;
  box-shadow: 0 10px 24px -10px rgba(138,95,44,.55);
}
.st-btn--gold:hover{ transform: translateY(-1px); box-shadow: 0 14px 28px -10px rgba(138,95,44,.6); }
.st-btn--gold:active{ transform: translateY(0); }
.st-btn--outline{
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
}
.st-btn--outline:hover{ border-color: var(--brass); color: var(--brass-deep); }

/* =====================================================================
   LAYOUT DE RESULTADOS
===================================================================== */
.st-wrap{
  max-width: 720px;
  margin: 0 auto;
  padding: 0 18px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.st-state{
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}

.st-result{
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: stFadeUp .5s var(--ease) both;
}

@keyframes stFadeUp{
  from{ opacity: 0; transform: translateY(12px); }
  to{ opacity: 1; transform: translateY(0); }
}

.st-card{
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-card);
  padding: 24px;
}

.st-card-title{
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 18px;
}
.st-card-title i{ width: 18px; height: 18px; color: var(--brass-deep); }

/* =====================================================================
   BANNER DE ESTADO NEGATIVO
===================================================================== */
.st-banner{
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px;
  border-radius: var(--r-lg);
  border: 1px solid transparent;
}
.st-banner i{ width: 22px; height: 22px; flex-shrink: 0; margin-top: 2px; }
.st-banner strong{ display: block; margin-bottom: 2px; font-size: 14.5px; }
.st-banner p{ margin: 0; font-size: 13.5px; line-height: 1.5; }
.st-banner--danger{ background: var(--danger-bg); color: var(--danger); border-color: rgba(178,59,44,.25); }
.st-banner--warning{ background: var(--warning-bg); color: var(--warning); border-color: rgba(160,106,16,.25); }

/* =====================================================================
   RESUMEN DEL PEDIDO
===================================================================== */
.st-summary-top{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.st-summary-label{
  display: block;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 11px;
  color: var(--ink-faint);
  margin-bottom: 4px;
}
.st-summary-code{
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  margin: 0;
  letter-spacing: .02em;
}

.st-badge{
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.st-badge--info{ background: var(--info-bg); color: var(--info); }
.st-badge--success{ background: var(--success-bg); color: var(--success); }
.st-badge--danger{ background: var(--danger-bg); color: var(--danger); }
.st-badge--warning{ background: var(--warning-bg); color: var(--warning); }

.st-summary-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 16px 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}
.st-summary-item{
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.st-summary-item i{ width: 17px; height: 17px; color: var(--brass-deep); margin-top: 2px; flex-shrink: 0; }
.st-summary-item span{ display: block; font-size: 11.5px; color: var(--ink-faint); }
.st-summary-item strong{ display: block; font-size: 13.5px; margin-top: 2px; }

.st-tracking-row{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-soft);
  padding: 12px 0 0;
}
.st-tracking-row i{ width: 15px; height: 15px; color: var(--brass-deep); }
.st-tracking-link{
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--brass-deep);
  font-weight: 600;
  text-decoration: none;
  font-size: 12.5px;
}
.st-tracking-link i{ width: 13px; height: 13px; }

.st-summary-toggle{
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-alt);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  padding: 13px 16px;
  margin-top: 16px;
  cursor: pointer;
  font-family: var(--font-body);
  color: var(--ink);
}
.st-summary-toggle span:first-child{ display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.st-summary-toggle span:first-child i{ width: 16px; height: 16px; color: var(--brass-deep); }
.st-summary-total{ margin-left: auto; font-size: 13px; font-weight: 700; color: var(--brass-deep); }
.st-chevron{ width: 16px; height: 16px; transition: transform .2s var(--ease); }
.st-chevron.is-open{ transform: rotate(180deg); }

.st-products{
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s var(--ease);
}
.st-products.is-open{ max-height: 900px; margin-top: 12px; }

.st-product-row{
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}
.st-product-row:last-child{ border-bottom: none; }
.st-product-img{
  width: 48px;
  height: 48px;
  border-radius: var(--r-sm);
  object-fit: cover;
  background: var(--surface-alt);
  border: 1px solid var(--line-soft);
  flex-shrink: 0;
}
.st-product-info{ flex: 1; min-width: 0; }
.st-product-info strong{ display: block; font-size: 13.5px; }
.st-product-info span{ display: block; font-size: 12px; color: var(--ink-faint); margin-top: 2px; }
.st-product-qty{ font-size: 13px; color: var(--ink-soft); }
.st-product-price{ font-size: 13.5px; font-weight: 700; white-space: nowrap; }

.st-empty{ color: var(--ink-faint); font-size: 13.5px; padding: 8px 0; }

/* =====================================================================
   BARRA DE PROGRESO
===================================================================== */
.st-progress-card{ padding: 20px 24px; }
.st-progress-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 13.5px;
}
.st-progress-head strong{ color: var(--brass-deep); font-size: 14px; }
.st-progress-track{
  height: 10px;
  border-radius: 999px;
  background: var(--surface-alt);
  border: 1px solid var(--line-soft);
  overflow: hidden;
}
.st-progress-fill{
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brass), var(--brass-deep));
  transition: width .8s var(--ease);
}
.st-progress-fill--danger{ background: linear-gradient(90deg, #c96455, var(--danger)); }

/* =====================================================================
   LÍNEA DE TIEMPO
===================================================================== */
.st-timeline{
  display: flex;
  flex-direction: column;
}

.st-step{
  display: flex;
  gap: 14px;
  position: relative;
  padding-bottom: 26px;
}
.st-step:last-child{ padding-bottom: 0; }

.st-step::before{
  content: "";
  position: absolute;
  left: 15px;
  top: 32px;
  bottom: 0;
  width: 2px;
  background: var(--line-soft);
}
.st-step:last-child::before{ display: none; }
.st-step.is-done::before{ background: var(--brass-soft); }

.st-step-dot{
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--surface-alt);
  border: 2px solid var(--line-soft);
  color: var(--ink-faint);
  z-index: 1;
  transition: background .3s var(--ease), border-color .3s var(--ease), color .3s var(--ease), transform .3s var(--ease);
}
.st-step-dot i{ width: 16px; height: 16px; }

.st-step.is-done .st-step-dot{
  background: var(--success);
  border-color: var(--success);
  color: #fff;
  animation: stPop .4s var(--ease);
}
.st-step.is-current .st-step-dot{
  background: var(--brass);
  border-color: var(--brass);
  color: #fff;
  box-shadow: 0 0 0 5px rgba(164,117,58,.18);
  transform: scale(1.08);
}

@keyframes stPop{
  0%{ transform: scale(.6); }
  60%{ transform: scale(1.12); }
  100%{ transform: scale(1); }
}

.st-step-body{ flex: 1; padding-top: 3px; }
.st-step-head{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.st-step-head strong{ font-size: 14.5px; }
.st-step.is-pending .st-step-head strong,
.st-step.is-pending p{ color: var(--ink-faint); }
.st-step-head time{ font-size: 12px; color: var(--ink-faint); white-space: nowrap; }

.st-step p{
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.5;
}
.st-step-obs{
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 8px !important;
  padding: 8px 10px;
  background: var(--surface-alt);
  border-radius: var(--r-sm);
  border: 1px solid var(--line-soft);
  color: var(--ink-soft) !important;
  font-size: 12.5px !important;
}
.st-step-obs i{ width: 13px; height: 13px; margin-top: 1px; flex-shrink: 0; color: var(--brass-deep); }

/* =====================================================================
   HISTORIAL CRONOLÓGICO
===================================================================== */
.st-history{
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.st-history-item{
  display: flex;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
}
.st-history-item:last-child{ border-bottom: none; padding-bottom: 0; }
.st-history-item time{
  flex-shrink: 0;
  width: 108px;
  color: var(--ink-faint);
  font-size: 12px;
  padding-top: 1px;
}
.st-history-item strong{ display: block; font-size: 13.5px; }
.st-history-item p{ margin: 2px 0 0; color: var(--ink-soft); font-size: 12.5px; line-height: 1.5; }
.st-history-item.is-alert strong{ color: var(--warning); }

.st-footer-actions{
  display: flex;
  justify-content: center;
  padding: 6px 0 20px;
}

/* =====================================================================
   ESTADO: ERROR
===================================================================== */
.st-error{ padding: 50px 20px; }
.st-error-icon{
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: var(--danger-bg);
  color: var(--danger);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}
.st-error-icon i{ width: 28px; height: 28px; }
.st-error h2{ font-family: var(--font-display); font-size: 20px; margin: 0; }
.st-error p{ color: var(--ink-soft); font-size: 13.5px; max-width: 380px; line-height: 1.6; margin: 0 0 6px; }

/* =====================================================================
   ESTADO: CARGANDO (skeleton)
===================================================================== */
.st-skeleton-card,
.st-skeleton-bar,
.st-skeleton-step{
  border-radius: var(--r-lg);
  background: linear-gradient(90deg, var(--surface-alt) 25%, var(--line-soft) 37%, var(--surface-alt) 63%);
  background-size: 400% 100%;
  animation: stShimmer 1.4s ease infinite;
}
.st-skeleton-card{ height: 190px; width: 100%; }
.st-skeleton-bar{ height: 56px; width: 100%; }
.st-skeleton-timeline{ display: flex; flex-direction: column; gap: 14px; }
.st-skeleton-step{ height: 64px; width: 100%; }

@keyframes stShimmer{
  0%{ background-position: 100% 50%; }
  100%{ background-position: 0 50%; }
}

/* =====================================================================
   REVEAL AL HACER SCROLL (progresivo, como el resto del sitio)
===================================================================== */
.st-card{ animation: stFadeUp .5s var(--ease) both; }
.st-card:nth-child(2){ animation-delay: .05s; }
.st-card:nth-child(3){ animation-delay: .1s; }
.st-card:nth-child(4){ animation-delay: .15s; }

/* =====================================================================
   RESPONSIVE
===================================================================== */
@media (max-width: 640px){
  .st-hero{ padding: 40px 16px 30px; }
  .st-search{ flex-direction: column; }
  .st-btn--gold{ width: 100%; }
  .st-summary-grid{ grid-template-columns: 1fr; }
  .st-card{ padding: 18px; border-radius: var(--r-lg); }
  .st-history-item{ flex-direction: column; gap: 4px; }
  .st-history-item time{ width: auto; }
  .st-tracking-link{ margin-left: 0; }
}
