/* ==========================================================================
   GORDIAN — Landing de campaña promocional
   Paleta y convenciones alineadas al design system de Gordian Foods Connect.
   Tipografía Segoe, tamaños en rem, base 15px móvil / 16px escritorio.
   Diseñada primero para teléfono: el tráfico llega desde WhatsApp.
   ========================================================================== */

:root {
  --forest: #252E28;
  --pine:   #37461F;
  --moss:   #4C5B2B;
  --olive:  #4E6E1F;
  --lime:   #C7E36A;
  --lime2:  #AEC93F;
  --cream:  #F5F4ED;
  --paper:  #ffffff;
  --line:   #E3E1D6;
  --ink:    #20261F;
  --muted:  #6B7263;
  --danger: #8C2F1C;
  --warn:   #8A6D0B;
  --gd-font: "Segoe UI", Segoe, Tahoma, Geneva, Verdana, sans-serif;
}

html { font-size: 15px; }
@media (min-width: 768px) { html { font-size: 16px; } }

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--gd-font);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---------- Encabezado de marca ---------- */
.gd-hdr { background: var(--forest); padding: 0.9rem 1rem; }
.gd-hdr-in {
  max-width: 46rem; margin: 0 auto;
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  flex-wrap: wrap;
}
.gd-marca {
  color: var(--cream); font-weight: 700; font-size: 1.25rem; letter-spacing: .06em;
}
.gd-tag {
  color: var(--lime); font-size: .62rem; letter-spacing: .1em;
  text-transform: uppercase; font-weight: 700;
}
.gd-rule { height: 4px; background: var(--lime); }

.gd-main { flex: 1; max-width: 46rem; width: 100%; margin: 0 auto; padding: 1.25rem 1rem 2rem; }

/* ---------- Pie ---------- */
.gd-ftr {
  border-top: 1px solid var(--line); background: var(--paper);
  padding: 1rem; text-align: center; font-size: .72rem; color: var(--muted);
}
.gd-ftr p { margin: .15rem 0; }
.gd-priv { max-width: 30rem; margin: .35rem auto 0; }

/* ---------- Tarjetas ---------- */
.gd-card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 12px; overflow: hidden; margin-bottom: 1.1rem;
}
.gd-card > .hd {
  background: var(--forest); color: var(--cream);
  padding: .7rem 1rem; font-weight: 700; font-size: .82rem;
  text-transform: uppercase; letter-spacing: .05em;
}
.gd-card > .bd { padding: 1rem; }

/* ---------- Promoción ---------- */
.gd-promo-img {
  width: 100%; max-height: 17rem; object-fit: cover; display: block;
  background: var(--cream);
}
.gd-promo-tit {
  font-size: 1.5rem; line-height: 1.2; color: var(--forest);
  margin: 0 0 .4rem; font-weight: 700;
}
.gd-promo-desc { color: var(--muted); margin: 0 0 .9rem; font-size: .92rem; }

.gd-precio {
  display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap;
  padding: .8rem 1rem; background: var(--cream);
  border-radius: 10px; border: 1px solid var(--line); margin-bottom: .3rem;
}
.gd-precio .val { font-size: 2rem; font-weight: 700; color: var(--forest); line-height: 1; }
.gd-precio .lbl { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em;
                  color: var(--olive); font-weight: 700; }
.gd-envio { font-size: .78rem; color: var(--muted); margin: .4rem 0 0; }

