/* =====================================================================================================================
   Aportes de los visitantes: hoja de opinión y correcciones, y opiniones publicadas. Igual en todos los países.
   Sin JavaScript: un bloque del panel. Con JavaScript (.ap-js): en escritorio flota abajo del mapa (.ap-flotante) y asoma
   como una franja; en el celular queda en el panel. Colores: los del sitio (site.css); estrellas en ámbar, éxito en azul,
   error en rojo, siempre con texto o ícono.
   ===================================================================================================================== */
.ap, .ap-res, .ap-resumen, .ap-visor { --ap-estrella: #c98a00; --ap-sombra: 0 -1px 3px rgba(10,10,10,.05), 0 12px 32px rgba(10,10,10,.18); }

.ap [hidden], .ap-mover [hidden], .ap-pestana[hidden], .ap-mover[hidden] { display: none !important; }

/* ---------- Bloque base (sin JavaScript o en el panel del celular) ---------- */
.ap { position: relative; margin: 6px 0 10px; background: #fff; border-radius: 22px; }
.ap-cuerpo { display: grid; gap: 18px; padding: 20px; }
.ap-form { display: contents; }
.ap-col { display: grid; gap: 10px; min-width: 0; align-content: start; }
.ap-col h2 { margin: 0; font-size: 1.25rem; letter-spacing: -0.02em; line-height: 1.2; text-wrap: balance; }
.ap-sub { margin: -4px 0 0; font-size: 15px; line-height: 1.4; }
.ap-etq { margin: 0; padding: 0; display: flex; align-items: center; gap: 6px; font-size: var(--step-small, 14px); color: var(--muted); }
.ap-alerta { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--pendiente); stroke-width: 2; stroke-linecap: round; }
.ap fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.ap-nota { margin: 0; min-height: 1.4em; font-size: var(--step-small, 14px); font-variant-numeric: tabular-nums; }
.ap-nota strong { font-weight: 600; }

/* Estrellas: radios de verdad, de 5 a 1 en el HTML para pintar las de la izquierda con ~ */
.ap-estrellas { flex: none; }
.ap-fila { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 2px; margin-left: -4px; }
.ap-fila label { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 999px; cursor: pointer; color: var(--muted); }
.ap-fila svg { width: 38px; height: 38px; fill: transparent; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; transition: fill 120ms ease, transform 180ms var(--ease-out); }
.ap-fila input:checked ~ label, .ap-fila input:checked + label { color: var(--ap-estrella); }
.ap-fila input:checked ~ label svg, .ap-fila input:checked + label svg { fill: var(--ap-estrella); }
.ap-fila input:focus-visible + label { outline: 3px solid var(--ink); outline-offset: -3px; }
@media (hover: hover) and (pointer: fine) {
  .ap-fila:hover label { color: var(--muted); }
  .ap-fila:hover label svg { fill: transparent; }
  .ap-fila label:hover, .ap-fila label:hover ~ label { color: var(--ap-estrella); }
  .ap-fila label:hover svg, .ap-fila label:hover ~ label svg { fill: var(--ap-estrella); transform: scale(1.08); }
}
.ap-fila label:active svg { transform: scale(0.88); }
.ap-fila.ap-pop input:checked + label svg { animation: ap-pop 380ms var(--ease-out); }
@keyframes ap-pop { 0% { transform: scale(0.7); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }

/* Campos */
.ap-texto, .ap-datos input { width: 100%; min-width: 0; font: inherit; font-size: 16px; color: var(--ink); background: var(--papel); border: 0; }
.ap-texto { line-height: 1.45; padding: 12px 16px; border-radius: 18px; resize: vertical; min-height: 96px; max-height: 260px; }
.ap-datos { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.ap-datos input { min-height: 48px; padding: 0 16px; border-radius: 999px; }
.ap-texto::placeholder, .ap-datos input::placeholder { color: var(--muted); opacity: 1; }
.ap-texto:focus-visible, .ap-datos input:focus-visible { outline: 2px solid var(--ink); outline-offset: 0; }
.ap-datos input[aria-invalid="true"] { outline: 2px solid var(--error); outline-offset: 0; }
.ap-envio { display: flex; gap: 14px; align-items: center; }
.ap-envio .boton { flex: none; padding-left: 30px; padding-right: 30px; }
.ap-legal { flex: 1; margin: 0; font-size: 13px; line-height: 1.4; color: var(--muted); }
.ap-legal a { color: var(--ink); }
.ap-error { margin: 0; display: flex; align-items: center; gap: 6px; font-size: var(--step-small, 14px); font-weight: 500; color: var(--error); }
.ap-error[hidden] { display: none; }
.ap-error svg, .ap-ok svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ap-ok { margin: 0; display: flex; gap: 8px; align-items: flex-start; color: var(--ok); font-weight: 500; font-size: 15px; line-height: 1.4; }
.ap-ok[hidden] { display: none; }
.ap-ok strong { font-weight: 600; }
.ap-ok-servidor { padding: 12px 14px; border-radius: 16px; background: #e4edfc; }

/* Fotos del visitante */
.ap-fotos { display: grid; gap: 10px; margin-top: 4px; }
.ap-fotos-boton { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; background: var(--papel); cursor: pointer; transition: background-color 120ms ease, transform 140ms var(--ease-out); }
.ap-fotos-boton:active { transform: scale(0.99); }
.ap-fotos-boton svg { width: 28px; height: 28px; flex: none; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linejoin: round; }
.ap-fotos-boton span { display: grid; gap: 2px; }
.ap-fotos-boton strong { font-weight: 600; font-size: 15px; }
.ap-fotos-boton small { font-size: 13px; line-height: 1.35; color: var(--muted); }
.ap-fotos input:focus-visible + .ap-fotos-boton { outline: 2px solid var(--ink); outline-offset: 0; }
.ap-fotos.ap-arrastrando .ap-fotos-boton { background: var(--surface); }
.ap-fotos.ap-lleno .ap-fotos-boton { display: none; }
@media (hover: hover) and (pointer: fine) { .ap-fotos-boton:hover { background: var(--surface); } }
.ap-fotos-lista { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.ap-fotos-lista:empty { display: none; }
.ap-fotos-lista li { position: relative; width: 64px; height: 64px; border-radius: 14px; overflow: hidden; background: var(--papel); animation: ap-foto-entra 220ms var(--ease-out) both; }
@keyframes ap-foto-entra { from { opacity: 0; transform: scale(0.85); } }
.ap-fotos-lista img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ap-fotos-lista button { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border: 0; border-radius: 999px; background: rgba(10,10,10,.72); color: #fff; display: grid; place-items: center; cursor: pointer; }
.ap-fotos-lista button svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; }

/* Píldoras y botones redondos */
.ap-pildora { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--bg); color: var(--ink); font: inherit; font-size: 15px; line-height: 1.2; cursor: pointer; transition: background-color 120ms ease, transform 140ms var(--ease-out); }
.ap-pildora:active { transform: scale(0.97); }
.ap-pildora:focus-visible, .ap-opcion:has(input:focus-visible) { outline: 3px solid var(--ink); outline-offset: 2px; }
.ap-pildora svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ap-pildora .ap-alerta { width: 18px; height: 18px; }
.ap-pildora-papel { background: var(--papel); }
.ap-pildora-arena { background: var(--sand); }
@media (hover: hover) and (pointer: fine) { .ap-pildora:hover { background: var(--surface); } .ap-pildora-arena:hover { background: #e9d69a; } }
.ap-opcion:has(input:checked) { background: var(--ink); color: var(--negro-ink); }
.ap-redondo { flex: none; width: 44px; height: 44px; border: 0; border-radius: 999px; background: var(--bg); color: var(--ink); display: grid; place-items: center; cursor: pointer; transition: background-color 120ms ease, transform 140ms var(--ease-out); }
.ap-redondo:active { transform: scale(0.94); }
.ap-redondo svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ap-redondo-suave { width: 40px; height: 40px; background: transparent; color: var(--muted); }
@media (hover: hover) and (pointer: fine) { .ap-redondo:hover { background: var(--surface); } }

/* Correcciones: el detalle aparece al elegir una opción (también sin JavaScript) */
.ap-corregir { display: grid; gap: 10px; }
.ap-corregir fieldset { display: grid; gap: 8px; }
.ap-opciones { display: flex; flex-wrap: wrap; gap: 8px; }
.ap-opcion { font-size: 14px; min-height: 38px; }
.ap-detalle { display: none; gap: 10px; }
.ap-corregir:has(input[name="tipo"]:checked) .ap-detalle { display: grid; }
.ap-detalle .ap-texto { min-height: 72px; }
.ap-detalle-botones { display: flex; gap: 8px; flex-wrap: wrap; }
.ap-col-3.ap-resaltar { animation: ap-resaltar 900ms var(--ease-out); border-radius: 16px; }
@keyframes ap-resaltar { 30% { box-shadow: 0 0 0 10px #f6edcc; background: #f6edcc; } }

/* Gracias */
.ap-gracias { display: flex; align-items: center; gap: 18px; padding: 24px 24px 20px; animation: ap-abre 260ms var(--ease-out) both; }
.ap-gracias[hidden] { display: none; }
.ap-gracias-ico { flex: none; width: 52px; height: 52px; border-radius: 999px; background: #dbe7fb; color: var(--ok); display: grid; place-items: center; }
.ap-gracias-ico svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 30; stroke-dashoffset: 30; animation: ap-trazo 420ms 120ms var(--ease-out) forwards; }
@keyframes ap-trazo { to { stroke-dashoffset: 0; } }
.ap-gracias > div { flex: 1; min-width: 0; }
.ap-gracias h2 { margin: 0; font-size: 1.25rem; letter-spacing: -0.02em; outline: none; }
.ap-gracias p { margin: 4px 0 0; font-size: 15px; }
.ap-gracias-botones { display: flex; gap: 8px; flex-wrap: wrap; }
@keyframes ap-abre { from { opacity: 0; transform: translateY(14px); } }

/* ---------- Con JavaScript: franja que asoma y estados ---------- */
.ap-asa { position: absolute; top: 0; left: 50%; transform: translateX(-50%); z-index: 2; width: 88px; height: 22px; border: 0; background: none; cursor: pointer; display: grid; place-items: center; border-radius: 999px; }
.ap-asa span { width: 40px; height: 4px; border-radius: 999px; background: var(--surface); transition: background-color 120ms ease, width 160ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .ap-asa:hover span { background: var(--muted); width: 48px; } }
.ap-asa:focus-visible { outline: 3px solid var(--ink); outline-offset: -3px; }
.ap-franja { display: flex; align-items: center; gap: 16px; padding: 18px 14px 14px 22px; }
.ap-franja[hidden], .ap-cuerpo[hidden] { display: none; }
.ap-franja-txt { min-width: 0; flex: 1 1 auto; }
.ap-franja-titulo { margin: 0; font-size: 1.125rem; font-weight: 500; letter-spacing: -0.01em; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-franja-sub { margin: 2px 0 0; font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-franja-sub a { color: var(--ink); }
.ap-franja-sub.ap-azul { color: var(--ok); }
.ap-franja .ap-pildora { flex: none; }
.ap-franja .ap-fila label { width: 46px; height: 46px; }
.ap-franja .ap-fila svg { width: 36px; height: 36px; }
.ap-corto { display: none; }
.ap-js[data-estado="abierta"] .ap-cuerpo { animation: ap-abre 260ms var(--ease-out) both; }

/* Celular (y escritorio angosto sin mapa): todo dentro del panel */
.ap-js:not(.ap-flotante) .ap-franja { flex-wrap: wrap; gap: 8px 10px; padding: 16px; }
.ap-js:not(.ap-flotante) .ap-franja-txt { flex-basis: 100%; }
.ap-js:not(.ap-flotante) .ap-franja-titulo, .ap-js:not(.ap-flotante) .ap-franja-sub { white-space: normal; }
.ap-js:not(.ap-flotante) [data-ap-esconder], .ap-js:not(.ap-flotante) .ap-asa, .ap-js:not(.ap-flotante) .ap-redondo { display: none; }
.ap-js:not(.ap-flotante) .ap-estrellas { flex-basis: 100%; }
.ap-js:not(.ap-flotante) .ap-cuerpo { padding-top: 18px; }

/* ---------- Escritorio: la hoja flota abajo del mapa ---------- */
.exp-mapa:has(> .ap-flotante) { container: apmapa / inline-size; }
.exp-mapa .leaflet-bottom.leaflet-right { bottom: var(--ap-alto, 0px); transition: bottom 300ms var(--ease-drawer); }
.ap.ap-flotante { position: absolute; z-index: 700; left: 14px; right: 14px; bottom: 14px; margin: 0; box-shadow: var(--ap-sombra); transition: transform 380ms var(--ease-drawer); }
.ap-flotante[data-estado="oculta"], .ap-flotante[data-estado="mover"], .ap-flotante.ap-entrando { transform: translateY(calc(100% + 24px)); }
.ap-flotante.ap-entrando { transition: none; }
.ap-flotante .ap-cuerpo { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.2fr) minmax(0, 0.85fr); gap: 0 28px; padding: 24px 24px 20px; max-height: calc(100vh - 210px); overflow-y: auto; overscroll-behavior: contain; }
.ap-flotante .ap-col-3 { padding-top: 2px; }
.ap-pestana { position: absolute; z-index: 690; left: 50%; bottom: 0; transform: translate(-50%, 0); display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 22px 4px; border: 0; border-radius: 22px 22px 0 0; background: #fff; color: var(--ink); font: inherit; font-size: 15px; font-weight: 500; cursor: pointer; box-shadow: 0 -4px 16px rgba(10,10,10,.14); animation: ap-pestana 300ms var(--ease-drawer) both; }
.ap-pestana[hidden] { display: none; }
.ap-pestana svg { width: 18px; height: 18px; fill: #c98a00; }
.ap-pestana:focus-visible { outline: 3px solid var(--ink); outline-offset: -3px; }
@keyframes ap-pestana { from { transform: translate(-50%, 100%); } }
@container apmapa (max-width: 1040px) { .ap-franja-sub { display: none; } .ap-btn-comentar { display: none; } }
@container apmapa (max-width: 1000px) {
  .ap-largo { display: none; } .ap-corto { display: inline; }
  .ap-flotante .ap-cuerpo { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); row-gap: 16px; }
  .ap-flotante .ap-col-3 { grid-column: 1 / -1; }
}
@container apmapa (max-width: 720px) { .ap-flotante .ap-franja { flex-wrap: wrap; row-gap: 4px; } .ap-flotante .ap-franja-txt { flex-basis: calc(100% - 60px); } }

/* Mover el alfiler en el mapa */
.ap-mover { position: absolute; z-index: 720; left: 50%; bottom: 18px; transform: translate(-50%, 0); width: min(640px, calc(100% - 40px)); display: flex; align-items: center; gap: 16px; padding: 14px 14px 14px 20px; background: #fff; border-radius: 22px; box-shadow: var(--ap-sombra); animation: ap-sube 380ms var(--ease-drawer) both; }
.ap-mover[hidden] { display: none; }
@keyframes ap-sube { from { transform: translate(-50%, calc(100% + 30px)); } }
.ap-mover p { margin: 0; flex: 1; font-size: 15px; line-height: 1.4; }
.ap-mover p strong { display: block; font-weight: 600; }
.ap-mover-botones { display: flex; gap: 8px; flex: none; }
.ap-mover-botones[hidden] { display: none; }
.ap-moviendo .pin-foco-nombre { opacity: 0; }
.ap-pin-mover { cursor: grab; }
.ap-pin-mover:active { cursor: grabbing; }
.ap-pin-mover svg { transform: scale(1.15) translateY(-8px); transform-origin: 50% 100%; filter: drop-shadow(0 12px 9px rgba(10,10,10,.32)); transition: transform 200ms var(--ease-out); }
.ap-pin-mover:focus-visible { outline: none; }
.ap-pin-mover:focus-visible svg { outline: 3px solid var(--ink); outline-offset: 4px; border-radius: 8px; }
.ap-pin-fantasma svg { color: transparent; }
.ap-pin-fantasma svg path:first-child { fill: rgba(255,255,255,.6); stroke: var(--accent); stroke-width: 1.4; stroke-dasharray: 3 2; }

/* ---------- Línea bajo la dirección ---------- */
.ap-resumen { margin: -4px 0 6px; font-size: 15px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.ap-resumen a { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); }
.ap-resumen strong { font-weight: 600; }
.ap-est { display: inline-flex; gap: 1px; vertical-align: -2px; }
.ap-est i { display: inline-grid; }
.ap-est svg { width: 16px; height: 16px; fill: transparent; stroke: var(--ap-estrella, #c98a00); stroke-width: 1.8; stroke-linejoin: round; }
.ap-est .llena svg { fill: var(--ap-estrella, #c98a00); }

/* ---------- Opiniones publicadas ---------- */
.ap-res { display: grid; gap: 14px; }
.ap-res h2 { margin-bottom: 0; }
.ap-res-vacio { display: grid; gap: 12px; justify-items: start; padding: 16px 18px; background: var(--papel); border-radius: 18px; }
.ap-res-vacio p { margin: 0; }
.ap-res-cabeza { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; padding: 16px 18px; background: var(--papel); border-radius: 18px; }
.ap-res-total { margin: 0; display: grid; justify-items: center; gap: 4px; }
.ap-res-total strong { font-size: 2.5rem; font-weight: 500; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.ap-res-total > span:last-child { font-size: 13px; color: var(--muted); text-align: center; }
.ap-res-reparto { display: grid; gap: 4px; }
.ap-barra { display: grid; grid-template-columns: 12px 1fr 22px; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ap-barra i { position: relative; height: 6px; overflow: hidden; border-radius: 999px; background: var(--bg); }
.ap-barra i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--p); background: var(--ap-estrella); border-radius: 999px; }
.ap-galeria { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ap-foto { display: block; aspect-ratio: 1; overflow: hidden; border-radius: 14px; background: var(--surface); }
.ap-foto img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 300ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .ap-foto:hover img { transform: scale(1.04); } }
.ap-foto:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.ap-res-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ap-item { display: grid; gap: 8px; padding: 14px 16px; background: var(--papel); border-radius: 18px; }
.ap-linea { margin: 0; display: flex; align-items: center; gap: 8px; }
.ap-n { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ap-texto-pub { margin: 0; font-size: 16px; line-height: 1.5; overflow-wrap: anywhere; }
.ap-item-fotos { display: flex; gap: 6px; flex-wrap: wrap; }
.ap-item-fotos .ap-foto { width: 72px; height: 72px; border-radius: 12px; }
.ap-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 13px; color: var(--muted); }
.ap-meta strong { color: var(--ink); font-weight: 600; }
.ap-confirmado { display: inline-flex; align-items: center; gap: 4px; color: var(--ok); }
.ap-confirmado svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.ap-denunciar { margin: 0 0 0 auto; }
.ap-denunciar button { border: 0; background: none; padding: 6px 2px; font: inherit; font-size: 13px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.ap-denunciar button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }
.ap-denunciado { margin-left: auto; font-size: 13px; color: var(--ok); }
.ap-mas summary { cursor: pointer; padding: 6px 0; font-weight: 500; }
.ap-mas[open] summary { margin-bottom: 10px; }
.ap-politica { margin: 0; font-size: 13px; color: var(--muted); }
.ap-politica a { color: var(--ink); }
.ap-res.ap-resaltar { animation: ap-resaltar 1100ms var(--ease-out); border-radius: 18px; }

/* Visor de fotos */
.ap-visor { padding: 0; border: 0; background: transparent; max-width: min(92vw, 1280px); max-height: 92vh; overflow: visible; }
.ap-visor::backdrop { background: rgba(10,10,10,.82); }
.ap-visor img { display: block; max-width: min(92vw, 1280px); max-height: 86vh; width: auto; height: auto; border-radius: 16px; }
.ap-visor button { position: absolute; top: -14px; right: -14px; width: 44px; height: 44px; border: 0; border-radius: 999px; background: #fff; color: var(--ink); display: grid; place-items: center; cursor: pointer; box-shadow: var(--ap-sombra); }
.ap-visor button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }

/* Página del enlace del correo */
.ap-pagina form { margin: 18px 0; }

@media (max-width: 899.98px) {
  .ap-datos { grid-template-columns: minmax(0, 1fr); }
  .ap-envio { flex-direction: column; align-items: stretch; }
  .ap-envio .boton { width: 100%; }
  .ap-gracias { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  .ap-flotante, .exp-mapa .leaflet-bottom.leaflet-right { transition: none; }
  .ap-js[data-estado="abierta"] .ap-cuerpo, .ap-gracias, .ap-fila.ap-pop input:checked + label svg, .ap-col-3.ap-resaltar, .ap-res.ap-resaltar,
  .ap-pestana, .ap-mover, .ap-fotos-lista li { animation: none; }
  .ap-gracias-ico svg { animation: none; stroke-dashoffset: 0; }
  .ap-fila svg, .ap-foto img, .ap-pin-mover svg { transition: none; }
}
