/* ============================================================================
 * CRAZYSTORE · PÁGINA DE GRACIAS — v1.0.4 · 16/09/2026
 * ============================================================================
 *
 * Rediseño completo. La versión 1.0.2 quedó obsoleta de golpe: thank-you.js se
 * reescribió para esta maqueta y 31 de las 44 clases que pinta NO TENÍAN NI UNA
 * REGLA. Eso es lo que se veía como iconos gigantes sin recortar y filas
 * desalineadas — no era un fallo del JS, era una página sin hoja de estilos.
 *
 * ⚠️ ESTE ARCHIVO ES LA MITAD DE UN PAR. La otra mitad es mitema/js/thank-you.js,
 *    que decide qué clases existen. Si allí se renombra una clase, aquí deja de
 *    haber estilo y no salta ningún error: sólo se descoloca la página. Las
 *    clases que el JS BUSCA (no las que crea) están marcadas en el HTML.
 *
 * Cuatro tarjetas, en este orden:
 *    1. .thkyou_status              qué pasó con el pago
 *    2. .thkyou_dynamic-order-summary   el recibo
 *    3. .thkyou_next-steps          ¿qué sigue?
 *    4. .thkyou_soft-register       guardar los datos (sólo invitados)
 *
 * Dos estados, y la diferencia importa de verdad:
 *    [data-estado="confirmado"]  -> visto VERDE. El banco ya confirmó.
 *    [data-estado="verificando"] -> reloj ÁMBAR. Nadie ha confirmado nada aún.
 *    sin data-estado             -> ámbar también. Nunca prometer de más.
 * ========================================================================= */

:root {
  --ty-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --ty-red: #ff0000;
  --ty-red-dark: #b00000;
  --ty-bg: #f2f2f2;
  --ty-card: #ffffff;
  --ty-border: #ececec;
  --ty-text: #1a1a1a;
  --ty-muted: #6b7280;
  --ty-muted-soft: #9aa1ab;
  --ty-ok: #16a34a;
  --ty-wait-bg: #fdf4de;
  --ty-wait-line: #e8c56a;
  --ty-wait-ink: #b8860b;
  --ty-wa: #12874a;
  --ty-inset: #f7f7f8;
  --ty-radius: 16px;
}

/* === LIMPIEZA A PANTALLA COMPLETA ======================================== */
.custom-thank-you-page #page,
.custom-thank-you-page header,
.custom-thank-you-page footer,
.custom-thank-you-page .site-header,
.custom-thank-you-page .site-footer,
.custom-thank-you-page .widget-area,
.custom-thank-you-page .sidebar {
  display: none !important;
}

body.custom-thank-you-page {
  background: var(--ty-bg);
  margin: 0;
  padding: 0;
  font-family: var(--ty-font);
  color: var(--ty-text);
  -webkit-font-smoothing: antialiased;
}

/*
 * 🪤 El envoltorio se llama #custom-thank-you-wrapper-machi.
 *    La 1.0.2 apuntaba a #custom-checkout-wrapper-machi, que en ESTA página no
 *    existe (es el del checkout), así que la regla de la tipografía nunca se
 *    aplicó: la página se veía con la fuente del tema padre, no con Inter.
 */
#custom-thank-you-wrapper-machi,
#custom-thank-you-wrapper-machi * {
  font-family: var(--ty-font) !important;
  box-sizing: border-box;
}

/* === LOGO Y RASTRO DE PASOS ============================================== */
.thkyou_checkout-logo {
  display: flex;
  justify-content: center;
  padding: 26px 16px 0;
}
.thkyou_checkout-logo img {
  width: 86px;
  height: auto;
  display: block;
}

