/* ============================================================
   TiendaIQ COD — estilos del botón y el formulario en la tienda.
   TODO va scoped bajo .tiq-cod / #tiq-cod-modal para no pisar el tema.
   Los colores del botón llegan por variables inline desde la config.
   ============================================================ */

.tiq-cod-boton {
  --tiq-fondo: #000;
  --tiq-texto: #fff;
  --tiq-radio: 6px;
  --tiq-tam: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 100%;
  margin-top: 12px;
  padding: 15px 20px;
  background: var(--tiq-fondo);
  color: var(--tiq-texto);
  border: var(--tiq-borde-ancho, 0px) solid var(--tiq-borde-color, #000);
  border-radius: var(--tiq-radio);
  font-size: var(--tiq-tam);
  font-weight: 700;
  font-family: inherit;
  line-height: 1.25;
  cursor: pointer;
  text-align: center;
  box-shadow: var(--tiq-sombra, none);
  transition: transform .12s ease, opacity .12s ease;
}
.tiq-cod-boton:hover { opacity: .92; }
.tiq-cod-boton:active { transform: scale(.99); }
.tiq-cod-boton__fila { display: flex; align-items: center; gap: 9px; }
.tiq-cod-boton__icono { width: 21px; height: 21px; flex: 0 0 auto; }
.tiq-cod-boton__sub { font-size: .78em; font-weight: 500; opacity: .85; }

/* animaciones opcionales del botón */
@keyframes tiq-latido { 0%,100% { transform: scale(1); } 50% { transform: scale(1.03); } }
@keyframes tiq-sacudida {
  0%, 88%, 100% { transform: translateX(0); }
  90% { transform: translateX(-3px); } 92% { transform: translateX(3px); }
  94% { transform: translateX(-3px); } 96% { transform: translateX(3px); }
}
.tiq-cod-boton--latido { animation: tiq-latido 1.6s ease-in-out infinite; }
.tiq-cod-boton--sacudida { animation: tiq-sacudida 3.5s ease-in-out infinite; }

/* barra adhesiva en móvil */
.tiq-cod-sticky {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 999998;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: #fff;
  box-shadow: 0 -4px 18px rgba(0,0,0,.12);
  display: none;
}
.tiq-cod-sticky .tiq-cod-boton { margin-top: 0; }
@media (max-width: 749px) { .tiq-cod-sticky--activa { display: block; } }

/* ---------- modal ---------- */

#tiq-cod-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 4vh 14px;
  background: rgba(15, 17, 20, .55);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, sans-serif;
  line-height: 1.4;
}
#tiq-cod-modal *, #tiq-cod-modal *::before, #tiq-cod-modal *::after { box-sizing: border-box; }

