/* ============================================================
   Checkout COD Colombia — visual Mercado Libre (limpio)
   ============================================================ */
:root {
  --yellow: #FFE600;
  --blue: #3483FA;
  --blue-dark: #2968C8;
  --blue-soft: #EAF3FF;
  --green: #00A650;
  --green-dark: #00913F;
  --green-soft: #E5F5EC;
  --ink: #333333;             /* ML usa texto gris-oscuro casi negro */
  --text: #333333;
  --muted: #737373;
  --line: #e6e6e6;            /* borde de inputs ML */
  --line-soft: #ededed;
  --bg: #ffffff;              /* fondo blanco ML */
  --card: #ffffff;
  --danger: #dc2626;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(0,0,0,.10);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body { background: var(--bg); }
body {
  font-family: var(--font);
  color: var(--ink);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Iconos SVG ---------- */
.ico {
  width: 18px; height: 18px; flex: 0 0 auto;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
  display: inline-block; vertical-align: middle;
}
.ico--sm { width: 15px; height: 15px; }
.ico--xs { width: 12px; height: 12px; stroke-width: 2.2; }
.flag-co { width: 20px; height: 13px; border-radius: 2px; display: block; box-shadow: 0 0 0 1px rgba(0,0,0,.06); }
.star { width: 14px; height: 14px; fill: #ffb400; display: inline-block; vertical-align: middle; }

/* ============================================================
   Header estilo Mercado Libre (barra amarilla)
   ============================================================ */
.ml-nav { background: var(--yellow); }
.ml-nav__inner {
  max-width: 980px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
}
.ml-nav__logo {
  flex: 0 0 auto; height: 34px;
  display: grid; place-items: center;
}
.ml-nav__logo svg { display: block; }
.ml-nav__logo img { height: 32px; width: auto; display: block; }
.ml-nav__search {
  flex: 1 1 auto; display: flex; align-items: center; gap: 8px;
  background: #fff; border-radius: 4px; height: 40px; padding: 0 12px;
  box-shadow: 0 1px 2px rgba(0,0,0,.12);
}
.ml-nav__search-ico {
  width: 18px; height: 18px; flex: 0 0 auto;
  fill: none; stroke: #999; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.ml-nav__search-input {
  border: none; outline: none; background: transparent;
  width: 100%; font-size: 15px; color: #333; font-family: var(--font);
  cursor: default;
}
.ml-nav__search-input::placeholder { color: #999; }
.ml-nav__cart {
  flex: 0 0 auto; width: 30px; height: 30px; display: grid; place-items: center; color: #333;
}
.ml-nav__cart svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* tira de confianza COD */
.trust-strip {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--green-soft); color: var(--green-dark);
  font-size: 12.5px; font-weight: 600; padding: 7px 16px;
}
.trust-strip .ico { color: var(--green-dark); }

/* ============================================================
   Layout
   ============================================================ */
.checkout {
  max-width: 980px; margin: 0 auto; padding: 18px 14px;
  display: grid; grid-template-columns: 1.2fr .9fr; gap: 22px;
  align-items: start;
}
@media (max-width: 820px) {
  .checkout { grid-template-columns: 1fr; padding: 14px 16px; gap: 16px; }
  .summary-col { order: 2; }
}

/* En desktop el formulario va en tarjeta sutil; en móvil es plano (look ML) */
.form-col { background: var(--card); }
@media (min-width: 821px) {
  .form-col {
    border: 1px solid var(--line-soft); border-radius: 8px;
    box-shadow: var(--shadow); padding: 26px;
  }
}

/* ---------- Encabezado ---------- */
.checkout-head { margin-bottom: 18px; }
.checkout-head__logo { height: 30px; width: auto; border-radius: 6px; margin-bottom: 10px; display: block; }
.checkout-head__title {
  font-size: 26px; font-weight: 600; line-height: 1.2; color: var(--ink); letter-spacing: -.3px;
}
.checkout-head__sub { font-size: 15px; color: var(--muted); margin-top: 6px; }
@media (max-width: 480px){ .checkout-head__title { font-size: 24px; } }

/* ---------- COD banner ---------- */
.cod-banner {
  display: flex; gap: 12px; align-items: center;
  background: var(--green-soft);
  border: 1px solid #b8e6cb;
  border-radius: 8px; padding: 12px 14px; margin-bottom: 24px;
}
.cod-banner__icon {
  width: 42px; height: 42px; border-radius: 11px; background: #fff;
  color: var(--green-dark); display: grid; place-items: center; flex: 0 0 auto;
  box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.cod-banner__icon .ico { width: 23px; height: 23px; }
.cod-banner strong { display: block; font-size: 15px; color: var(--green-dark); }
.cod-banner span { font-size: 13px; color: #166534; }

/* ---------- Parceiro de entrega ---------- */
.partner {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--line); border-radius: 8px;
  padding: 11px 14px; margin: 0 0 24px;
}
.partner__logo {
  flex: 0 0 auto; background: #020014; border-radius: 6px;
  padding: 6px 9px; display: grid; place-items: center; overflow: hidden;
}
.partner__logo img { height: 26px; width: auto; display: block; }
.partner__logo-fallback { display: none; font-style: italic; font-weight: 800; font-size: 14px; color: #fff; white-space: nowrap; }
.partner__logo-fallback i { color: #FF5A1F; font-style: italic; }
.partner__text strong { display: block; font-size: 14px; color: var(--ink); }
.partner__text span { font-size: 12.8px; color: var(--muted); display: inline-flex; align-items: center; gap: 4px; }
.partner__seal { width: 14px; height: 14px; flex: 0 0 auto; }

/* ---------- Secciones / campos (estilo ML) ---------- */
.step-title {
  font-size: 21px; font-weight: 600; margin: 26px 0 4px; color: var(--ink);
  display: flex; align-items: center; gap: 9px;
}
.step-title:first-of-type { margin-top: 0; }
.step-num {
  flex: 0 0 auto; background: var(--blue); color: #fff;
  width: 26px; height: 26px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13.5px; font-weight: 700;
}
.section-hint { font-size: 14px; color: var(--muted); margin: 0 0 14px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 15px; font-weight: 400; margin-bottom: 7px; color: var(--ink); }
.field .opt { color: var(--muted); font-weight: 400; }

input, select {
  width: 100%; font-family: var(--font); font-size: 16px;
  padding: 13px 16px; border: 1px solid var(--line);
  border-radius: var(--radius); background: #fff; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: #999; }
input:focus, select:focus {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(52,131,250,.16);
}
input.invalid, select.invalid { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(220,38,38,.12); }
select { appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23737373' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px;
}

.phone-wrap { display: flex; align-items: stretch; }
.phone-prefix {
  display: flex; align-items: center; gap: 7px;
  background: #f5f5f5; border: 1px solid var(--line); border-right: none;
  border-radius: var(--radius) 0 0 var(--radius); padding: 0 12px; font-size: 15px; font-weight: 600; white-space: nowrap; color: var(--ink);
}
.phone-wrap input { border-radius: 0 var(--radius) var(--radius) 0; }

.hint { display: block; font-size: 13px; color: var(--muted); margin-top: 6px; }

.geo-note {
  display: flex; align-items: center; gap: 6px;
  background: var(--blue-soft); border: 1px solid #cfe0ff; color: var(--blue-dark);
  font-size: 13px; border-radius: var(--radius); padding: 9px 12px; margin-bottom: 14px;
}
.geo-note strong { font-weight: 700; }
.city-other { margin-top: 9px; }
select:disabled { background: #f5f5f5; color: #9ca3af; cursor: not-allowed; }
.error { display: none; font-size: 13px; color: var(--danger); margin-top: 6px; font-weight: 600; }
.error.show { display: block; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- CTA (botón azul ML) ---------- */
.cta {
  width: 100%; margin-top: 12px;
  background: var(--blue); color: #fff;
  border: none; border-radius: var(--radius); cursor: pointer;
  padding: 15px; font-size: 16px; font-weight: 600; font-family: var(--font);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .08s, background .15s;
}
.cta:hover { background: var(--blue-dark); }
.cta:active { transform: translateY(1px); }
.cta:disabled { opacity: .65; cursor: not-allowed; }
.cta__price { font-weight: 700; opacity: .95; }
.cta__price::before { content: "·"; margin: 0 6px; opacity: .6; }
.cta__spinner {
  width: 18px; height: 18px; border: 2.5px solid rgba(255,255,255,.4);
  border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.reassurance {
  list-style: none; padding: 0; margin: 16px 0 0;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 7px 16px;
}
.reassurance li { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.reassurance .ico { color: var(--green); }
.form-error {
  margin-top: 14px; background: #fef2f2; border: 1px solid #fecaca; color: var(--danger);
  padding: 12px 14px; border-radius: var(--radius); font-size: 13.5px; font-weight: 600;
}

/* ============================================================
   Resumen
   ============================================================ */
.summary { position: sticky; top: 14px; background: var(--card); }
@media (min-width: 821px) {
  .summary { border: 1px solid var(--line-soft); border-radius: 8px; box-shadow: var(--shadow); padding: 22px; }
}
@media (max-width: 820px) {
  .summary { border: 1px solid var(--line-soft); border-radius: 8px; padding: 16px; }
}
.summary__title { font-size: 17px; font-weight: 700; margin-bottom: 14px; color: var(--ink); }

.product { display: flex; gap: 12px; align-items: flex-start; padding-bottom: 16px; border-bottom: 1px solid var(--line-soft); }
.product__img { width: 64px; height: 64px; object-fit: cover; border-radius: 9px; border: 1px solid var(--line-soft); background: #f8f8f8; }
.product__info { flex: 1; min-width: 0; }
.product__title { font-size: 14px; font-weight: 600; line-height: 1.3; color: var(--ink); }
.product__variant { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.product__rating { display: flex; align-items: center; gap: 6px; margin-top: 5px; }
.product__rating .stars { display: inline-flex; gap: 1px; }
.product__rating .star { width: 13px; height: 13px; }
.product__rating .rating-count, .rating-count { font-size: 11.5px; color: var(--blue); font-weight: 600; }
.product__price { font-size: 16px; font-weight: 700; white-space: nowrap; color: var(--ink); }

/* ---------- Ofertas por volumen ---------- */
.qty-offers { margin: 16px 0; }
.qty-offers__label { font-size: 13px; font-weight: 700; margin-bottom: 9px; }
.qty-options { display: grid; gap: 9px; }
.qty-opt {
  display: flex; align-items: center; gap: 11px;
  border: 1.5px solid var(--line); border-radius: 8px; padding: 12px 13px; cursor: pointer;
  transition: border-color .15s, background .15s; position: relative;
}
.qty-opt:hover { border-color: var(--blue); }
.qty-opt.selected { border-color: var(--blue); background: var(--blue-soft); }
.qty-opt__radio {
  width: 20px; height: 20px; border-radius: 50%; border: 2px solid #cbd5e1; flex-shrink: 0;
  display: grid; place-items: center;
}
.qty-opt.selected .qty-opt__radio { border-color: var(--blue); }
.qty-opt.selected .qty-opt__radio::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--blue); }
.qty-opt__body { flex: 1; }
.qty-opt__name { font-size: 13.5px; font-weight: 700; }
.qty-opt__sub { font-size: 12px; color: var(--muted); }
.qty-opt__price { text-align: right; }
.qty-opt__now { font-size: 14.5px; font-weight: 800; display: block; }
.qty-opt__was { font-size: 11.5px; color: var(--muted); text-decoration: line-through; }
.qty-opt__badge {
  position: absolute; top: -9px; right: 11px;
  background: var(--yellow); color: #111; font-size: 10.5px; font-weight: 800;
  padding: 2px 8px; border-radius: 999px;
}

/* ---------- Totales ---------- */
.totals { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.totals__row { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 8px; color: #555; }
.free-ship { color: var(--green); font-weight: 700; }
.totals__row--grand { font-size: 17px; font-weight: 700; color: var(--ink); margin-top: 6px; padding-top: 10px; border-top: 1px dashed var(--line); }

/* ---------- Confianza + reseñas ---------- */
.trust-list { list-style: none; margin: 16px 0 0; padding: 14px; background: #f9fafb; border-radius: 8px; }
.trust-list li { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: #555; padding: 5px 0; }
.trust-list .ico { color: var(--green); }

.reviews { margin-top: 16px; }
.reviews__title { font-size: 13px; font-weight: 800; margin-bottom: 10px; }
.review {
  border: 1px solid var(--line-soft); border-radius: 8px; padding: 11px 12px; margin-bottom: 9px; background: #fff;
}
.review__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.review__name { font-size: 12.8px; font-weight: 700; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.review__verified { display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; color: var(--blue); font-weight: 700; }
.seal-ml { width: 13px; height: 13px; flex: 0 0 auto; display: inline-block; vertical-align: middle; }
.review__stars { display: inline-flex; gap: 1px; }
.review__stars .star { width: 12px; height: 12px; }
.review__text { font-size: 12.5px; color: #4b5563; }

/* ---------- Éxito ---------- */
.success-overlay {
  position: fixed; inset: 0; background: #fff;
  display: grid; place-items: center; padding: 20px; z-index: 50;
  animation: fade .2s ease;
}
@keyframes fade { from { opacity: 0; } }
.success__card {
  background: #fff; border-radius: 16px; padding: 30px 26px; max-width: 380px; width: 100%;
  text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.success__check {
  width: 64px; height: 64px; border-radius: 50%; background: var(--green); color: #fff;
  display: grid; place-items: center; margin: 0 auto 16px;
  animation: pop .3s ease;
}
.success__check svg {
  width: 34px; height: 34px; fill: none; stroke: #fff; stroke-width: 3;
  stroke-linecap: round; stroke-linejoin: round;
}
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
.success__card h2 { font-size: 20px; margin-bottom: 8px; }
.success__card p { font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.success__order { font-weight: 800; color: var(--ink) !important; font-size: 16px !important; margin: 10px 0 14px !important; }
#success-msg strong { color: var(--ink); font-weight: 700; }
.success__note {
  display: flex; gap: 10px; align-items: flex-start; text-align: left;
  background: #fff7ed; border: 1px solid #fed7aa; border-radius: 10px;
  padding: 12px 14px; margin-top: 18px;
}
.success__note .ico { color: #ea580c; flex: 0 0 auto; margin-top: 1px; }
.success__note p { font-size: 13px !important; color: #7c2d12 !important; margin: 0 !important; line-height: 1.5; }
.success__note strong { color: #7c2d12; font-weight: 700; }
