/* ==========================================================================
   LA HOJA "ÚNETE A MERCADO VIVO" Y SU AVISO BREVE
   Se carga en el catalogo de cada tienda y en el Mercado, por eso no usa los
   tokens de ninguno de los dos: trae los colores de Mercado en Vivo (nopal, tinta
   verde y marfil menta) para que se lea como la misma comunidad en
   cualquier tienda, sea del color que sea.

   En celular sube desde abajo; en pantallas anchas queda al centro.
   ========================================================================== */

.cq-unete {
  --cq-nopal: #1f9e5b;
  --cq-tinta: #145c38;
  --cq-menta: #eef5ec;
  --cq-texto: #17231c;
  --cq-suave: #55645b;
  --cq-linea: #d5e2d7;
  --cq-error: #b42318;
  --cq-ease: cubic-bezier(.2, .8, .2, 1);

  box-sizing: border-box;
  width: 100vw;
  max-width: none;
  max-height: 94dvh;
  margin: auto auto 0;
  padding: 22px 20px calc(22px + env(safe-area-inset-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 0;
  border-radius: 26px 26px 0 0;
  background: #fff;
  color: var(--cq-texto);
  font: 500 15px/1.5 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  box-shadow: 0 -8px 40px -12px rgb(20 92 56 / .35);
}
.cq-unete *,
.cq-unete *::before,
.cq-unete *::after { box-sizing: border-box; }
.cq-unete::backdrop {
  background: rgb(12 30 20 / .5);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
@media (min-width: 620px) {
  .cq-unete { width: min(440px, 92vw); margin: auto; padding: 28px; border-radius: 26px; }
}
@media (prefers-reduced-motion: no-preference) {
  .cq-unete[open] { animation: cq-sube .3s var(--cq-ease); }
  .cq-unete[open]::backdrop { animation: cq-velo .3s ease; }
}
@keyframes cq-sube { from { opacity: 0; transform: translateY(28px); } }
@keyframes cq-velo { from { opacity: 0; } }

.cq-unete [hidden] { display: none !important; }
.cq-unete :focus-visible { outline: 3px solid color-mix(in oklab, var(--cq-nopal) 55%, #fff); outline-offset: 2px; }

.cq-unete__cerrar {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--cq-menta);
  color: var(--cq-tinta);
  cursor: pointer;
}
.cq-unete__cerrar svg { width: 18px; height: 18px; }

.cq-unete__marca {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--cq-tinta);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -.01em;
}
.cq-unete__sello { display: grid; place-items: center; }

.cq-unete__paso { display: grid; gap: 12px; margin: 0; }
.cq-unete__titulo { margin: 0; color: var(--cq-tinta); font-size: 26px; font-weight: 800; line-height: 1.12; letter-spacing: -.03em; text-wrap: balance; }
.cq-unete__texto { margin: 0; color: var(--cq-suave); font-size: 15px; }
.cq-unete__texto strong { color: var(--cq-texto); overflow-wrap: anywhere; }

.cq-unete__beneficios {
  display: grid;
  gap: 8px;
  margin: 2px 0 4px;
  padding: 14px;
  border-radius: 16px;
  background: var(--cq-menta);
  list-style: none;
  font-size: 14px;
  font-weight: 600;
}
.cq-unete__beneficios li { display: grid; grid-template-columns: 20px 1fr; align-items: start; gap: 10px; }
.cq-unete__beneficios svg { width: 18px; height: 18px; margin-top: 2px; color: var(--cq-nopal); }

.cq-campo { display: grid; gap: 6px; }
.cq-campo > span { color: var(--cq-texto); font-size: 13px; font-weight: 700; }
/* 16 px: con menos, Safari en iPhone agranda la pagina al enfocar el campo. */
.cq-campo input {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  border: 1.5px solid var(--cq-linea);
  border-radius: 14px;
  background: #fff;
  color: var(--cq-texto);
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .18s, box-shadow .18s;
}
.cq-campo input:focus { outline: none; border-color: var(--cq-nopal); box-shadow: 0 0 0 4px color-mix(in oklab, var(--cq-nopal) 22%, transparent); }
.cq-campo__codigo { font-size: 24px !important; font-weight: 800 !important; letter-spacing: .32em; text-align: center; font-variant-numeric: tabular-nums; }

/* Trampa para robots: fuera de la vista y del teclado. */
.cq-trampa { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.cq-unete__error { margin: 0; padding: 10px 12px; border-radius: 12px; background: #fef3f2; color: var(--cq-error); font-size: 14px; font-weight: 600; }
.cq-unete__nota { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--cq-menta); color: var(--cq-tinta); font-size: 14px; font-weight: 600; }

.cq-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  padding: 0 20px;
  border: 0;
  border-radius: 16px;
  background: var(--cq-tinta);
  color: #fff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: background-color .18s, transform .18s var(--cq-ease);
}
.cq-btn:active { transform: scale(.98); }
.cq-btn:disabled { opacity: .6; cursor: progress; }
@media (hover: hover) and (pointer: fine) {
  .cq-btn:hover { background: color-mix(in oklab, var(--cq-tinta) 86%, #000); }
}

.cq-unete__pie { margin: 0; color: var(--cq-suave); font-size: 13.5px; text-align: center; }
.cq-unete__pie a,
.cq-unete__legal a,
.cq-enlace { color: var(--cq-tinta); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.cq-enlace { padding: 6px 2px; border: 0; background: none; font: inherit; font-weight: 700; cursor: pointer; }
.cq-enlace:disabled { opacity: .5; cursor: progress; }
.cq-unete__legal { margin: 0; color: var(--cq-suave); font-size: 12px; line-height: 1.45; }

/* ---------- Aviso breve (donde la pagina no trae el suyo: el Mercado) ---------- */
.cq-aviso {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 10030;
  max-width: min(92vw, 420px);
  padding: 12px 18px;
  border-radius: 999px;
  background: #145c38;
  color: #fff;
  font: 700 14px/1.3 'Plus Jakarta Sans', system-ui, sans-serif;
  text-align: center;
  box-shadow: 0 12px 32px -12px rgb(20 92 56 / .6);
  transform: translateX(-50%);
}
@media (prefers-reduced-motion: no-preference) {
  .cq-aviso { animation: cq-aviso-entra .25s cubic-bezier(.2, .8, .2, 1); }
}
@keyframes cq-aviso-entra { from { opacity: 0; transform: translate(-50%, 10px); } }

/* ---------- Con WhatsApp (data-solo-cancelar): numero con pais, casilla, Cancelar y "Listo" ---------- */
.cq-campo > label > span { color: var(--cq-texto); font-size: 13px; font-weight: 700; }
.cq-telefono { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px; }
.cq-telefono select {
  width: 100%;
  height: 50px;
  padding: 0 10px;
  border: 1.5px solid var(--cq-linea);
  border-radius: 14px;
  background: #fff;
  color: var(--cq-texto);
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
}
.cq-telefono select:focus { outline: none; border-color: var(--cq-nopal); box-shadow: 0 0 0 4px color-mix(in oklab, var(--cq-nopal) 22%, transparent); }

.cq-casilla {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--cq-menta);
  color: var(--cq-texto);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.cq-casilla input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--cq-tinta); }

.cq-unete__botones { display: grid; gap: 8px; }
.cq-btn--quieto { background: transparent; color: var(--cq-tinta); box-shadow: inset 0 0 0 1.5px var(--cq-linea); }
@media (hover: hover) and (pointer: fine) {
  .cq-btn--quieto:hover { background: var(--cq-menta); }
}

.cq-unete__paso--listo { justify-items: center; text-align: center; padding-top: 4px; }
.cq-unete__paso--listo .cq-btn { margin-top: 6px; }
.cq-unete__palomita {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--cq-nopal);
  color: #fff;
  box-shadow: 0 10px 24px -10px rgb(20 92 56 / .7);
}
@media (prefers-reduced-motion: no-preference) {
  .cq-unete__paso--listo:not([hidden]) .cq-unete__palomita { animation: cq-palomita .45s var(--cq-ease); }
}
@keyframes cq-palomita { from { opacity: 0; transform: scale(.6); } }

/* ---------- Mandar el codigo desde WhatsApp ("manda") y "¿Eres tú?" ---------- */
a.cq-btn { text-decoration: none; }
.cq-btn svg { flex: none; width: 20px; height: 20px; }
.cq-btn--whatsapp {
  min-height: 58px;
  background: var(--cq-nopal);
  font-size: 17px;
  box-shadow: 0 12px 26px -14px rgb(20 92 56 / .8);
}
@media (hover: hover) and (pointer: fine) {
  .cq-btn--whatsapp:hover { background: color-mix(in oklab, var(--cq-nopal) 86%, #000); }
}
/* Vencido: el codigo ya no sirve, el enlace no se toca. */
.cq-btn--whatsapp[aria-disabled="true"] { opacity: .45; box-shadow: none; pointer-events: none; }

.cq-unete__codigo-caja {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 12px 14px;
  border: 1.5px dashed var(--cq-linea);
  border-radius: 14px;
  color: var(--cq-suave);
  font-size: 13.5px;
  text-align: center;
}
.cq-unete__codigo-caja strong { color: var(--cq-texto); white-space: nowrap; }
.cq-unete__codigo-caja .cq-unete__codigo {
  color: var(--cq-tinta);
  font: 800 28px/1.15 ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  letter-spacing: .12em;
  -webkit-user-select: all;
  user-select: all;
}

/* "Copiar código": una pastilla discreta bajo el codigo; "Copiado" en verde un momento */
.cq-unete__copiar {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1.5px solid var(--cq-linea);
  border-radius: 999px;
  background: transparent;
  color: var(--cq-texto);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.cq-unete__copiar:hover { border-color: var(--cq-tinta); color: var(--cq-tinta); }
.cq-unete__copiar.is-copiado { border-color: #1faf5a; color: #178f49; }
@media (prefers-reduced-motion: no-preference) {
  .cq-unete__copiar { transition: border-color .15s ease, color .15s ease, transform .15s ease; }
  .cq-unete__copiar:active { transform: scale(.97); }
}

.cq-unete__espera {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0;
  color: var(--cq-tinta);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}
.cq-unete__latido { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--cq-nopal); }
@media (prefers-reduced-motion: no-preference) {
  .cq-unete__latido { animation: cq-latido 1.4s ease-in-out infinite; }
}
@keyframes cq-latido { 50% { opacity: .35; transform: scale(.7); } }

/* ---------- La bienvenida al entrar al menu ("Hola, Lupe. Te damos la bienvenida…") ---------- */
.cq-bienvenida {
  position: fixed;
  top: calc(76px + env(safe-area-inset-top));
  left: 50%;
  z-index: 10030;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  width: min(92vw, 460px);
  padding: 12px 10px 12px 16px;
  border-radius: 18px;
  background: #145c38;
  color: #fff;
  font: 700 15px/1.35 'Plus Jakarta Sans', system-ui, sans-serif;
  box-shadow: 0 16px 40px -14px rgb(20 92 56 / .65);
  transform: translateX(-50%);
}
.cq-bienvenida__icono { font-size: 22px; line-height: 1; }
.cq-bienvenida__cerrar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgb(255 255 255 / .14);
  color: #fff;
  font: 700 20px/1 system-ui, sans-serif;
  cursor: pointer;
}
@media (prefers-reduced-motion: no-preference) {
  .cq-bienvenida { animation: cq-bienvenida-entra .35s cubic-bezier(.2, .8, .2, 1); }
}
@keyframes cq-bienvenida-entra { from { opacity: 0; transform: translate(-50%, -12px); } }