.tiq-cod-caja {
  width: 100%;
  max-width: 960px;
  background: var(--tiq-form-fondo, #fff);
  border: var(--tiq-form-borde-ancho, 0px) solid var(--tiq-form-borde-color, #000);
  border-radius: var(--tiq-form-radio, 14px);
  box-shadow: 0 24px 70px rgba(0,0,0,.28);
  padding: 26px 30px 30px;
  color: var(--tiq-form-texto, #111);
  animation: tiq-entrada .18s ease;
}
@keyframes tiq-entrada { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.tiq-cod-cab {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid #ececec;
  margin-bottom: 18px;
}
.tiq-cod-cab__icono { width: 22px; height: 22px; flex: 0 0 auto; }
.tiq-cod-cab__titulo {
  flex: 1;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: .04em;
  margin: 0;
  text-transform: uppercase;
}
.tiq-cod-cerrar {
  background: none;
  border: 0;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  color: #444;
  padding: 2px 6px;
}
.tiq-cod-cerrar:hover { color: #000; }

.tiq-cod-cuerpo { display: grid; grid-template-columns: 1fr 340px; gap: 26px; }
@media (max-width: 809px) { .tiq-cod-cuerpo { grid-template-columns: 1fr; } }

.tiq-cod-sub {
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 16px;
}

/* campos */
.tiq-cod-campos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.tiq-cod-campo { display: flex; flex-direction: column; gap: 5px; }
.tiq-cod-campo--ancho { grid-column: 1 / -1; }
@media (max-width: 519px) { .tiq-cod-campos { grid-template-columns: 1fr; } }
.tiq-cod-campo label { font-size: 13px; font-weight: 600; color: inherit; }
.tiq-cod-campo label .tiq-req { color: #d40000; }
.tiq-cod-entrada {
  position: relative;
  display: flex;
  align-items: center;
}
.tiq-cod-entrada svg {
  position: absolute;
  left: 11px;
  width: 16px;
  height: 16px;
  color: #8a8f98;
  pointer-events: none;
}
.tiq-cod-campo input,
.tiq-cod-campo select,
.tiq-cod-campo textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px 10px 36px;
  border: var(--tiq-campo-borde-ancho, 1px) solid var(--tiq-campo-borde, #cbcbcb);
  border-radius: var(--tiq-campo-radio, 8px);
  background: var(--tiq-campo-fondo, #fff);
  color: var(--tiq-campo-texto, #111);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  appearance: none;
}
.tiq-cod-campo textarea { min-height: 64px; padding-top: 11px; resize: vertical; }
.tiq-cod-campo input:focus,
.tiq-cod-campo select:focus,
.tiq-cod-campo textarea:focus { border-color: #111; }
.tiq-cod-campo--invalido input,
.tiq-cod-campo--invalido select,
.tiq-cod-campo--invalido textarea { border-color: #d40000; }
.tiq-cod-campo__error { font-size: 12px; color: #d40000; display: none; }
.tiq-cod-campo--invalido .tiq-cod-campo__error { display: block; }

/* checks (boletín / términos) */
.tiq-cod-checks { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.tiq-cod-check { display: flex; align-items: flex-start; gap: 9px; font-size: 14px; cursor: pointer; }
.tiq-cod-check input { width: 17px; height: 17px; margin-top: 1px; flex: 0 0 auto; accent-color: #111; }
.tiq-cod-check a { color: inherit; }

/* resumen */
.tiq-cod-resumen { display: flex; flex-direction: column; gap: 14px; }
.tiq-cod-prod {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #e7e7e7;
  border-radius: 10px;
  padding: 12px;
}
.tiq-cod-prod__foto {
  width: 58px; height: 58px;
  border-radius: 8px;
  object-fit: cover;
  background: #f3f3f3;
  flex: 0 0 auto;
}
.tiq-cod-prod__info { flex: 1; min-width: 0; }
.tiq-cod-prod__titulo {
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.tiq-cod-prod__precio { font-size: 14px; font-weight: 600; color: #333; }
.tiq-cod-cant { display: inline-flex; align-items: center; gap: 0; border: 1px solid #d5d5d5; border-radius: 7px; overflow: hidden; }
.tiq-cod-cant button {
  width: 30px; height: 32px;
  border: 0; background: #fff;
  font-size: 17px; cursor: pointer;
  color: #222;
}
.tiq-cod-cant button:hover { background: #f4f4f4; }
.tiq-cod-cant span { min-width: 30px; text-align: center; font-size: 14px; font-weight: 600; }

/* ofertas de cantidad: tarjetas con precio, ahorro y cinta "más popular" */
.tiq-cod-ofertas { display: flex; flex-direction: column; gap: 10px; }
.tiq-cod-oferta {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 1.5px solid #e2e2e2;
  border-radius: 11px;
  padding: 13px 14px;
  cursor: pointer;
  font-size: 14px;
  background: #fff;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.tiq-cod-oferta:hover { border-color: #b9b9b9; }
.tiq-cod-oferta input { accent-color: #111; flex: 0 0 auto; }
.tiq-cod-oferta--activa { border-color: #111; box-shadow: 0 0 0 1px #111; }
.tiq-cod-oferta--popular { margin-top: 8px; }
.tiq-cod-oferta__cinta {
  position: absolute;
  top: -9px; left: 12px;
  background: #111; color: #fff;
  font-size: 10.5px; font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  border-radius: 99px;
  padding: 3px 10px;
}
.tiq-cod-oferta__info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tiq-cod-oferta__nombre { font-weight: 700; display: flex; align-items: center; gap: 7px; }
.tiq-cod-oferta__detalle { font-size: 12.5px; color: #6b7280; }
.tiq-cod-oferta__chip {
  background: #ecfdf3; color: #157f3d;
  font-size: 11px; font-weight: 800;
  border-radius: 99px;
  padding: 2px 8px;
}
.tiq-cod-oferta__precios { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.tiq-cod-oferta__precio { font-size: 15px; font-weight: 800; }
.tiq-cod-oferta__tachado { font-size: 12px; color: #9ca3af; text-decoration: line-through; }

/* elementos agregados por el merchant */
.tiq-cod-el { display: flex; flex-direction: column; }
.tiq-cod-el--titulo h3 { margin: 6px 0 0; font-size: 17px; font-weight: 800; }
.tiq-cod-el--texto p { margin: 0; font-size: 14px; color: #444; line-height: 1.5; }
.tiq-cod-el--imagen img { width: 100%; border-radius: 10px; display: block; }
.tiq-cod-el__ph {
  border: 1.5px dashed #d5d5d5; border-radius: 10px;
  padding: 22px; text-align: center;
  color: #9ca3af; font-size: 13px;
}
.tiq-cod-el__wsp {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  background: #25d366; color: #fff;
  border-radius: 9px;
  padding: 13px 16px;
  font-size: 14.5px; font-weight: 700;
  text-decoration: none;
}
.tiq-cod-el__wsp:hover { background: #1fb958; }
.tiq-cod-el__wsp svg { width: 20px; height: 20px; }
.tiq-cod-el__enlace {
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid #111; color: #111;
  border-radius: 9px;
  padding: 12px 16px;
  font-size: 14.5px; font-weight: 700;
  text-decoration: none;
}
.tiq-cod-el__enlace:hover { background: #f4f4f4; }
.tiq-cod-el__pago {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  width: 100%;
  background: #111; color: #fff;
  border: 0; border-radius: 9px;
  padding: 13px 16px;
  font-size: 14.5px; font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}
.tiq-cod-el__pago:hover { opacity: .9; }
.tiq-cod-el__pago-sub { font-size: .8em; font-weight: 500; opacity: .8; }
.tiq-cod-el--timer {
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #fff7e6;
  border: 1.5px dashed #e8b93c;
  border-radius: 9px;
  padding: 11px 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: #7a5200;
}
.tiq-cod-el__timer-reloj {
  background: #111; color: #fff;
  border-radius: 6px;
  padding: 2px 8px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
}
.tiq-cod-radios { display: flex; flex-direction: column; gap: 8px; }
.tiq-cod-radio {
  display: flex; align-items: center; gap: 9px;
  font-size: 14px; cursor: pointer;
  border: 1.5px solid #e2e2e2;
  border-radius: 8px;
  padding: 10px 12px;
}
.tiq-cod-radio input { accent-color: #111; }
.tiq-cod-radio:has(input:checked) { border-color: #111; }
.tiq-cod-el--cantidad { align-items: flex-start; gap: 5px; }
.tiq-cod-el--cantidad label { font-size: 13px; font-weight: 600; }
.tiq-cod-cant--grande button { width: 38px; height: 38px; font-size: 19px; }
.tiq-cod-cant--grande span { min-width: 38px; font-size: 15px; }
.tiq-cod-campo input[type="date"] { padding-left: 36px; }

/* totales + envío */
.tiq-cod-caja-gris {
  background: #f2f3f5;
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.tiq-cod-linea { display: flex; justify-content: space-between; font-size: 14.5px; }
.tiq-cod-linea--total { font-size: 17px; font-weight: 800; border-top: 1px solid #dcdee2; padding-top: 10px; margin-top: 2px; }
.tiq-cod-envio { display: flex; flex-direction: column; gap: 7px; }
.tiq-cod-envio__opcion {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1.5px solid #e2e2e2;
  border-radius: 9px;
  background: #fff;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 14px;
}
.tiq-cod-envio__opcion input { accent-color: #111; }
.tiq-cod-envio__opcion--activa { border-color: #111; }
.tiq-cod-envio__nombre { flex: 1; font-weight: 600; }

/* CTA */
.tiq-cod-enviar {
  width: 100%;
  margin-top: 4px;
  padding: 16px;
  background: var(--tiq-fondo, #000);
  color: var(--tiq-texto, #fff);
  border: 0;
  border-radius: var(--tiq-radio, 8px);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .03em;
  cursor: pointer;
  font-family: inherit;
  text-transform: uppercase;
}
.tiq-cod-enviar:hover { opacity: .92; }
.tiq-cod-enviar[disabled] { opacity: .6; cursor: wait; }
.tiq-cod-error-envio {
  display: none;
  background: #fdeaea;
  color: #a11212;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13.5px;
}

/* pantalla de éxito */
.tiq-cod-exito { text-align: center; padding: 34px 10px 20px; }
.tiq-cod-exito__tilde {
  width: 62px; height: 62px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: #0c8a3e;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}
.tiq-cod-exito h3 { font-size: 21px; font-weight: 800; margin: 0 0 8px; }
.tiq-cod-exito p { font-size: 15px; color: #444; margin: 0 0 6px; }
.tiq-cod-exito__orden { font-weight: 700; color: #111; }
.tiq-cod-exito button {
  margin-top: 18px;
  padding: 12px 26px;
  background: #111; color: #fff;
  border: 0; border-radius: 8px;
  font-size: 14.5px; font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

/* honeypot: invisible para humanos, tentador para bots */
.tiq-cod-hp { position: absolute; left: -9999px; opacity: 0; height: 0; overflow: hidden; }

@media (max-width: 519px) {
  #tiq-cod-modal { padding: 0; align-items: stretch; }
  .tiq-cod-caja { border-radius: 0; min-height: 100%; padding: 18px 16px 26px; }
}
