/* restaurarfoto.es — estilos. Borrador del modelo local (Gemma 4 31B), revisado y corregido. */

/* Variables y Temas */
:root {
  --fondo: #ffffff;
  --texto: #1d1b19;
  --suave: #6b6560;
  --linea: #e7e3df;
  --gris: #f6f4f2;
  --acento: #9a4a24;
  --acento-hover: #7f3c1c;
  --sobre-acento: #ffffff;
  --error: #a3261b;
  --ok: #2f6b3a;
  --radio: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fondo: #141210;
    --texto: #ece8e4;
    --suave: #a9a29b;
    --linea: #2c2825;
    --gris: #1c1916;
    --acento: #e0915f;
    --acento-hover: #f0a878;
    --sobre-acento: #141210;
    --error: #ff8f80;
    --ok: #8fd19e;
  }
}

/* Reset y Base */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--texto);
  background-color: var(--fondo);
}

@media (min-width: 48rem) {
  body { font-size: 18px; }
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3 { 
  letter-spacing: -0.01em; 
  line-height: 1.2; 
  font-weight: 700; 
}
h1 { font-size: clamp(2rem, 5vw, 2.6rem); }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }

a { 
  color: var(--acento); 
  text-decoration: underline; 
  text-underline-offset: 0.2em; 
}

a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid var(--acento);
  outline-offset: 2px;
}

/* Layout */
.contenedor {
  width: 100%;
  max-width: 42rem;
  margin-inline: auto;
  padding-inline: 1rem;
}

.franja { padding-block: 3.5rem; }
.franja-gris { background-color: var(--gris); }
.franja > .contenedor > :first-child { margin-top: 0; }
.franja > .contenedor > :last-child { margin-bottom: 0; }

@media (min-width: 48rem) {
  .franja { padding-block: 5rem; }
}

/* Cabecera y Pie */
.cabecera {
  border-bottom: 1px solid var(--linea);
  padding-block: 1rem;
}
.cabecera-dentro { 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
}
.marca { 
  font-weight: 700; 
  text-decoration: none; 
  color: var(--texto); 
}
.marca span { color: var(--suave); }
.menu { display: flex; gap: 1.25rem; }
.menu a { 
  text-decoration: none; 
  color: var(--texto); 
}

.pie { 
  border-top: 1px solid var(--linea); 
  padding-block: 2rem; 
  font-size: 0.9rem; 
  color: var(--suave); 
}
.pie-enlaces { 
  display: flex; 
  flex-wrap: wrap; 
  gap: 1rem; 
  margin-bottom: 1rem; 
}
.credito { margin: 0; }

/* Elementos Comunes */
.entradilla { font-size: 1.1rem; color: var(--suave); }
.nota { font-size: 0.85rem; color: var(--suave); }
.aviso { border: 1px solid var(--acento); padding: 1rem; border-radius: var(--radio); }
.oculto { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; border: 0 !important; white-space: nowrap !important; }
/* El enlace «Saltar al contenido» se ve al llegar a él con el teclado */
a.oculto:focus-visible { position: fixed !important; top: 0.5rem; left: 0.5rem; width: auto !important; height: auto !important; clip: auto !important; margin: 0 !important; padding: 0.5rem 1rem !important; background: var(--fondo); z-index: 10; }
[hidden] { display: none !important; }

.boton, .boton-secundario {
  display: inline-block;
  font: inherit;
  font-weight: 600;
  padding: 0.85rem 1.4rem;
  border-radius: var(--radio);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s, background-color 0.2s, border-color 0.2s;
  border: 2px solid transparent;
}
.boton { background-color: var(--acento); color: var(--sobre-acento); }
.boton:hover { background-color: var(--acento-hover); }
.boton-secundario { border-color: var(--acento); color: var(--acento); background: transparent; }
.boton-secundario:hover { background-color: var(--acento); color: var(--sobre-acento); }
.boton:disabled, .boton-secundario:disabled { opacity: 0.5; cursor: not-allowed; }
.botones { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }

/* Listas y Tablas */
.pasos { 
  list-style: none; 
  padding: 0; 
  counter-reset: pasos; 
}
.pasos li {
  position: relative;
  padding-left: 2.5rem;
  margin-bottom: 1.5rem;
  counter-increment: pasos;
}
.pasos li::before {
  content: counter(pasos);
  position: absolute;
  left: 0;
  top: -0.2rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--acento);
}
.pasos li strong { display: block; }

.galeria {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}
@media (min-width: 48rem) { .galeria { grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); } }
.galeria figure { margin: 0; }
.galeria img { border-radius: var(--radio); }
.galeria figcaption { font-size: 0.85rem; color: var(--suave); margin-top: 0.5rem; }

.precios { 
  width: 100%; 
  border-collapse: collapse; 
}
.precios tr { border-bottom: 1px solid var(--linea); }
.precios td, .precios th { padding: 0.75rem 0; text-align: left; }
.precios td:last-child, .precios th:last-child { 
  text-align: right; 
  font-variant-numeric: tabular-nums; 
}

/* FAQ */
.preguntas details { border-bottom: 1px solid var(--linea); padding: 1rem 0; }
.preguntas summary { 
  list-style: none; 
  font-weight: 700; 
  cursor: pointer; 
  display: flex; 
  justify-content: space-between; 
}
.preguntas summary::-webkit-details-marker { display: none; }
.preguntas summary::after { content: '+'; }
.preguntas details[open] summary::after { content: '−'; }

/* Formularios */
.campo { display: block; margin-bottom: 1.25rem; }
.campo label { display: block; margin-bottom: 0.4rem; font-weight: 600; }
/* La casilla va a la izquierda y el texto (con sus enlaces) fluye normal a su lado */
.casilla { display: block; position: relative; padding-left: 1.9rem; cursor: pointer; margin-bottom: 0.75rem; }
.casilla input { position: absolute; left: 0; top: 0.2em; width: 1.2rem; height: 1.2rem; margin: 0; accent-color: var(--acento); }
fieldset { border: 0; padding: 0; margin: 0 0 1.25rem; min-width: 0; }
legend { font-weight: 600; margin-bottom: 0.5rem; padding: 0; }
.subida-form > * + * { margin-top: 1rem; }

input[type="text"], input[type="email"], input[type="tel"], input[type="number"], select {
  width: 100%;
  padding: 0.7rem;
  border: 1px solid var(--linea);
  border-radius: var(--radio);
  background: var(--fondo);
  color: var(--texto);
  font: inherit;
}

.subida {
  display: block;
  border: 2px dashed var(--linea);
  border-radius: 20px;
  padding: 2.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}
.subida:hover, .subida.encima { border-color: var(--acento); background: var(--gris); }
.subida-texto { display: block; font-weight: 700; font-size: 1.2rem; }
.subida-nota { font-size: 0.85rem; color: var(--suave); }

.progreso { width: 100%; height: 8px; accent-color: var(--acento); }
.mensaje { min-height: 1.6em; margin-top: 1rem; }
.error { color: var(--error); }
.ok { color: var(--ok); font-weight: 600; }

/* Página de la foto */
.total { font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.alternar { display: inline-flex; border: 1px solid var(--linea); border-radius: var(--radio); overflow: hidden; margin-bottom: 1rem; }
.alternar button { font: inherit; border: 0; background: transparent; color: var(--texto); padding: 0.45rem 1rem; cursor: pointer; }
.alternar button[aria-pressed="true"] { background: var(--acento); color: var(--sobre-acento); }
#botones-paypal { margin-top: 1.25rem; min-height: 3rem; }

/* Comparador */
.comparar {
  position: relative;
  border-radius: var(--radio);
  overflow: hidden;
}
.comparar-antes { width: 100%; }
.comparar-despues {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  clip-path: inset(0 0 0 var(--pos));
}
.comparar::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  left: var(--pos);
  width: 2px;
  background: #fff;
  pointer-events: none;
}
.comparar-barra {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: ew-resize;
  z-index: 2;
}
.comparar-etiqueta {
  position: absolute;
  top: 1rem;
  padding: 0.25rem 0.75rem;
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 0.8rem;
  border-radius: 4px;
  pointer-events: none;
  z-index: 1;
}
.comparar-etiqueta-antes { left: 1rem; }
.comparar-etiqueta-despues { right: 1rem; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