.thkyou_progress-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 16px 6px;
  font-size: 13.5px;
}
.thkyou_progress-step { color: var(--ty-muted-soft); }
.thkyou_progress-step.completed { color: var(--ty-muted); }
.thkyou_progress-step.active { color: var(--ty-text); font-weight: 600; }
.thkyou_progress-sep { color: #c9ced6; }

/* === EL CONTENEDOR Y LAS TARJETAS ======================================== */
.thkyou_container {
  max-width: 760px;
  margin: 0 auto;
  /* padding-block, nunca el atajo: el lateral de 16px no se puede perder. */
  padding-block: 12px 40px;
  padding-inline: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.thkyou_status,
.thkyou_dynamic-order-summary,
.thkyou_next-steps,
.thkyou_soft-register {
  background: var(--ty-card);
  border-radius: var(--ty-radius);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
}
.thkyou_soft-register[hidden] { display: none !important; }

/* ═════════════════════════════════════════════════════════════════════════
   1) QUÉ PASÓ CON EL PAGO
   ═════════════════════════════════════════════════════════════════════════ */
.thkyou_status {
  padding: 34px 28px 26px;
  text-align: center;
}

.thkyou_status-icon {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.thkyou_status-icon svg { width: 27px; height: 27px; }

/*
 * 🔒 POR DEFECTO, EL ÁMBAR. Sin data-estado (el JS no llegó a correr porque no
 *    había datos del pedido) la página NO puede decir "pago confirmado". El
 *    verde se gana; el ámbar es lo que no compromete a nada.
 */
.thkyou_status-icon {
  background: var(--ty-wait-bg);
  border: 2px solid var(--ty-wait-line);
  color: var(--ty-wait-ink);
}
.thkyou_icon-ok { display: none; }
.thkyou_icon-wait { display: block; }

.thkyou_status[data-estado="confirmado"] .thkyou_status-icon {
  background: var(--ty-ok);
  border-color: var(--ty-ok);
  color: #fff;
}
.thkyou_status[data-estado="confirmado"] .thkyou_icon-ok { display: block; }
.thkyou_status[data-estado="confirmado"] .thkyou_icon-wait { display: none; }

.thkyou_status-title {
  margin: 0 0 8px;
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--ty-text);
  text-wrap: balance;
}
.thkyou_status-sub {
  margin: 0 auto;
  max-width: 46ch;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ty-muted);
  text-wrap: pretty;
}

.thkyou_status-meta {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 18px;
}
.thkyou_status-meta[hidden] { display: none !important; }

.thkyou_order-pill {
  background: #f1f2f4;
  border-radius: 8px;
  padding: 7px 13px;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #374151;
  font-variant-numeric: tabular-nums;
}

.thkyou_status-mail {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  color: var(--ty-muted);
  /* El correo puede ser largo: que parta antes de desbordar la tarjeta. */
  min-width: 0;
  overflow-wrap: anywhere;
}
.thkyou_status-mail[hidden] { display: none !important; }
.thkyou_status-mail svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--ty-muted-soft);
}
/* Aqui vive el correo, que es la cadena larga: que parta donde haga falta. */
.thkyou_status-mail-text { overflow-wrap: anywhere; }

/* ═════════════════════════════════════════════════════════════════════════
   2) EL RECIBO
   ═════════════════════════════════════════════════════════════════════════ */
.thkyou_receipt-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 24px 16px;
}
.thkyou_receipt-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.thkyou_receipt-count {
  font-size: 13.5px;
  color: var(--ty-muted);
  flex-shrink: 0;
}

/* --- Productos --- */
.thkyou_products-container { border-top: 1px solid var(--ty-border); }

/*
 * Nombre y código a la izquierda, precio a la derecha y arriba. Grid y no
 * flex porque el nombre ocupa dos líneas a menudo y el precio tiene que
 * quedarse pegado a la primera, no centrarse contra el bloque entero.
 */
.thkyou_product-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  column-gap: 16px;
  padding: 16px 24px;
}
.thkyou_product-item + .thkyou_product-item { border-top: 1px solid #f4f4f5; }

.thkyou_product-name {
  grid-column: 1;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--ty-text);
}
.thkyou_product-code {
  grid-column: 1;
  margin-top: 3px;
  font-size: 12.5px;
  color: var(--ty-muted-soft);
}
.thkyou_product-price {
  grid-column: 2;
  grid-row: 1;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* --- Entrega y pago --- */
.thkyou_delivery-info {
  border-top: 1px solid var(--ty-border);
  padding: 16px 24px 8px;
}
.thkyou_info-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 0;
  font-size: 14px;
}
.thkyou_info-label {
  color: var(--ty-muted);
  flex-shrink: 0;
}
.thkyou_info-value {
  text-align: right;
  font-weight: 500;
  color: var(--ty-text);
  overflow-wrap: anywhere;
}

/* "Gratis" en verde: es la unica cifra buena de la lista, que se vea. */
.thkyou_free {
  color: var(--ty-ok);
  font-weight: 700;
}

/* El medio de pago: icono + texto + (si toca) la insignia de "en verificación". */
.thkyou_pay-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.thkyou_pay-label svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--ty-muted);
}

/*
 * 🟡 "En verificación". Sólo sale cuando el banco NO ha confirmado, así que es
 *    la pieza que separa "ya está pagado" de "estamos mirando". Ámbar, no rojo:
 *    no es un error, es una espera.
 */
