/* Lovendo · Encuesta (survey.js). Colores y tipografía del tema (var(--…)); nada nuevo.
   Capas: el acceso va en el flujo de la página, bajo la cabecera (no flota sobre nada); el diálogo usa 720 (sobre fichas 500, ofertas 600,
   panel de mensajes 610 y consulta de compra 700; debajo de la valoración 820 y de los avisos 900). */

/* ── acceso bajo la cabecera, alineado a la derecha como el área de cuenta ── */
.lvsv-row { display: flex; justify-content: flex-end; padding: 10px 24px 0; }
.lvsv-row[hidden], .lvsv-card[hidden] { display: none; }
.lvsv-card { display: inline-flex; align-items: center; gap: 10px; padding: 6px 6px 6px 14px; background: var(--white); border: 1px solid var(--border);
  border-radius: 999px; box-shadow: 0 2px 10px rgba(23,41,59,.06); font-size: 13.5px; color: var(--ink); max-width: 100%; }
.lvsv-t { font-weight: 600; white-space: nowrap; }
.lvsv-btn { display: inline-flex; align-items: center; gap: 6px; border: none; border-radius: 999px; background: var(--coral); color: #fff; font-family: inherit;
  font-size: 13px; font-weight: 700; padding: 7px 14px; cursor: pointer; white-space: nowrap; }
.lvsv-btn:hover { background: var(--coral-dark); }
.lvsv-star-ic { display: none; }
.lvsv-done { padding: 6px 14px; }
.lvsv-t-done { font-weight: 700; }
.lvsv-link { background: none; border: none; padding: 4px 2px; font-family: inherit; font-size: inherit; font-weight: 700; color: var(--coral-dark); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }

/* pantallas estrechas: un acceso compacto (solo el botón con la estrella) */
@media (max-width: 639px) {
  .lvsv-row { padding: 8px 16px 0; }
  #lvsv-ask { padding: 0; border: none; box-shadow: none; background: none; }
  #lvsv-ask .lvsv-t { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
  .lvsv-btn { padding: 6px 12px; font-size: 12.5px; background: var(--white); color: var(--coral-dark); border: 1px solid var(--border); }
  .lvsv-btn:hover { background: var(--coral-light); }
  .lvsv-star-ic { display: inline; }
  .lvsv-done { font-size: 12.5px; padding: 5px 12px; }
  html.lvmw-open .lvsv-row { visibility: hidden; }   /* con los mensajes abiertos (pantalla completa) el acceso a la encuesta se oculta */
}

/* ── diálogo ── */
.lvsv-overlay { position: fixed; inset: 0; z-index: 720; background: rgba(23,41,59,.45); align-items: center; justify-content: center; padding: 16px; }
.lvsv-box { background: var(--white); color: var(--ink); width: 100%; max-width: 520px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto;
  border-radius: var(--r-xl, 28px); box-shadow: 0 24px 64px rgba(23,41,59,.28); font-family: inherit; }
.lvsv-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 12px; padding: 18px 20px 12px; background: var(--white); border-bottom: 1px solid var(--border); }
.lvsv-h { margin: 0; font-size: 18px; font-weight: 800; line-height: 1.3; flex: 1; }
.lvsv-x { width: 36px; height: 36px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border); cursor: pointer; font-size: 14px; flex-shrink: 0; color: var(--ink); }
.lvsv-form, .lvsv-thanks { padding: 14px 20px 20px; }
.lvsv-form[hidden], .lvsv-thanks[hidden] { display: none; }
.lvsv-intro { margin: 0 0 6px; font-size: 13.5px; color: var(--ink-soft); line-height: 1.5; }
.lvsv-q { border: none; margin: 0; padding: 14px 0 6px; min-width: 0; }
.lvsv-q legend, .lvsv-label { display: block; padding: 0; margin-bottom: 10px; font-size: 14.5px; font-weight: 700; color: var(--ink); }
.lvsv-opt-t { font-weight: 500; color: var(--ink-soft); font-size: 13px; }
.lvsv-q.invalid legend { color: var(--coral-dark); }
.lvsv-err { margin: 8px 0 0; font-size: 13px; font-weight: 600; color: var(--coral-dark); }
.lvsv-err[hidden] { display: none; }

