/* ============================================================
   SLAC — estilos de la web (negro cálido y dorado del logo)
   Las variables de :root también las usa admin.css.
   El visor de fotos vive en visor.css; el aviso legal en legal.css.
   ============================================================ */

/* ── 0. FUENTES (autoalojadas, SIL OFL 1.1) ──────────────── */
@font-face {
  font-family: 'Cormorant Garamond';
  src: url('public/fonts/cormorant-garamond-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Manrope';
  src: url('public/fonts/manrope-variable.woff2') format('woff2');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

/* ── 1. TOKENS ───────────────────────────────────────────── */
:root {
  --clr-bg:           #0a0908;
  --clr-surface:      #141210;
  --clr-surface-2:    #1b1815;
  --clr-border:       rgba(212, 175, 55, 0.18);
  --clr-border-hover: rgba(212, 175, 55, 0.5);
  --clr-gold:         #d4af37;
  --clr-gold-light:   #e5c158;
  --clr-gold-dim:     rgba(212, 175, 55, 0.12);
  --clr-text:         #eae6df;
  --clr-text-muted:   #a29d95;
  --clr-white:        #ffffff;
  --clr-on-gold:      #15110a;

  --gradient-gold: linear-gradient(135deg, #d4af37 0%, #e9c766 50%, #c9a227 100%);

  --font-heading: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-body:    'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --space-1: 4px;   --space-2: 8px;   --space-3: 12px;  --space-4: 16px;
  --space-5: 20px;  --space-6: 24px;  --space-7: 28px;  --space-8: 32px;
  --space-10: 40px; --space-12: 48px; --space-14: 56px; --space-16: 64px;
  --space-20: 80px; --space-24: 96px; --space-32: 128px;

  --radius-sm: 6px; --radius-md: 12px; --radius-lg: 18px; --radius-xl: 24px; --radius-pill: 999px;

  --ease-luxury: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 200ms;
  --dur-med:  400ms;
  --dur-slow: 700ms;

  --hueco: clamp(6px, 1.1vw, 14px);          /* separación entre fotos */

  --z-fab: 50;
  --z-header: 100;
  --z-skip: 400;
}

/* ── 2. BASE ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html.sin-scroll { overflow: hidden; }

body {
  min-height: 100vh;
  background: var(--clr-bg);
  color: var(--clr-text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
picture { display: contents; }                       /* el <img> sigue siendo el elemento maquetado */
picture source { display: none; }                    /* sin esto, sus <source> cuentan como hijos de la rejilla */
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul { list-style: none; }

:focus-visible { outline: 2px solid var(--clr-gold-light); outline-offset: 3px; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.icono { width: 1.25em; height: 1.25em; flex: none; fill: currentColor; }

.solo-lector, .sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.salto, .skip-link {
  position: fixed; top: var(--space-3); left: var(--space-3); z-index: var(--z-skip);
  padding: var(--space-3) var(--space-5); border-radius: var(--radius-pill);
  background: var(--clr-gold-light); color: var(--clr-on-gold); font-weight: 600;
  transform: translateY(-200%); transition: transform var(--dur-fast);
}
.salto:focus, .skip-link:focus { transform: none; }

/* ── 3. CABECERA ─────────────────────────────────────────── */
.cabecera {
  position: fixed; inset: 0 0 auto; z-index: var(--z-header);
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  padding: var(--space-2) clamp(var(--space-4), 4vw, var(--space-10));
  padding-top: max(var(--space-2), env(safe-area-inset-top));
  background: rgba(10, 9, 8, 0.82);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--clr-border);
  transform: translateY(-105%);
  transition: transform var(--dur-slow) var(--ease-luxury);
}
.cabecera--visible { transform: none; }
.sin-js .cabecera { display: none; }

.cabecera-logo img { width: 92px; }

.cabecera-tel {
  display: inline-flex; align-items: center; gap: var(--space-2);
  min-height: 44px; padding: 0 var(--space-4);
  border: 1px solid var(--clr-border); border-radius: var(--radius-pill);
  color: var(--clr-gold-light); font-size: 0.9rem; font-weight: 500; letter-spacing: 0.06em;
  font-variant-numeric: lining-nums tabular-nums; white-space: nowrap;
  transition: border-color var(--dur-fast), background var(--dur-fast);
}
.cabecera-tel:hover { border-color: var(--clr-border-hover); background: var(--clr-gold-dim); }

/* ── 4. PORTADA ──────────────────────────────────────────── */
.portada {
  position: relative; height: 100vh; height: 100svh; min-height: 540px;
  overflow: hidden; background: #000; isolation: isolate;
}

.portada-fotos { position: absolute; inset: 0; z-index: -2; display: grid; }

.portada-foto { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; }

.portada::after {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(to bottom,
    rgba(10, 9, 8, 0.35) 0%, rgba(10, 9, 8, 0) 22%, rgba(10, 9, 8, 0) 48%,
    rgba(10, 9, 8, 0.78) 80%, var(--clr-bg) 100%);
}

.portada-marca {
  position: absolute; inset: auto 0 clamp(56px, 8vh, 88px);
  display: flex; flex-direction: column; align-items: center; gap: var(--space-3);
  padding-inline: var(--space-6); text-align: center;
}

.portada-logo { line-height: 0; }
.portada-logo img { width: min(44vw, 210px); filter: drop-shadow(0 4px 24px rgba(0, 0, 0, 0.55)); }

.portada-tel {
  font-family: var(--font-heading); font-weight: 500;
  font-size: clamp(1.35rem, 5.2vw, 2.2rem); line-height: 1.2; letter-spacing: 0.04em;
  font-variant-numeric: lining-nums; color: var(--clr-gold-light);
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.7);
  padding-bottom: var(--space-1); border-bottom: 1px solid rgba(229, 193, 88, 0.35);
  transition: border-color var(--dur-med);
}
.portada-tel:hover { border-color: var(--clr-gold-light); }

.portada-bajar {
  position: absolute; left: 50%; bottom: var(--space-5); translate: -50% 0;
  width: 44px; height: 44px; display: grid; place-items: center;
}
.portada-bajar span { width: 1px; height: 32px; background: linear-gradient(var(--clr-gold-light), transparent); }

@media (min-width: 900px) {
  /* El fondo de escritorio ya lleva el logo y el lema: el logo superpuesto queda solo para lectores y el teléfono pasa a la derecha */
  .portada-foto { object-position: 50% 30%; }
  .portada-logo { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .portada-marca { inset: auto 0 clamp(48px, 9vh, 96px) 52%; }
}

/* ── 5. GALERÍA (columnas tipo revista, sin recortes) ───── */
.galeria {
  max-width: 1480px; margin-inline: auto;
  padding: clamp(var(--space-14), 9vw, 120px) var(--hueco) clamp(var(--space-14), 8vw, 110px);
}

.galeria::before {
  content: ''; display: block; width: 56px; height: 1px; margin: 0 auto clamp(var(--space-10), 6vw, var(--space-16));
  background: var(--gradient-gold);
}

.galeria-rejilla { columns: 2; column-gap: var(--hueco); }
@media (min-width: 700px)  { .galeria-rejilla { columns: 3; } }
@media (min-width: 1100px) { .galeria-rejilla { columns: 4; } }

.pieza { break-inside: avoid; margin-bottom: var(--hueco); }

.pieza-boton {
  position: relative; display: block; width: 100%; overflow: hidden;
  background: var(--clr-surface); border-radius: 2px; cursor: zoom-in;
}
.pieza-boton::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  border: 1px solid transparent; transition: border-color var(--dur-med);
}

.pieza-foto { width: 100%; transition: transform 1.1s var(--ease-luxury), opacity var(--dur-med); }
.pieza-foto--alt {
  position: absolute; inset: 0; height: 100%; object-fit: cover; opacity: 0;
}

@media (hover: hover) and (pointer: fine) {
  .pieza-boton:hover .pieza-foto { transform: scale(1.04); }
  .pieza-boton:hover .pieza-foto--alt.lista { opacity: 1; }
  .pieza-boton:hover::after { border-color: var(--clr-border-hover); }
}

.pieza-num {
  position: absolute; right: var(--space-2); bottom: var(--space-2); z-index: 1;
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 7px;
  border-radius: var(--radius-pill); background: rgba(10, 9, 8, 0.6);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  color: var(--clr-white); font-size: 0.72rem; font-weight: 600; line-height: 1.4;
}
.pieza-num .icono { width: 13px; height: 13px; }

/* Número de la prenda: solo cifras; fondo casi opaco para que el dorado se lea sobre cualquier foto */
.pieza-id, .visor-id {
  padding: 2px 10px; border-radius: var(--radius-pill); background: rgba(10, 9, 8, 0.82);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  color: var(--clr-gold-light); font-size: 0.8rem; font-weight: 600; line-height: 1.5;
  font-variant-numeric: tabular-nums; letter-spacing: 0.04em;
}
.pieza-id { position: absolute; top: var(--space-2); left: var(--space-2); z-index: 1; pointer-events: none; }

.aviso-sin-js { text-align: center; color: var(--clr-text-muted); padding: var(--space-10) 0; }

/* ── 6. CONTACTO ─────────────────────────────────────────── */
.contacto {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; place-items: center; min-height: 86vh; min-height: 86svh;
  padding: var(--space-24) var(--space-5); text-align: center;
}

.contacto-fondo {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%;
}
.contacto::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(to bottom, var(--clr-bg) 0%, rgba(10, 9, 8, 0) 22%, rgba(10, 9, 8, 0) 78%, var(--clr-bg) 100%),
    radial-gradient(ellipse at center, rgba(10, 9, 8, 0.5) 0%, rgba(10, 9, 8, 0.8) 72%);
}

.contacto-logo { width: min(48vw, 220px); margin: 0 auto var(--space-6); }

.contacto-numero {
  display: inline-block; margin-bottom: var(--space-8);
  font-family: var(--font-heading); font-weight: 500;
  font-size: clamp(2.2rem, 8.5vw, 4.4rem); line-height: 1.1; letter-spacing: 0.03em;
  font-variant-numeric: lining-nums; color: var(--clr-gold-light);
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.6);
}