.thkyou_badge-wait {
  background: var(--ty-wait-bg);
  border: 1px solid var(--ty-wait-line);
  color: #8a6400;
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

/* --- La barra del total --- */
.thkyou_total-bar {
  margin: 8px 16px 16px;
  background: linear-gradient(135deg, var(--ty-red) 0%, var(--ty-red-dark) 100%);
  box-shadow: 0 4px 14px rgba(255, 0, 0, 0.22);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.thkyou_total-label {
  font-size: 11.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.82);
  margin-bottom: 2px;
}
.thkyou_total-amounts {
  display: flex;
  align-items: baseline;
  gap: 7px;
  flex-wrap: wrap;
  width: 100%;
  justify-content: space-between;
}
.thkyou_total-main {
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.thkyou_total-cur {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  margin-right: auto;
}
.thkyou_total-alt {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.86);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Sin datos del pedido. Un aviso tranquilo, no un error. */
.thkyou_empty {
  margin: 0;
  padding: 28px 24px;
  text-align: center;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ty-muted);
}

/* ═════════════════════════════════════════════════════════════════════════
   3) ¿QUÉ SIGUE?
   ═════════════════════════════════════════════════════════════════════════ */
.thkyou_next-steps { padding: 22px 24px 24px; }

.thkyou_next-title {
  margin: 0 0 18px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.thkyou_steps-list {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.thkyou_step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.thkyou_step-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff1f1;
  border: 1px solid #ffdcdc;
  color: var(--ty-red);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
/*
 * 🪤 Sin esto los iconos salían ENORMES. Un <svg> sin ancho ni alto en el CSS
 *    se dibuja a su tamaño natural, y eso fue exactamente lo que se vio el
 *    15/09: escudos y camiones de cientos de píxeles. No quitar.
 */
.thkyou_step-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.thkyou_step-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  padding-top: 7px;
}
.thkyou_step-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ty-text);
}
.thkyou_step-text {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ty-muted);
}

/* La caja gris de la dirección / los horarios. */
.thkyou_step-box {
  margin-top: 8px;
  background: var(--ty-inset);
  border: 1px solid #efeff1;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.thkyou_step-box-main {
  font-size: 13.5px;
  line-height: 1.45;
  color: #374151;
}
.thkyou_step-box-sub {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ty-muted-soft);
}

/* --- Seguir comprando --- */
.thkyou_btn {
  display: block;
  width: 100%;
  text-align: center;
  text-decoration: none;
  border-radius: 10px;
  padding: 15px 18px;
  font-size: 15px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.15s ease;
}
/*
 * 🚤 EL COLOR SE FIJA EN TODOS LOS ESTADOS, Y NO ES POR GUSTO.
 *
 * 🪰 16/09/2026: al pasar el raton por encima, "Seguir comprando"
 *    DESAPARECIA. Es un <a>, y el tema padre (fuera de este tema hijo, asi que
 *    no se puede leer desde aqui) recolorea los enlaces al pasar por encima.
 *
 *    Y ganaba por especificidad, no por casualidad:
 *
 *        a:hover                  -> 0,1,1   ← el tema padre
 *        .thkyou_btn-primary      -> 0,1,0   ← nosotros
 *
 *    Nuestro color solo estaba declarado en el estado normal, asi que en :hover
 *    mandaba el del tema: texto del color del fondo sobre el fondo. Invisible.
 *
 *    `.thkyou_btn-primary:hover` vale 0,2,0 y ya le gana. El !important va
 *    ademas porque no sabemos si esa regla de fuera lo lleva, y un boton cuyo
 *    texto se borra al apuntarlo no es sitio para arriesgarse. Es el mismo
 *    criterio que en el checkout, donde el !important sobre los estilos de pago
 *    es deliberado por esto mismo.
 *
 * ⚠️ No quitar ninguno de los cuatro estados. Faltaba uno y eso basto.
 */
.thkyou_btn-primary,
.thkyou_btn-primary:link,
.thkyou_btn-primary:visited,
.thkyou_btn-primary:hover,
.thkyou_btn-primary:focus,
.thkyou_btn-primary:active {
  background: var(--ty-red);
  color: #fff !important;
  text-decoration: none;
}
.thkyou_btn-primary:hover { filter: brightness(0.93); }
.thkyou_btn-primary:active { transform: translateY(1px); }

.thkyou_help {
  margin: 14px 0 0;
  text-align: center;
  font-size: 13.5px;
  color: var(--ty-muted);
}
/* Mismo blindaje: es un <a> y le afecta la misma regla del tema padre. */
.thkyou_help-link,
.thkyou_help-link:link,
.thkyou_help-link:visited,
.thkyou_help-link:hover,
.thkyou_help-link:focus,
.thkyou_help-link:active {
  color: var(--ty-wa) !important;
  font-weight: 700;
  text-decoration: none;
}
.thkyou_help-link:hover { text-decoration: underline; }

/* ═════════════════════════════════════════════════════════════════════════
   4) GUARDAR LOS DATOS
   ═════════════════════════════════════════════════════════════════════════ */
.thkyou_soft-register { padding: 22px 24px 24px; }

.thkyou_soft-title {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.015em;
}
.thkyou_soft-sub {
  margin: 0 0 16px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ty-muted);
}

