/* =========================================================================
   Niddo Kids — Checkout minimalista (estilo Shopify)
   Blanco, tipografía limpia, bordes finos, una sola pantalla. Standalone
   (no depende de styles.css para no arrastrar la estética de la landing).
   ========================================================================= */

:root {
  --bg: #ffffff;
  --panel: #fafafa;
  --line: #e4e4e7;
  --line-2: #d4d4d8;
  --ink: #18181b;
  --ink-2: #3f3f46;
  --muted: #71717a;
  --faint: #a1a1aa;
  --accent: #14807e;     /* teal Niddo, apagado */
  --accent-ink: #0f6462;
  --green: #157347;
  --green-bg: #e8f5ee;
  --danger: #c0392b;
  --focus: rgba(20, 128, 126, 0.16);
  --r: 8px;
  --font: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: none; background: none; }
input, select { font: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---------- Barra superior ---------- */
.ck-top {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.ck-top__in {
  max-width: 1000px; margin-inline: auto;
  padding: 16px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.ck-top__logo img { height: 30px; width: auto; }
.ck-top__secure { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.ck-top__secure svg { width: 14px; height: 14px; }

/* ---------- Layout ---------- */
.ck { max-width: 1000px; margin-inline: auto; }
.ck-grid { display: flex; flex-direction: column; }
.ck-aside { order: -1; background: var(--panel); border-bottom: 1px solid var(--line); }
.ck-main { padding: 24px 20px 48px; min-width: 0; }
@media (min-width: 860px) {
  .ck-grid { display: grid; grid-template-columns: 1fr 400px; }
  .ck-main { grid-column: 1; grid-row: 1; padding: 40px 48px 64px 20px; }
  .ck-aside { grid-column: 2; grid-row: 1; border-bottom: none; border-left: 1px solid var(--line); min-height: calc(100vh - 63px); }
}

/* ---------- Secciones ---------- */
.ck-sec { margin-bottom: 30px; }
.ck-sec:last-child { margin-bottom: 0; }
.ck-sec__title { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 14px; }
.ck-sec__title .ck-note { font-weight: 400; font-size: 13px; color: var(--muted); margin-left: 8px; }

/* ---------- Campos ---------- */
.ck-field { margin-bottom: 12px; position: relative; }
.ck-field label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 5px; }
.ck-req { color: var(--danger); }
.ck-input, .ck-select {
  width: 100%; padding: 11px 12px;
  border: 1px solid var(--line-2); border-radius: var(--r);
  background: #fff; color: var(--ink); line-height: 1.2;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ck-input::placeholder { color: var(--faint); }
.ck-input:focus, .ck-select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus); }
.ck-field.has-error .ck-input, .ck-field.has-error .ck-select { border-color: var(--danger); }
.ck-err { display: block; font-size: 12px; color: var(--danger); margin-top: 4px; min-height: 0; }
.ck-row { display: grid; gap: 12px; }
@media (min-width: 480px) { .ck-row-2 { grid-template-columns: 1fr 1fr; } .ck-row-cp { grid-template-columns: 1fr 1.4fr; } }

/* ---------- Producto (arriba, compacto) ---------- */
.ck-prod { display: flex; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r); }
.ck-prod__img { flex: none; width: 64px; height: 64px; border-radius: 6px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; }
.ck-prod__img img { width: 52px; }
.ck-prod__name { font-weight: 700; font-size: 15px; }
.ck-prod__desc { font-size: 13px; color: var(--muted); margin-top: 1px; }
.ck-prod__price { font-weight: 700; margin-top: 6px; }
.ck-prod__price span { font-weight: 400; font-size: 12.5px; color: var(--muted); margin-left: 4px; }

.ck-qty { display: flex; align-items: center; justify-content: space-between; margin: 16px 0 10px; }
.ck-qty__lbl { font-size: 14px; color: var(--ink-2); }
.ck-stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; }
.ck-stepper button { width: 34px; height: 34px; font-size: 17px; color: var(--ink-2); display: grid; place-items: center; }
.ck-stepper button:disabled { color: var(--faint); cursor: not-allowed; }
.ck-stepper span { min-width: 34px; text-align: center; font-weight: 600; border-inline: 1px solid var(--line-2); height: 34px; line-height: 34px; }

.ck-units { display: grid; gap: 8px; }
.ck-unit { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); font-size: 13.5px; }
.ck-unit__n { font-weight: 600; color: var(--muted); min-width: 58px; }
.ck-unit label.ck-colorlbl { font-size: 13px; color: var(--muted); }
.ck-unit .ck-select { width: auto; min-width: 120px; padding: 7px 10px; }
.ck-unit__ins { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; color: var(--ink-2); cursor: pointer; }
.ck-unit__ins input { width: 15px; height: 15px; accent-color: var(--accent); }

.ck-terms { margin-top: 10px; font-size: 13px; }
.ck-terms summary { cursor: pointer; color: var(--accent-ink); }
.ck-terms p { color: var(--muted); margin-top: 6px; line-height: 1.5; }
.ck-terms a { color: var(--accent-ink); text-decoration: underline; }

