/* Estilos del sitio (inicio, formulario, después del pago, borrar y páginas legales).
   Las plantillas de regalo traen sus propios estilos. Pensado para celular primero. */

:root {
  --fondo: #fff8f1;
  --superficie: #ffffff;
  --texto: #3b2430;
  --suave: #7a5a68;
  --borde: #eadbe0;
  --marca: #b8325f;
  --marca-fuerte: #962449;
  --acento: #ff6f91;
  --acento-suave: #ffe4ea;
  --oscuro: #2a0f2e;
  --ok: #1f7a4d;
  --ok-suave: #e5f5ec;
  --error: #b42318;
  --error-suave: #fdecea;
  --aviso: #8a5a00;
  --aviso-suave: #fff3d6;
  --radio: 14px;
  --sombra: 0 6px 24px rgba(59, 36, 48, .08);
  --serif: Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  color: var(--texto);
  background: var(--fondo);
}
a { color: var(--marca); }
a:hover { color: var(--marca-fuerte); }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--serif); font-weight: normal; line-height: 1.15; margin: 0; }
p { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--acento); outline-offset: 2px; }
[hidden] { display: none !important; }

/* Cabecera y pie */
.cabecera {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; background: var(--fondo); border-bottom: 1px solid var(--borde);
  position: sticky; top: 0; z-index: 20;
}
.marca { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--texto);
  font-family: var(--serif); font-size: 19px; }
.marca .corazon { color: var(--acento); }
.idiomas { display: inline-flex; border: 1px solid var(--borde); border-radius: 999px; overflow: hidden; background: var(--superficie); }
.idiomas button { border: 0; background: none; padding: 6px 12px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--suave); }
.idiomas button[aria-pressed="true"] { background: var(--texto); color: var(--fondo); }

.pie-sitio { padding: 32px 16px 40px; text-align: center; font-size: 14px; color: var(--suave); border-top: 1px solid var(--borde); margin-top: 48px; }
.pie-sitio nav { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin-bottom: 8px; }

