/* Base común a todas las plantillas. Cada plantilla define sus variables y su estética. */
*, *::before, *::after { box-sizing: border-box; }
[data-modo="claro"] { color-scheme: light; }
[data-modo="oscuro"] { color-scheme: dark; }   /* controles nativos (listas, scroll, autocompletado) en oscuro */
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--f-texto, system-ui, sans-serif); background: var(--fondo); color: var(--texto); line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--f-titulos, inherit); margin: 0; line-height: 1.1; text-wrap: balance; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
.icono { width: 1.25em; height: 1.25em; flex: none; vertical-align: middle; }
.estrellas { display: inline-flex; gap: 2px; color: var(--estrella, #f5b301); }
.estrella { width: 1em; height: 1em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Formulario */
.form { display: grid; gap: 14px; }
.form-fila { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form label { display: grid; gap: 6px; }
.form label > span { font-size: .85rem; font-weight: 600; opacity: .85; }
.form input, .form select, .form textarea { width: 100%; padding: 12px 14px; border-radius: var(--radio-chico, 6px); border: 1px solid var(--borde); background: var(--fondo-campo, transparent); outline: none; transition: border-color .2s, box-shadow .2s; }
.form textarea { resize: vertical; min-height: 110px; }
/* La lista desplegable es nativa: toma los colores de la plantilla y el esquema claro/oscuro. */
.form select option { background-color: var(--fondo); color: var(--texto); }
.form select option:checked { background-color: var(--acento, #2451ff); color: #fff; }
.form input:focus, .form select:focus, .form textarea:focus { border-color: var(--acento); box-shadow: 0 0 0 3px color-mix(in srgb, var(--acento) 25%, transparent); }
.form-trampa { position: absolute; left: -9999px; }
.form-acciones { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.form-nota { font-size: .85rem; opacity: .7; flex: 1 1 200px; }
.form-estado { font-size: .95rem; min-height: 0; }
.form-estado:empty { display: none; }
.form-estado.ok { padding: 12px 14px; border-radius: var(--radio-chico, 6px); background: color-mix(in srgb, #16a34a 14%, transparent); }
.form-estado.error { padding: 12px 14px; border-radius: var(--radio-chico, 6px); background: color-mix(in srgb, #dc2626 14%, transparent); }
.form-estado a { font-weight: 700; }

/* Aparición al scrollear */
[data-aparecer] { opacity: 0; transform: translateY(24px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.2,1); }
[data-aparecer].visible { opacity: 1; transform: none; }
.sin-animacion [data-aparecer] { transition: none; }
[data-aparecer="2"] { transition-delay: .1s; } [data-aparecer="3"] { transition-delay: .2s; } [data-aparecer="4"] { transition-delay: .3s; }

/* WhatsApp flotante */
.wa-flotante { position: fixed; right: 18px; bottom: 18px; z-index: 900; width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: #25d366; color: #fff; box-shadow: 0 10px 30px rgba(37,211,102,.45); transition: transform .2s; }
.wa-flotante:hover { transform: scale(1.08); }
.wa-flotante .icono { width: 30px; height: 30px; }

/* Pie: logo y crédito del desarrollador */
.pie-logo { max-height: 48px; width: auto; }
.credito { margin: 18px 0 0; text-align: center; }
.credito-capsula { display: inline-flex; align-items: center; gap: 8px; padding: 7px 16px; border-radius: 999px; font: 500 .8rem/1.2 var(--f-texto, system-ui, sans-serif); letter-spacing: .01em; text-decoration: none; color: inherit; opacity: .75; border: 1px solid color-mix(in srgb, var(--acento, currentColor) 55%, transparent); background: color-mix(in srgb, currentColor 4%, transparent); transition: opacity .2s, border-color .2s, background .2s; }
.credito-capsula strong { font-weight: 600; }
.credito-capsula .icono { width: 15px; height: 15px; }
a.credito-capsula:hover { opacity: 1; border-color: var(--acento, currentColor); background: color-mix(in srgb, var(--acento, currentColor) 10%, transparent); }

/* Mapa */
.mapa { width: 100%; height: 100%; min-height: 320px; border: 0; display: block; }
.contacto-mapa, .mapa-caja, .mapa-marco { position: relative; }
.ubicacion-tarjeta .mapa-ruta { position: static; box-shadow: none; }
.mapa-ruta { position: absolute; left: 14px; bottom: 14px; z-index: 1; box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.mapa-ruta .icono { width: 18px; height: 18px; }

@media (max-width: 640px) { .form-fila { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