/* ---------- Envío ---------- */
.ck-ship { margin-top: 10px; font-size: 13.5px; border-radius: var(--r); padding: 10px 12px; border: 1px solid var(--line); display: flex; gap: 8px; align-items: flex-start; }
.ck-ship.is-free { background: var(--green-bg); border-color: #b7e0c7; color: var(--green); }
.ck-ship.is-dac { background: #fbf7ec; border-color: #ecdcb3; color: #8a6d1c; }
.ck-ship svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.ck-ship b { color: inherit; }

/* ---------- Pago ---------- */
.ck-pay { border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; }
.ck-pay__opt { display: block; border-bottom: 1px solid var(--line); }
.ck-pay__opt:last-child { border-bottom: none; }
.ck-pay__opt input { position: absolute; opacity: 0; pointer-events: none; }
.ck-pay__head { display: flex; align-items: center; gap: 10px; padding: 13px 14px; cursor: pointer; }
.ck-pay__opt input:checked ~ .ck-pay__head { background: #f4faf9; }
.ck-radio { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line-2); display: grid; place-items: center; }
.ck-pay__opt input:checked ~ .ck-pay__head .ck-radio { border-color: var(--accent); }
.ck-pay__opt input:checked ~ .ck-pay__head .ck-radio::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.ck-pay__label { font-weight: 600; font-size: 14.5px; }
.ck-pay__sub { font-size: 12.5px; color: var(--muted); }
.ck-pay__icons { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.ck-brand { height: 22px; width: auto; border: 1px solid var(--line); border-radius: 4px; background: #fff; }

/* ---------- Botón + legal ---------- */
.ck-submit {
  width: 100%; margin-top: 18px; padding: 15px;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 15px;
  border-radius: var(--r); display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background 0.15s;
}
.ck-submit:hover { background: var(--accent-ink); }
.ck-submit:disabled { opacity: 0.55; cursor: default; }
.ck-status { margin-top: 10px; font-size: 13px; color: var(--danger); min-height: 0; }
.ck-legal { margin-top: 12px; font-size: 12px; color: var(--faint); line-height: 1.5; text-align: center; }
.ck-legal a { color: var(--muted); text-decoration: underline; }
.ck-legal svg { width: 12px; height: 12px; display: inline; vertical-align: -1px; margin-right: 3px; }

/* ---------- Resumen (aside) ---------- */
.ck-sum { padding: 28px 20px; }
@media (min-width: 860px) { .ck-sum { position: sticky; top: 24px; padding: 12px 20px; } }
.ck-sum__item { display: flex; gap: 12px; align-items: center; padding-bottom: 16px; }
.ck-sum__thumb { flex: none; width: 56px; height: 56px; border-radius: 8px; border: 1px solid var(--line-2); background: #fff; display: grid; place-items: center; position: relative; }
.ck-sum__thumb img { width: 42px; }
.ck-sum__thumb b { position: absolute; top: -8px; right: -8px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--muted); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.ck-sum__name { font-weight: 600; font-size: 14px; }
.ck-sum__meta { font-size: 12.5px; color: var(--muted); }
.ck-sum__lines { border-top: 1px solid var(--line); padding-top: 14px; }
.ck-sum__row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--ink-2); padding: 4px 0; }
.ck-sum__row[hidden] { display: none; }
.ck-sum__row.is-free span:last-child { color: var(--green); }
.ck-sum__total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--line); margin-top: 12px; padding-top: 14px; }
.ck-sum__total .t-lbl { font-size: 15px; font-weight: 600; }
.ck-sum__total .t-cur { font-size: 12px; color: var(--muted); margin-right: 5px; }
.ck-sum__total .t-val { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.ck-sum__note { font-size: 12px; color: var(--muted); margin-top: 12px; line-height: 1.5; }

/* ---------- Confirmación transferencia ---------- */
.ck-done { max-width: 560px; margin: 40px auto; padding: 0 20px 60px; }
.ck-done__ic { width: 48px; height: 48px; margin: 0 auto 14px; border-radius: 50%; background: var(--green-bg); color: var(--green); display: grid; place-items: center; }
.ck-done__ic svg { width: 24px; height: 24px; }
.ck-done h1 { text-align: center; font-size: 22px; font-weight: 800; }
.ck-done > p { text-align: center; color: var(--muted); margin-top: 6px; font-size: 14px; }
.ck-acct { border: 1px solid var(--line-2); border-radius: var(--r); padding: 16px; margin: 22px 0; }
.ck-acct h2 { font-size: 14px; font-weight: 700; margin-bottom: 10px; }
.ck-acct__row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.ck-acct__row:last-of-type { border-bottom: none; }
.ck-acct__row span { color: var(--muted); }
.ck-acct__row b { text-align: right; }
.ck-acct__num { display: inline-flex; align-items: center; gap: 8px; }
.ck-copy { font-size: 11px; border: 1px solid var(--line-2); border-radius: 5px; padding: 3px 7px; color: var(--accent-ink); }
.ck-acct__foot { font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.ck-wa { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 13px; background: #25d366; color: #fff; font-weight: 700; border-radius: var(--r); }
.ck-wa svg { width: 20px; height: 20px; }
.ck-done__mail { text-align: center; font-size: 13px; color: var(--muted); margin-top: 14px; }
.ck-done__back { display: block; text-align: center; margin-top: 18px; color: var(--accent-ink); text-decoration: underline; font-size: 14px; }

.ck-return { max-width: 640px; margin: 24px auto 0; padding: 0 20px; }

/* Overlay de redirección a Mercado Pago */
.ck-redirect {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center; padding: 24px;
  background: rgba(255, 255, 255, 0.96);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
.ck-redirect__box { text-align: center; }
.ck-redirect__spin {
  width: 46px; height: 46px; margin: 0 auto 18px;
  border: 4px solid #e4e4e7; border-top-color: #009ee3; border-radius: 50%;
  animation: ck-spin 0.8s linear infinite;
}
@keyframes ck-spin { to { transform: rotate(360deg); } }
.ck-redirect h2 { font-size: 18px; font-weight: 700; color: var(--ink); }
.ck-redirect h2 span { color: #009ee3; }
.ck-redirect p { font-size: 14px; color: var(--muted); margin-top: 6px; }
@media (prefers-reduced-motion: reduce) { .ck-redirect__spin { animation-duration: 2s; } }

.is-hidden { display: none !important; }