/* ---------- Resumen de la compra (al iniciar el formulario) ---------- */
.gd-compra { display: flex; gap: .8rem; align-items: center; margin-bottom: 1rem; }
.gd-compra-foto {
  width: 4.5rem; height: 4.5rem; object-fit: cover; border-radius: 10px;
  border: 1px solid var(--line); flex: 0 0 auto; background: var(--cream);
}
.gd-compra-txt { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.gd-compra-txt .t { font-weight: 700; color: var(--forest); font-size: .95rem; line-height: 1.25; }
.gd-compra-txt .u { font-size: .8rem; color: var(--muted); }

/* ---------- Cantidad: − valor + ---------- */
.gd-cant { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.gd-cant .lbl {
  font-weight: 700; font-size: .68rem; text-transform: uppercase;
  letter-spacing: .06em; color: var(--moss);
}

.gd-stepper { display: flex; align-items: center; gap: 0; }
.gd-stepper .paso {
  /* 2.75rem ≈ 44px: el mínimo recomendado para tocar con el dedo sin fallar. */
  width: 2.75rem; height: 2.75rem;
  border: 1.5px solid var(--line); background: var(--paper);
  color: var(--forest); font-size: 1.35rem; font-weight: 700; line-height: 1;
  cursor: pointer; font-family: var(--gd-font);
  display: flex; align-items: center; justify-content: center;
}
.gd-stepper .paso:first-child { border-radius: 10px 0 0 10px; }
.gd-stepper .paso:last-child  { border-radius: 0 10px 10px 0; }
.gd-stepper .paso:hover:not(:disabled) { background: var(--cream); border-color: var(--lime2); }
.gd-stepper .paso:disabled { opacity: .35; cursor: not-allowed; }

.gd-stepper input {
  width: 3.4rem; height: 2.75rem; text-align: center;
  border: 1.5px solid var(--line); border-left: none; border-right: none;
  font-family: var(--gd-font); font-size: 1.05rem; font-weight: 700;
  color: var(--ink); background: var(--paper);
  -moz-appearance: textfield; appearance: textfield;
}
.gd-stepper input::-webkit-outer-spin-button,
.gd-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.gd-stepper input:focus { outline: none; }

/* ---------- Totales del resumen ---------- */
.gd-totales { width: 100%; border-collapse: collapse; font-size: .88rem; margin-top: .9rem; }
.gd-totales td { padding: .45rem 0; border-bottom: 1px solid var(--line); color: var(--muted); }
.gd-totales td:last-child { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); }
.gd-totales tr.tot td {
  border-bottom: none; font-weight: 700; color: var(--forest);
  font-size: 1.05rem; padding-top: .6rem;
}

/* ---------- Formulario ---------- */
.gd-grid { display: grid; grid-template-columns: 1fr; gap: .85rem; }
@media (min-width: 640px) {
  .gd-grid.dos { grid-template-columns: 1fr 1fr; }
  .gd-col-full { grid-column: 1 / -1; }
}

.form-label {
  display: block; font-weight: 700; font-size: .68rem;
  text-transform: uppercase; letter-spacing: .06em; color: var(--moss);
  margin-bottom: .25rem;
}
.form-label .req { color: var(--danger); }

.form-control, .form-select {
  width: 100%; padding: .6rem .7rem;
  border: 1.5px solid var(--line); border-radius: 8px;
  font-family: var(--gd-font); font-size: 1rem; color: var(--ink);
  background: var(--paper);
}
.form-control:focus, .form-select:focus {
  outline: none; border-color: var(--lime2);
  box-shadow: 0 0 0 3px rgba(174, 201, 63, .28);
}
.form-ayuda { font-size: .72rem; color: var(--muted); margin: .2rem 0 0; }

/* Trampa anti-bot: invisible para personas, visible para autómatas.
   No se usa display:none porque algunos bots lo detectan. */
.gd-trampa {
  position: absolute; left: -9999px; width: 1px; height: 1px;
  overflow: hidden; opacity: 0;
}

/* ---------- Botones ---------- */
.btn-gd {
  display: block; width: 100%; padding: .85rem 1rem;
  background: var(--forest); color: var(--lime);
  border: none; border-radius: 10px;
  font-family: var(--gd-font); font-size: 1.02rem; font-weight: 700;
  cursor: pointer; text-align: center; text-decoration: none;
}
.btn-gd:hover { background: var(--pine); }
.btn-gd:disabled { opacity: .6; cursor: not-allowed; }

.btn-ghost {
  display: inline-block; padding: .6rem 1.1rem;
  background: transparent; color: var(--forest);
  border: 1.5px solid var(--forest); border-radius: 10px;
  font-weight: 700; text-decoration: none; font-size: .9rem;
}

/* ---------- Mensajes ---------- */
.gd-msg {
  padding: .85rem 1rem; border-radius: 0 10px 10px 0;
  margin-bottom: 1rem; font-size: .88rem;
  background: var(--cream); border-left: 5px solid var(--lime2);
}
.gd-msg.err   { background: #F9E7E3; border-left-color: var(--danger); color: #6B2415; }
.gd-msg.warn  { background: #FBF6E9; border-left-color: #C9A227; color: #6B540A; }
.gd-msg strong { display: block; margin-bottom: .2rem; }

.validation-summary-errors ul { margin: 0; padding-left: 1.1rem; }
.field-validation-error { color: var(--danger); font-size: .76rem; display: block; margin-top: .2rem; }
.input-validation-error { border-color: var(--danger) !important; }

/* ---------- Estado del pedido ---------- */
.gd-estado {
  text-align: center; padding: 1.5rem 1rem;
}
.gd-estado .icono { font-size: 2.6rem; line-height: 1; margin-bottom: .5rem; }
.gd-estado h1 { font-size: 1.4rem; color: var(--forest); margin: 0 0 .4rem; }
.gd-estado p { color: var(--muted); margin: 0 0 .8rem; font-size: .92rem; }
.gd-ref {
  font-family: Consolas, "Courier New", monospace; font-size: .8rem;
  background: var(--cream); border: 1px solid var(--line);
  border-radius: 6px; padding: .3rem .55rem; display: inline-block;
}

.gd-resumen { width: 100%; border-collapse: collapse; font-size: .88rem; margin-top: .6rem; }
.gd-resumen td { padding: .45rem 0; border-bottom: 1px solid var(--line); }
.gd-resumen td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.gd-resumen tr:last-child td { border-bottom: none; font-weight: 700; color: var(--forest); }

/* ---------- Cuenta regresiva del aviso ---------- */
.gd-cuenta {
  font-size: 2.2rem; font-weight: 700; color: var(--forest);
  font-variant-numeric: tabular-nums;
}

/* ---------- Confirmación de ubicación ---------- */
.gd-ubi {
  display: flex; gap: .8rem; align-items: center; flex-wrap: wrap;
  padding: .9rem 1rem; border-radius: 10px;
  background: var(--cream); border: 1.5px solid var(--line);
}
.gd-ubi.ok  { background: #EDF5DC; border-color: var(--lime2); }
.gd-ubi.mal { background: #F9E7E3; border-color: var(--danger); }
.gd-ubi-txt { flex: 1 1 14rem; display: flex; flex-direction: column; gap: .2rem; }
.gd-ubi-txt strong { font-size: .88rem; color: var(--forest); }
.gd-ubi-txt span { font-size: .78rem; color: var(--muted); line-height: 1.4; }
.gd-ubi.mal .gd-ubi-txt span { color: #8C2F1C; }
.gd-ubi button { flex: 0 0 auto; padding: .6rem 1rem; font-size: .88rem; }

/* ---------- Banda de modo pruebas ----------
   Deliberadamente imposible de ignorar: acá se prueba sobre el ambiente
   publicado, y el riesgo real es confundir una compra de prueba con una real. */
.gd-banda-prueba {
  background: repeating-linear-gradient(45deg, #C9A227, #C9A227 12px, #8A6D0B 12px, #8A6D0B 24px);
  color: #fff; text-align: center; padding: .45rem 1rem;
  font-size: .74rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; text-shadow: 0 1px 2px rgba(0,0,0,.45);
}

/* ==========================================================================
   PORTADA DE LA PROMOCIÓN
   ========================================================================== */
.gd-hero {
  position: relative; border-radius: 16px; overflow: hidden;
  margin-bottom: 1rem; background: var(--forest);
  min-height: 13rem; display: flex; align-items: flex-end;
  box-shadow: 0 10px 30px -12px rgba(37,46,40,.45);
}
.gd-hero-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: block;
}
/* Degradado sobre la foto: el título se lee igual sobre una imagen clara
   que sobre una oscura, sin depender de cómo haya salido la foto. */
.gd-hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top,
    rgba(20,26,21,.92) 0%, rgba(20,26,21,.72) 35%, rgba(20,26,21,.15) 70%, rgba(20,26,21,0) 100%);
}
.gd-hero.sinfoto::after {
  background: radial-gradient(circle at 20% 20%, rgba(199,227,106,.22), transparent 60%);
}
.gd-hero-txt { position: relative; z-index: 1; padding: 1.4rem 1.2rem 1.2rem; width: 100%; }

.gd-sello {
  display: inline-block; background: var(--lime); color: var(--forest);
  font-size: .68rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
  padding: .25rem .7rem; border-radius: 20px; margin-bottom: .55rem;
  box-shadow: 0 2px 10px rgba(199,227,106,.5);
}
.gd-hero-tit {
  margin: 0 0 .35rem; font-size: 1.85rem; line-height: 1.12; font-weight: 800;
  color: #fff; letter-spacing: -.02em; text-shadow: 0 2px 12px rgba(0,0,0,.4);
}
.gd-hero-desc {
  margin: 0; font-size: .92rem; line-height: 1.45; color: rgba(255,255,255,.88);
  max-width: 34rem;
}

/* ---------- Precio ---------- */
.gd-precio-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: 14px;
  padding: 1rem 1.2rem; margin-bottom: 1rem;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  box-shadow: 0 2px 10px -4px rgba(37,46,40,.12);
}
.gd-precio-in { display: flex; align-items: baseline; gap: .18rem; color: var(--forest); }
.gd-precio-in .moneda { font-size: 1.35rem; font-weight: 700; }
.gd-precio-in .val {
  font-size: 2.6rem; font-weight: 800; line-height: 1;
  letter-spacing: -.03em; font-variant-numeric: tabular-nums;
}
.gd-precio-notas { display: flex; flex-direction: column; gap: .12rem; text-align: right; }
.gd-precio-notas span { font-size: .78rem; color: var(--muted); }

/* ---------- Señales de confianza ---------- */
.gd-confianza {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem;
  margin-bottom: 1.2rem;
}
.gd-confianza > div {
  background: var(--paper); border: 1px solid var(--line); border-radius: 12px;
  padding: .7rem .5rem; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: .3rem;
  font-size: .72rem; font-weight: 700; color: var(--forest); line-height: 1.25;
}
.gd-confianza .ic { width: 2.1rem; height: 2.1rem; display: block; }
.gd-confianza small { font-weight: 400; color: var(--muted); font-size: .66rem; }

/* ---------- Refinamiento general ---------- */
.gd-card { box-shadow: 0 2px 10px -6px rgba(37,46,40,.16); border-radius: 14px; }
.btn-gd {
  border-radius: 12px; letter-spacing: .01em;
  box-shadow: 0 6px 18px -8px rgba(37,46,40,.7);
  transition: transform .08s ease, background .15s ease;
}
.btn-gd:hover:not(:disabled) { transform: translateY(-1px); }
.btn-gd:active:not(:disabled) { transform: translateY(0); }

/* La barra inferior fija: en teléfono el botón de pagar queda lejos después
   de llenar el formulario. Así el total y el botón están siempre a la vista. */
.gd-barra-fija {
  position: sticky; bottom: 0; z-index: 20;
  background: rgba(255,255,255,.97); backdrop-filter: blur(8px);
  border-top: 1px solid var(--line); margin: 1rem -1rem 0; padding: .7rem 1rem;
  display: flex; align-items: center; gap: .8rem;
  box-shadow: 0 -6px 20px -10px rgba(37,46,40,.35);
}
.gd-barra-fija .tot { flex: 0 0 auto; line-height: 1.1; }
.gd-barra-fija .tot .k {
  display: block; font-size: .6rem; text-transform: uppercase;
  letter-spacing: .07em; color: var(--muted); font-weight: 700;
}
.gd-barra-fija .tot .v {
  font-size: 1.25rem; font-weight: 800; color: var(--forest);
  font-variant-numeric: tabular-nums;
}
.gd-barra-fija .btn-gd { flex: 1; margin: 0; }

@media (min-width: 640px) {
  .gd-hero { min-height: 17rem; }
  .gd-hero-tit { font-size: 2.2rem; }
}
