/* Tarjetas compactas de productos en el chat de Wiwi (MWAI_Woo_Products::tarjeta_chat). */
.cgw-prod {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin: 0;
  padding: 12px 2px;
  border-top: 1px solid rgba(15, 23, 42, 0.09);
  font-size: 14px;
  line-height: 1.3;
  color: #0f172a;
  text-align: left;
}
.cgw-prod + br + .cgw-prod,
.cgw-prod + .cgw-prod { border-top-color: rgba(15, 23, 42, 0.09); }
.cgw-prod__img {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}
.cgw-prod__img img { width: 100%; height: 100%; object-fit: contain; margin: 0 !important; max-width: none !important; }
.cgw-prod__img--vacia { background: #f1f5f9; }
.cgw-prod__info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cgw-prod__etiqueta { color: #64748b; font-size: 12px; font-weight: 600; }
.cgw-prod__etiqueta:empty { display: none; }
.cgw-prod__nombre { color: #0f172a !important; font-weight: 700; font-size: 14.5px; text-decoration: none !important; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
a.cgw-prod__nombre:hover { text-decoration: underline !important; }
.cgw-prod__datos { color: #94a3b8; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cgw-prod__estado { color: #059669; font-size: 12px; font-weight: 600; }
.cgw-prod__estado.is-agotado { color: #dc2626; }
.cgw-prod__lado { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.cgw-prod__precio {
  font-family: var(--cg-font-display, "Barlow Condensed", "Arial Narrow", sans-serif);
  font-size: 18px;
  font-weight: 800;
  white-space: nowrap;
  color: #0f172a;
}
.cgw-prod__anadir {
  padding: 7px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--cg-primary, #FEE406);
  color: #111 !important;
  font: 700 13.5px/1 var(--cg-font-main, inherit);
  cursor: pointer;
  white-space: nowrap;
}
.cgw-prod__anadir:hover { background: var(--cg-primary-hover, #e5ce00); }
.cgw-prod__anadir:disabled { cursor: default; background: #e2e8f0; color: #475569 !important; }
@media (max-width: 380px) {
  .cgw-prod { grid-template-columns: 48px minmax(0, 1fr) auto; gap: 10px; }
  .cgw-prod__img { width: 48px; height: 48px; }
  .cgw-prod__precio { font-size: 16px; }
}

/* El chat (AI Engine y chatbot-enhancements) estiliza todos los botones, enlaces y textos de las
   respuestas con !important: dentro de la tarjeta mandan estas reglas. */
.mwai-window .cgw-prod .cgw-prod__anadir,
.mwai-chatbot .cgw-prod .cgw-prod__anadir {
  background: var(--cg-primary, #FEE406) !important;
  color: #111 !important;
  border: 0 !important;
  border-radius: 999px !important;
  padding: 7px 16px !important;
  font-size: 13.5px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  width: auto !important;
  height: auto !important;
  min-height: 0 !important;
  box-shadow: none !important;
}
.mwai-window .cgw-prod .cgw-prod__anadir:hover,
.mwai-chatbot .cgw-prod .cgw-prod__anadir:hover { background: var(--cg-primary-hover, #e5ce00) !important; }
.mwai-window .cgw-prod .cgw-prod__anadir:disabled,
.mwai-chatbot .cgw-prod .cgw-prod__anadir:disabled { background: #e2e8f0 !important; color: #475569 !important; }
/* El rediseño subraya los enlaces de las respuestas (.mwai-chat .mwai-reply.mwai-ai a): el nombre no. */
.mwai-window .cgw-prod .cgw-prod__nombre,
.mwai-chatbot .cgw-prod .cgw-prod__nombre,
.mwai-chat .mwai-reply .cgw-prod a.cgw-prod__nombre { text-decoration: none !important; border: 0 !important; color: #0f172a !important; font-size: 14.5px !important; font-weight: 700 !important; }
.mwai-window .cgw-prod a.cgw-prod__nombre:hover,
.mwai-chat .mwai-reply .cgw-prod a.cgw-prod__nombre:hover { text-decoration: underline !important; }
.mwai-window .cgw-prod .cgw-prod__precio,
.mwai-chatbot .cgw-prod .cgw-prod__precio { font-size: 18px !important; font-weight: 800 !important; color: #0f172a !important; }
.mwai-window .cgw-prod .cgw-prod__etiqueta,
.mwai-chatbot .cgw-prod .cgw-prod__etiqueta { font-size: 12px !important; color: #64748b !important; font-weight: 600 !important; }
.mwai-window .cgw-prod .cgw-prod__datos,
.mwai-chatbot .cgw-prod .cgw-prod__datos { font-size: 12.5px !important; color: #94a3b8 !important; }
.mwai-window .cgw-prod .cgw-prod__estado,
.mwai-chatbot .cgw-prod .cgw-prod__estado { font-size: 12px !important; }

/* Tarjeta «Ir a pagar» del chat (MWAI_Woo_Orders::bloque_pago_html, placeholder [PAGO]). */
.cgw-pago {
  margin: 12px 0 4px;
  padding: 14px 16px 12px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 14px;
  background: #fff;
  color: #0f172a;
  text-align: left;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
}
.cgw-pago__cabecera { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.cgw-pago__etiqueta { color: #059669; font-size: 12.5px; font-weight: 700; }
.cgw-pago__orden { color: #64748b; font-size: 12.5px; font-weight: 600; }
.cgw-pago__total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 10px 0 12px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}
.cgw-pago__total span { color: #475569; font-size: 14px; }
.cgw-pago__total strong {
  font-family: var(--cg-font-display, "Barlow Condensed", "Arial Narrow", sans-serif);
  font-size: 24px;
  font-weight: 800;
  white-space: nowrap;
}
.cgw-pago__btn {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 11px 16px;
  border-radius: 10px;
  background: var(--cg-primary, #FEE406);
  color: #111;
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
}
.cgw-pago__btn:hover { background: #E5CE00; }
.cgw-pago__nota { margin: 8px 0 0; color: #64748b; font-size: 12px; line-height: 1.4; text-align: center; }

/* El chat pinta enlaces y textos de las respuestas con !important: dentro de la tarjeta mandan estas. */
.mwai-window .cgw-pago,
.mwai-chatbot .cgw-pago { background: #fff !important; color: #0f172a !important; }
/* remodel.css subraya todo enlace de las respuestas (.mwai-chat .mwai-reply.mwai-ai a): hace falta más especificidad. */
.mwai-window .cgw-pago .cgw-pago__btn,
.mwai-chatbot .cgw-pago .cgw-pago__btn,
.mwai-chat .mwai-reply.mwai-ai .cgw-pago a.cgw-pago__btn {
  display: flex !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 11px 16px !important;
  border: 0 !important;
  border-radius: 10px !important;
  background: var(--cg-primary, #FEE406) !important;
  color: #111 !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  text-decoration: none !important;
  text-transform: none !important;
  box-shadow: none !important;
}
.mwai-window .cgw-pago .cgw-pago__btn:hover,
.mwai-chatbot .cgw-pago .cgw-pago__btn:hover,
.mwai-chat .mwai-reply.mwai-ai .cgw-pago a.cgw-pago__btn:hover { background: #E5CE00 !important; }
.mwai-window .cgw-pago .cgw-pago__total strong,
.mwai-chatbot .cgw-pago .cgw-pago__total strong { font-size: 24px !important; font-weight: 800 !important; color: #0f172a !important; }
.mwai-window .cgw-pago .cgw-pago__total span,
.mwai-chatbot .cgw-pago .cgw-pago__total span { font-size: 14px !important; color: #475569 !important; }
.mwai-window .cgw-pago .cgw-pago__etiqueta,
.mwai-chatbot .cgw-pago .cgw-pago__etiqueta { font-size: 12.5px !important; color: #059669 !important; }
.mwai-window .cgw-pago .cgw-pago__orden,
.mwai-chatbot .cgw-pago .cgw-pago__orden { font-size: 12.5px !important; color: #64748b !important; }
.mwai-window .cgw-pago .cgw-pago__nota,
.mwai-chatbot .cgw-pago .cgw-pago__nota { margin: 8px 0 0 !important; font-size: 12px !important; color: #64748b !important; }

/* Tarjeta «Ubicación de entrega confirmada» del chat (chatbot-enhancements.js, updateTriggerAsConfirmed). */
.cgw-ubic {
  margin: 12px 0 4px;
  padding: 14px 16px 12px;
  border: 1px solid rgba(5, 150, 105, 0.35);
  border-radius: 14px;
  background: #fff;
  color: #0f172a;
  text-align: left;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
}
.cgw-ubic__cabecera { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.cgw-ubic__check {
  display: grid;
  place-items: center;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #059669;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}
.cgw-ubic__cabecera strong { color: #047857; font-size: 14.5px; font-weight: 800; }
.cgw-ubic__dir { margin: 0 0 2px; color: #0f172a; font-size: 14px; font-weight: 600; line-height: 1.4; }
.cgw-ubic__ref { margin: 0; color: #475569; font-size: 13px; line-height: 1.4; }
.cgw-ubic__mapa {
  height: 150px;
  margin: 10px 0 8px;
  border-radius: 10px;
  overflow: hidden;
  background: #e2e8f0;
}
.cgw-ubic__pie { display: flex; flex-direction: column; gap: 4px; color: #64748b; font-size: 12px; line-height: 1.4; }
.cgw-ubic__pie a { align-self: flex-start; color: #0f172a; font-weight: 700; }

/* El chat y el tema pintan textos y enlaces de las respuestas con !important. */
.mwai-chat .mwai-reply.mwai-ai .cgw-ubic,
.mwai-window .cgw-ubic,
.mwai-chatbot .cgw-ubic { background: #fff !important; color: #0f172a !important; }
.mwai-chat .mwai-reply.mwai-ai .cgw-ubic .cgw-ubic__cabecera strong { color: #047857 !important; font-size: 14.5px !important; }
.mwai-chat .mwai-reply.mwai-ai .cgw-ubic .cgw-ubic__dir { color: #0f172a !important; font-size: 14px !important; margin: 0 0 2px !important; }
.mwai-chat .mwai-reply.mwai-ai .cgw-ubic .cgw-ubic__ref { color: #475569 !important; font-size: 13px !important; margin: 0 !important; }
.mwai-chat .mwai-reply.mwai-ai .cgw-ubic .cgw-ubic__pie span { color: #64748b !important; font-size: 12px !important; }
.mwai-chat .mwai-reply.mwai-ai .cgw-ubic .cgw-ubic__pie a { color: #0f172a !important; font-size: 12.5px !important; font-weight: 700 !important; }
.mwai-chat .mwai-reply.mwai-ai .cgw-ubic .cgw-ubic__mapa img { max-width: none !important; margin: 0 !important; }
.cgw-ubic__mapa img { max-width: none !important; }