.contacto-acciones { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-3); }

.boton {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-3);
  min-height: 54px; min-width: 168px; padding: 0 var(--space-7);
  border-radius: var(--radius-pill);
  font-size: 0.78rem; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase;
  transition: transform var(--dur-fast) var(--ease-luxury), box-shadow var(--dur-med), background var(--dur-med), border-color var(--dur-med);
}
.boton .icono { width: 20px; height: 20px; }
.boton:active { transform: scale(0.97); }

.boton--oro { background: var(--gradient-gold); color: var(--clr-on-gold); box-shadow: 0 10px 30px rgba(212, 175, 55, 0.18); }
.boton--oro:hover { box-shadow: 0 12px 40px rgba(212, 175, 55, 0.32); }

.boton--borde {
  color: var(--clr-gold-light); border: 1px solid rgba(229, 193, 88, 0.55);
  background: rgba(10, 9, 8, 0.35);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.boton--borde:hover { border-color: var(--clr-gold-light); background: rgba(212, 175, 55, 0.1); }

/* ── 7. PIE ──────────────────────────────────────────────── */
.pie {
  padding: var(--space-8) var(--space-5) calc(var(--space-8) + env(safe-area-inset-bottom));
  text-align: center; border-top: 1px solid var(--clr-border);
}
.pie a {
  display: inline-block; padding: var(--space-2) var(--space-3);
  color: var(--clr-text-muted); font-size: 0.72rem; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase;
  transition: color var(--dur-fast);
}
.pie a:hover { color: var(--clr-gold-light); }

/* ── 8. BOTÓN FLOTANTE (WhatsApp) ───────────────────────── */
.flotante {
  position: fixed; z-index: var(--z-fab);
  right: max(var(--space-4), env(safe-area-inset-right)); bottom: max(var(--space-4), env(safe-area-inset-bottom));
  width: 58px; height: 58px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--gradient-gold); color: var(--clr-on-gold);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  transition: transform var(--dur-med) var(--ease-luxury), opacity var(--dur-med);
}
.flotante .icono { width: 30px; height: 30px; }
.flotante:hover { transform: scale(1.06); }
.flotante--oculto { opacity: 0; transform: scale(0.6); pointer-events: none; }