/* Botones */
.boton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 22px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--marca); color: #fff; font-weight: 700; font-size: 16px; text-decoration: none;
  box-shadow: 0 6px 18px rgba(184, 50, 95, .25); transition: background .2s, transform .1s;
}
.boton:hover { background: var(--marca-fuerte); color: #fff; }
.boton:active { transform: translateY(1px); }
.boton:disabled { opacity: .6; cursor: progress; }
.boton.secundario { background: var(--superficie); color: var(--texto); border: 1px solid var(--borde); box-shadow: none; }
.boton.secundario:hover { background: var(--acento-suave); color: var(--texto); }
.boton.peligro { background: var(--error); box-shadow: none; }
.boton.peligro:hover { background: #8f1c13; }
.boton.chico { min-height: 38px; padding: 8px 14px; font-size: 14px; }
.boton.ancho { width: 100%; }

.contenido { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.estrecho { max-width: 640px; margin: 0 auto; padding: 0 16px; }

/* Avisos */
.aviso { border-radius: var(--radio); padding: 12px 14px; font-size: 15px; }
.aviso.error { background: var(--error-suave); color: var(--error); }
.aviso.ok { background: var(--ok-suave); color: var(--ok); }
.aviso.prueba { background: var(--aviso-suave); color: var(--aviso); font-weight: 700; letter-spacing: .02em; }
.aviso ul { margin: 6px 0 0; padding-left: 20px; }

/* ---------- Inicio ---------- */
.portada { text-align: center; padding: 44px 0 20px; }
.portada h1 { font-size: clamp(34px, 8vw, 56px); max-width: 15em; margin: 0 auto; }
.portada .sub { max-width: 36em; margin: 16px auto 0; color: var(--suave); font-size: 17px; }
.portada .precio { margin-top: 22px; font-size: 15px; color: var(--suave); }
.portada .precio b { display: block; font-size: 28px; color: var(--texto); font-family: var(--serif); font-weight: normal; }
.portada .boton { margin-top: 18px; }

.seccion { padding: 40px 0 8px; }
.seccion > h2 { font-size: clamp(26px, 6vw, 34px); text-align: center; margin-bottom: 22px; }

.plantillas { display: grid; gap: 28px; }
.plantilla-muestra { display: grid; gap: 14px; justify-items: center; text-align: center; }
.plantilla-muestra h3 { font-size: 24px; }
.plantilla-muestra p { color: var(--suave); max-width: 26em; }
.nota-ejemplo { font-size: 13px; color: var(--suave); text-align: center; margin-top: 14px; }

.telefono {
  width: min(100%, 340px); aspect-ratio: 9 / 18.5; border-radius: 34px; padding: 10px;
  background: #1c1418; box-shadow: 0 18px 50px rgba(42, 15, 46, .25);
}
.telefono iframe { width: 100%; height: 100%; border: 0; border-radius: 26px; background: #000; display: block; }

.pasos { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; counter-reset: paso; }
.pasos li { background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio); padding: 16px 16px 16px 60px;
  position: relative; counter-increment: paso; }
.pasos li::before { content: counter(paso); position: absolute; left: 16px; top: 14px; width: 30px; height: 30px; border-radius: 50%;
  background: var(--acento-suave); color: var(--marca); display: grid; place-items: center; font-weight: 700; }

.preguntas { display: grid; gap: 10px; }
.preguntas details { background: var(--superficie); border: 1px solid var(--borde); border-radius: var(--radio); padding: 14px 16px; }
.preguntas summary { cursor: pointer; font-weight: 600; }
.preguntas details p { margin-top: 8px; color: var(--suave); }

/* ---------- Formulario ---------- */
.pestanas { display: flex; gap: 6px; padding: 8px 16px; background: var(--fondo); border-bottom: 1px solid var(--borde);
  position: sticky; top: 57px; z-index: 15; }
.pestanas button { flex: 1; min-height: 42px; border-radius: 999px; border: 1px solid var(--borde); background: var(--superficie);
  font-weight: 600; cursor: pointer; color: var(--suave); }
.pestanas button[aria-selected="true"] { background: var(--texto); color: var(--fondo); border-color: var(--texto); }

.crear { display: block; }
.crear .formulario { padding: 20px 16px 24px; max-width: 640px; margin: 0 auto; }
.crear h1 { font-size: 30px; margin-bottom: 18px; }
.crear .vista { display: none; }
body[data-pestana="vista"] .crear .formulario { display: none; }
body[data-pestana="vista"] .crear .vista { display: flex; flex-direction: column; align-items: center; padding: 12px 0 0; }
body[data-pestana="vista"] .pie-sitio { display: none; }
.crear .vista .telefono { width: 100%; max-width: 420px; aspect-ratio: auto; height: calc(100dvh - 170px); min-height: 480px;
  border-radius: 0; padding: 0; background: none; box-shadow: none; }
.crear .vista .telefono iframe { border-radius: 0; }
.nota-vista { font-size: 13px; color: var(--suave); text-align: center; padding: 8px 16px; }

.bloque { border: 1px solid var(--borde); background: var(--superficie); border-radius: 18px; padding: 18px 16px; margin: 0 0 16px;
  box-shadow: var(--sombra); min-width: 0; }
.bloque legend { float: left; width: 100%; padding: 0; margin-bottom: 4px; font-family: var(--serif); font-size: 21px; }
.bloque legend + * { clear: both; }
.num { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--acento-suave);
  color: var(--marca); font-family: var(--sans); font-size: 14px; font-weight: 700; margin-right: 8px; vertical-align: 3px; }
.ayuda { font-size: 14px; color: var(--suave); margin: 4px 0 12px; }

.campo { display: grid; gap: 6px; margin-top: 12px; }
.campo > span { font-size: 14px; font-weight: 600; }
.campo input, .campo textarea {
  width: 100%; min-height: 48px; padding: 11px 14px; border-radius: 12px; border: 1px solid #d9c6cd; background: #fff;
  font-size: 16px; /* evita el zoom automático en iPhone */
}
.campo textarea { min-height: 180px; resize: vertical; line-height: 1.55; }
.campo input:focus, .campo textarea:focus { border-color: var(--marca); outline: none; box-shadow: 0 0 0 3px var(--acento-suave); }
.fila-campos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.contador-letras { font-size: 12px; color: var(--suave); text-align: right; }
.con-error input, .con-error textarea, input.con-error, textarea.con-error { border-color: var(--error) !important; }
.error-campo { color: var(--error); font-size: 13px; margin-top: 4px; }

.opciones { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.opcion { position: relative; display: grid; gap: 8px; padding: 10px; border: 2px solid var(--borde); border-radius: 16px; cursor: pointer;
  background: #fff; transition: border-color .2s; }
.opcion:has(input:checked) { border-color: var(--marca); box-shadow: 0 0 0 3px var(--acento-suave); }
.opcion input { position: absolute; opacity: 0; pointer-events: none; }
.opcion:has(input:focus-visible) { outline: 3px solid var(--acento); outline-offset: 2px; }
.opcion b { display: block; font-size: 16px; }
.opcion small { display: block; color: var(--suave); font-size: 13px; line-height: 1.35; }
.miniatura { height: 92px; border-radius: 10px; display: grid; place-items: center; font-size: 26px; overflow: hidden; }
.miniatura.clasica { background: linear-gradient(160deg, #2a0f2e, #6b1d4a 60%, #a83a62); color: #ff6f91; font-family: var(--serif); }
.miniatura.moderna { background: #0b0b0f; color: #c6ff3d; font-weight: 900; letter-spacing: -.04em; position: relative; }
.miniatura.moderna::before { content: ""; position: absolute; top: 8px; left: 8px; right: 8px; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, #f5f5f7 40%, rgba(255,255,255,.25) 40%); }
.opciones.idioma .opcion { grid-template-columns: auto 1fr; align-items: center; padding: 12px 14px; }

.zona-fotos { border: 2px dashed #dcc4cc; border-radius: 16px; padding: 16px; text-align: center; background: #fffafc; transition: background .2s, border-color .2s; }
.zona-fotos.encima { background: var(--acento-suave); border-color: var(--marca); }
.zona-fotos .boton { margin-bottom: 6px; }
.zona-fotos small { display: block; color: var(--suave); font-size: 13px; }
.lista-fotos { list-style: none; padding: 0; margin: 14px 0 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.foto-item { display: grid; gap: 6px; background: #fff; border: 1px solid var(--borde); border-radius: 14px; padding: 8px; }
.foto-item .miniatura-foto { aspect-ratio: 1; border-radius: 9px; overflow: hidden; background: #f3e8ec; display: grid; place-items: center;
  font-size: 13px; color: var(--suave); }
.foto-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.foto-item input { width: 100%; min-height: 40px; padding: 8px 10px; border-radius: 10px; border: 1px solid #d9c6cd; font-size: 16px; }
.foto-acciones { display: flex; gap: 6px; justify-content: space-between; }
.foto-acciones button, .quitar { min-width: 40px; min-height: 36px; border-radius: 10px; border: 1px solid var(--borde); background: #fff; cursor: pointer; }
.foto-acciones button:disabled { opacity: .35; cursor: default; }
.foto-acciones button:hover:not(:disabled), .quitar:hover { background: var(--acento-suave); }

.lista-momentos { display: grid; gap: 12px; margin-bottom: 12px; }
.momento-item { border: 1px solid var(--borde); border-radius: 14px; padding: 4px 12px 12px; background: #fffdfc; position: relative; }
.momento-item .cabeza { display: flex; align-items: center; justify-content: space-between; padding-top: 8px; font-weight: 600; font-size: 14px; color: var(--suave); }

.caja-pago { display: grid; gap: 14px; }
.precio-grande { font-family: var(--serif); font-size: 30px; }
.precio-grande small { font-family: var(--sans); font-size: 14px; color: var(--suave); margin-left: 6px; }
.casilla { display: grid; grid-template-columns: 24px 1fr; gap: 10px; align-items: start; font-size: 15px; cursor: pointer; }
.casilla input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--marca); }
.nota-chica { font-size: 13px; color: var(--suave); }

/* ---------- Después del pago y borrar ---------- */
.tarjeta { background: var(--superficie); border: 1px solid var(--borde); border-radius: 18px; padding: 20px 16px; box-shadow: var(--sombra); margin-top: 16px; }
.tarjeta h2 { font-size: 22px; margin-bottom: 10px; }
.titulo-pagina { font-size: clamp(28px, 7vw, 40px); margin: 32px 0 8px; }
.enlace-caja { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.enlace-caja input { flex: 1 1 220px; min-width: 0; min-height: 44px; padding: 8px 12px; border-radius: 10px; border: 1px solid #d9c6cd;
  background: #fffafc; font-family: ui-monospace, Consolas, monospace; font-size: 14px; }
.qr { display: grid; justify-items: center; gap: 12px; }
.qr canvas { width: min(100%, 260px); height: auto; image-rendering: pixelated; border-radius: 8px; border: 1px solid var(--borde); }
.girando { width: 36px; height: 36px; border-radius: 50%; border: 4px solid var(--acento-suave); border-top-color: var(--marca);
  animation: girar 1s linear infinite; margin: 8px auto; }
@keyframes girar { to { transform: rotate(360deg); } }

/* ---------- Legal ---------- */
.legal { padding-bottom: 24px; }
.legal h1 { font-size: clamp(28px, 6vw, 38px); margin: 28px 0 12px; }
.legal h2 { font-size: 22px; margin: 26px 0 8px; }
.legal p, .legal li { color: #4a3340; }
.legal p + p { margin-top: 10px; }
.legal ul { padding-left: 22px; }
.borrador { border: 2px solid var(--aviso); background: var(--aviso-suave); color: var(--aviso); border-radius: var(--radio);
  padding: 12px 14px; font-weight: 700; margin-top: 20px; }
body[data-idioma="es"] [lang="en"].solo-idioma, body[data-idioma="en"] [lang="es"].solo-idioma { display: none; }

/* ---------- Pantallas anchas ---------- */
@media (min-width: 900px) {
  .pestanas { display: none; }
  .crear { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 32px; max-width: 1180px; margin: 0 auto; padding: 0 24px; }
  .crear .formulario { padding: 28px 0 40px; margin: 0; max-width: none; }
  .crear .vista, body[data-pestana="vista"] .crear .vista { display: flex; flex-direction: column; align-items: center;
    position: sticky; top: 72px; align-self: start; padding: 28px 0 0; }
  body[data-pestana="vista"] .crear .formulario { display: block; }
  body[data-pestana="vista"] .pie-sitio { display: block; }
  .crear .vista .telefono { width: 380px; height: min(780px, calc(100vh - 140px)); min-height: 0; border-radius: 40px; padding: 11px;
    background: #1c1418; box-shadow: 0 18px 50px rgba(42, 15, 46, .25); }
  .crear .vista .telefono iframe { border-radius: 30px; }
  .lista-fotos { grid-template-columns: repeat(3, 1fr); }
  .plantillas { grid-template-columns: 1fr 1fr; }
  .pasos { grid-template-columns: repeat(3, 1fr); }
}