/*
 * ⚠️ El [hidden] NO es decoracion. Al crearse la cuenta, initSoftRegister()
 *    hace `form.hidden = true` y ensena el mensaje de exito en su lugar. Si
 *    alguna regla le pusiera un `display` fijo al formulario, ese hidden no
 *    haria nada y el cliente veria el formulario Y el "cuenta creada" a la vez.
 */
.thkyou_soft-register-form { display: block; }
.thkyou_soft-register-form[hidden] { display: none !important; }

.thkyou_soft-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}
.thkyou_soft-password {
  flex: 1 1 auto;
  min-width: 0;
  border: 1px solid #dcdfe4;
  border-radius: 10px;
  padding: 14px 15px;
  font-size: 14.5px;
  color: var(--ty-text);
  background: #fff;
}
.thkyou_soft-password::placeholder { color: var(--ty-muted-soft); }
.thkyou_soft-password:focus {
  outline: none;
  border-color: #9aa1ab;
  box-shadow: 0 0 0 3px rgba(26, 26, 26, 0.07);
}

/* Negro y no rojo: el rojo es para pagar. Esto es un extra, no la acción. */
.thkyou_soft-btn {
  flex-shrink: 0;
  background: #17181b;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 14px 22px;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.15s ease;
}
.thkyou_soft-btn:hover { filter: brightness(1.35); }
.thkyou_soft-btn:disabled { opacity: 0.6; cursor: default; }

.thkyou_soft-error {
  margin-top: 8px;
  font-size: 12.5px;
  color: #c62828;
  min-height: 0;
}
.thkyou_soft-error:empty { display: none; }

.thkyou_soft-skip,
.thkyou_soft-skip:link,
.thkyou_soft-skip:visited,
.thkyou_soft-skip:hover,
.thkyou_soft-skip:focus,
.thkyou_soft-skip:active {
  display: inline-block;
  margin-top: 12px;
  font-size: 13px;
  color: var(--ty-muted) !important;
  text-decoration: underline;
}

.thkyou_soft-register-success[hidden] { display: none !important; }
.thkyou_soft-register-success p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: #1d6b1d;
  background: #f1f8f2;
  border: 1px solid #9fd3a6;
  border-radius: 10px;
  padding: 14px 16px;
}

/* Etiqueta sólo para lectores de pantalla (el campo lleva placeholder). */
.thkyou_sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Foco visible en todo lo que se pueda enfocar con el teclado. */
.thkyou_btn:focus-visible,
.thkyou_soft-btn:focus-visible,
.thkyou_soft-skip:focus-visible,
.thkyou_help-link:focus-visible {
  outline: 2px solid #1a1a1a;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .thkyou_btn, .thkyou_soft-btn { transition: none; }
}

/* ═════════════════════════════════════════════════════════════════════════
   MÓVIL
   ═════════════════════════════════════════════════════════════════════════ */
@media (max-width: 600px) {
  .thkyou_checkout-logo { padding-top: 18px; }
  .thkyou_checkout-logo img { width: 74px; }

  .thkyou_container {
    padding-block: 8px 32px;
    gap: 12px;
  }

  .thkyou_status { padding: 28px 20px 22px; }
  .thkyou_status-icon { width: 52px; height: 52px; margin-bottom: 14px; }
  .thkyou_status-icon svg { width: 24px; height: 24px; }
  .thkyou_status-title { font-size: 23px; }
  .thkyou_status-sub { font-size: 14.5px; }

  /* En columna: el correo y el número de pedido no caben en una línea. */
  .thkyou_status-meta {
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
  }

  .thkyou_receipt-head { padding: 18px 18px 14px; }
  .thkyou_product-item { padding: 14px 18px; }
  .thkyou_delivery-info { padding: 14px 18px 8px; }
  .thkyou_total-bar { margin: 8px 12px 12px; padding: 13px 15px; }
  .thkyou_total-main { font-size: 27px; }

  .thkyou_next-steps,
  .thkyou_soft-register { padding: 20px 18px 22px; }

  /*
   * El precio baja debajo del nombre: en 360 px, "Apple iPad Pro 11 M5 Chip
   * 512GB Wi-Fi Space Black" contra "1369 USD" en la misma fila deja el nombre
   * en una columna de cuatro letras.
   */
  .thkyou_product-item {
    grid-template-columns: 1fr;
    row-gap: 2px;
  }
  .thkyou_product-price {
    grid-column: 1;
    grid-row: auto;
    margin-top: 6px;
  }

  /* "¿Algo no está bien?" y el enlace, cada uno en su línea. */
  .thkyou_help-link { display: block; margin-top: 4px; }

  /* El botón debajo del campo: uno al lado del otro deja el campo inservible. */
  .thkyou_soft-row { flex-direction: column; }
  .thkyou_soft-btn { width: 100%; }
}