/* Sin JavaScript no hay número (vive en data/galeria.js): no se muestran enlaces vacíos */
.sin-js .flotante,
.sin-js .portada-tel,
.sin-js .contacto-numero,
.sin-js .contacto-acciones { display: none; }

/* ── 9. ANIMACIONES ──────────────────────────────────────── */
.portada-foto { animation: acercar 2.6s var(--ease-luxury) both; }
.portada-marca { animation: subir 1.4s 0.3s var(--ease-luxury) both; }
.portada-bajar span { animation: latir 2.4s 1.6s ease-in-out infinite; transform-origin: top; }

/* La entrada de cada foto depende de app.js (sin JS se ven siempre) */
.js .pieza { opacity: 0; transform: translateY(18px); transition: opacity 0.9s var(--ease-luxury), transform 0.9s var(--ease-luxury); }
.js .pieza.visible { opacity: 1; transform: none; }

@keyframes acercar { from { transform: scale(1.07); } to { transform: none; } }
@keyframes subir   { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes latir   { 0%, 100% { transform: scaleY(0.35); opacity: 0.4; } 50% { transform: scaleY(1); opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
  .js .pieza { opacity: 1; transform: none; }
}

/* ── 10. MÓVIL PEQUEÑO ───────────────────────────────────── */
@media (max-width: 380px) {
  .cabecera-logo img { width: 78px; }
  .cabecera-tel { padding: 0 var(--space-3); font-size: 0.82rem; }
}