/* estrellas: radios nativos (flechas del teclado y lector de pantalla), dibujados como estrellas */
.lvsv-stars { display: flex; gap: 6px; }
.lvsv-star { position: relative; display: inline-flex; width: 44px; height: 44px; align-items: center; justify-content: center; cursor: pointer; border-radius: 12px; }
.lvsv-star input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.lvsv-star span { font-size: 32px; line-height: 1; color: var(--border); transition: color .12s, transform .12s; }
.lvsv-star.on span { color: var(--amber); }
.lvsv-star:hover span { transform: scale(1.08); }
.lvsv-star:has(input:focus-visible) { outline: 3px solid var(--coral); outline-offset: 1px; }
.lvsv-rate { display: inline-block; }   /* las etiquetas quedan bajo la primera y la última estrella */
.lvsv-scale { display: flex; justify-content: space-between; margin-top: 4px; font-size: 12.5px; color: var(--ink-soft); }

.lvsv-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.lvsv-opt { position: relative; display: inline-flex; }
.lvsv-opt input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.lvsv-opt span { display: inline-block; padding: 9px 14px; min-height: 40px; box-sizing: border-box; border: 1.5px solid var(--border); border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--ink-mid); background: var(--white); }
.lvsv-opt input:checked + span { border-color: var(--coral); background: var(--coral-light); color: var(--coral-dark); }
.lvsv-opt input:focus-visible + span { outline: 3px solid var(--coral); outline-offset: 2px; }
.lvsv-clear { margin-top: 8px; font-size: 13px; }
.lvsv-clear[hidden] { display: none; }

.lvsv-text { width: 100%; box-sizing: border-box; padding: 10px 14px; border: 1.5px solid var(--border); border-radius: var(--r-md, 14px); font-family: inherit; font-size: 16px; color: var(--ink); resize: vertical; min-height: 84px; background: var(--white); }
.lvsv-text:focus { border-color: var(--coral); outline: none; }
.lvsv-meta { display: flex; justify-content: space-between; gap: 12px; margin-top: 6px; font-size: 12.5px; color: var(--ink-soft); }
.lvsv-privacy { font-weight: 600; color: var(--ink-mid); }
.lvsv-count { flex-shrink: 0; }

.lvsv-status { margin: 12px 0 0; padding: 10px 14px; border-radius: var(--r-md, 14px); background: var(--amber-light); border: 1px solid var(--amber); font-size: 13.5px; font-weight: 600; color: var(--ink); line-height: 1.5; }
.lvsv-status[hidden] { display: none; }
.lvsv-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.lvsv-cancel, .lvsv-submit { font-family: inherit; font-size: 14px; font-weight: 700; border-radius: 999px; padding: 11px 20px; cursor: pointer; min-height: 44px; }
.lvsv-cancel { background: var(--white); color: var(--ink); border: 1.5px solid var(--border); }
.lvsv-submit { background: var(--coral); color: #fff; border: none; }
.lvsv-submit:hover { background: var(--coral-dark); }
.lvsv-submit:disabled { opacity: .6; cursor: default; }
.lvsv-thanks:focus { outline: none; }
.lvsv-thanks-t { margin: 8px 0 0; font-size: 16px; font-weight: 700; }

@media (max-width: 639px) {
  .lvsv-overlay { padding: 0; align-items: stretch; }
  .lvsv-box { max-width: none; max-height: none; height: 100%; border-radius: 0; }
  .lvsv-star { width: 48px; height: 48px; }
  .lvsv-actions { position: sticky; bottom: 0; background: var(--white); padding: 10px 0 calc(4px + env(safe-area-inset-bottom, 0px)); margin-top: 8px; }
}
html.lvsv-open body { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .lvsv-star span { transition: none; } }
