/*
 * Catálogo público de Gentleman. Mismos colores y letras que el sistema (negro, dorado y marfil).
 * Mobile-first: las reglas sin @media son para el celular; 700px y 1000px amplían.
 * El texto dorado usa --oro-oscuro (el dorado claro solo va de decoración: no alcanza contraste).
 */
@font-face {
  font-family: 'Playfair Display';
  src: url('/fuentes/playfair-display-latin-wght-normal.woff2') format('woff2');
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: 'Manrope';
  src: url('/fuentes/manrope-latin-wght-normal.woff2') format('woff2');
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --tinta: #15130f;
  --marfil: #f6f3ec;
  --linea: #e7e1d3;
  --linea-suave: #f0ebe0;
  --apagado: #6a645a;
  --oro: #c4a56a;
  --oro-claro: #e9d6a8;
  --oro-oscuro: #7e6228;
  --letra-titulo: 'Playfair Display', Georgia, serif;
  --letra: 'Manrope', system-ui, sans-serif;
  --ancho: 1200px;
  --margen: 16px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

html.bloqueado {
  overflow: hidden;
}

body {
  margin: 0;
  background: var(--marfil);
  color: var(--tinta);
  font-family: var(--letra);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

:focus-visible {
  outline: 3px solid var(--oro);
  outline-offset: 2px;
  border-radius: 4px;
}

button,
a {
  touch-action: manipulation;
}

[hidden] {
  display: none !important;
}

/* --- Portada --- */

.portada {
  padding: 28px var(--margen) 8px;
  text-align: center;
}

.portada__logo {
  display: block;
  width: min(250px, 66vw);
  height: auto;
  margin: 0 auto;
}

.portada__titulo {
  margin: 4px 0 0;
  font-family: var(--letra-titulo);
  font-size: 2rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--oro-oscuro);
}

.portada__titulo::after {
  content: '';
  display: block;
  width: 56px;
  height: 2px;
  margin: 14px auto 0;
  background: var(--oro);
}

.portada__texto {
  max-width: 34ch;
  margin: 14px auto 0;
  color: var(--apagado);
  font-size: 0.95rem;
}

/* --- Filtros --- */

.filtros {
  position: sticky;
  top: 0;
  z-index: 5;
  margin-top: 22px;
  background: rgba(246, 243, 236, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--linea);
}

.filtros__lista {
  display: flex;
  gap: 8px;
  justify-content: safe center;
  max-width: var(--ancho);
  margin: 0 auto;
  padding: 10px var(--margen);
  overflow-x: auto;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}

.filtros__lista::-webkit-scrollbar {
  display: none;
}

.filtro {
  flex: none;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--linea);
  border-radius: 999px;
  background: transparent;
  color: var(--tinta);
  font: 600 0.9rem/1 var(--letra);
  cursor: pointer;
  scroll-snap-align: start;
  transition:
    background-color 0.2s,
    color 0.2s,
    border-color 0.2s;
}

.filtro:hover {
  border-color: var(--oro);
}

.filtro[aria-pressed='true'] {
  background: var(--tinta);
  border-color: var(--tinta);
  color: var(--marfil);
}

.filtro__cuenta {
  margin-left: 6px;
  font-weight: 500;
  opacity: 0.65;
}

/* --- Galería --- */

.contenido {
  max-width: var(--ancho);
  margin: 0 auto;
  padding: 14px var(--margen) 40px;
}

.contenido__estado {
  margin: 0 0 12px;
  color: var(--apagado);
  font-size: 0.85rem;
}

.galeria {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-flow: dense;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.galeria__vacio {
  grid-column: 1 / -1;
  color: var(--apagado);
}

.foto {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--linea-suave), var(--linea));
  aspect-ratio: 3 / 4;
  cursor: zoom-in;
}

.galeria__item--ancha {
  grid-column: span 2;
}

.galeria__item--ancha .foto {
  aspect-ratio: 3 / 2;
}

.foto img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  transition: transform 0.5s ease;
}

.foto:hover img {
  transform: scale(1.04);
}

@media (min-width: 700px) {
  :root {
    --margen: 24px;
  }

  .portada {
    padding-top: 40px;
  }

  .portada__titulo {
    font-size: 2.4rem;
  }

  .galeria {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }
}

@media (min-width: 1000px) {
  .galeria {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* --- Pie --- */

.pie {
  padding: 36px var(--margen) 44px;
  background: var(--tinta);
  color: var(--marfil);
  text-align: center;
}

.pie p {
  margin: 0;
}

.pie__marca {
  font-family: var(--letra-titulo);
  font-size: 1.6rem;
  letter-spacing: 0.22em;
  color: var(--oro-claro);
}

.pie__lema {
  margin-top: 4px;
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(246, 243, 236, 0.7);
}

.pie__whatsapp {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  margin-top: 22px;
  padding: 0 28px;
  border-radius: 999px;
  background: var(--oro);
  color: var(--tinta);
  font-weight: 700;
  text-decoration: none;
}

.pie__whatsapp:hover {
  background: var(--oro-claro);
}

/* --- Botón flotante de WhatsApp --- */

.flotante {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 8;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  /* El verde y el logo oficiales de WhatsApp: se reconoce a primera vista. */
  background: #25d366;
  color: #fff;
  box-shadow:
    0 4px 14px rgba(21, 19, 15, 0.35),
    0 1px 3px rgba(21, 19, 15, 0.25);
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.flotante:hover {
  transform: scale(1.07);
  box-shadow: 0 6px 18px rgba(21, 19, 15, 0.4);
}

.flotante:focus-visible {
  outline-color: var(--tinta);
  outline-offset: 3px;
}

/* --- Visor de fotos --- */

.visor {
  width: 100%;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(21, 19, 15, 0.97);
  color: var(--marfil);
  overflow: hidden;
}

.visor[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}

.visor::backdrop {
  background: rgba(21, 19, 15, 0.97);
}

.visor__figura {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 56px 12px 14px;
  max-width: 100%;
  touch-action: pan-y;
}

.visor__foto {
  display: block;
  max-width: 100%;
  max-height: calc(100dvh - 130px);
  width: auto;
  height: auto;
  border-radius: 8px;
  background: var(--tinta);
  -webkit-user-select: none;
  user-select: none;
}

.visor__pie {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 14px;
  max-width: 60ch;
  font-size: 0.9rem;
  text-align: center;
  color: rgba(246, 243, 236, 0.85);
}

.visor__cuenta {
  color: var(--oro-claro);
  font-variant-numeric: tabular-nums;
}

.visor__cerrar,
.visor__flecha {
  position: absolute;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid rgba(246, 243, 236, 0.25);
  border-radius: 50%;
  background: rgba(21, 19, 15, 0.6);
  color: var(--marfil);
  cursor: pointer;
  transition: background-color 0.2s;
}

.visor__cerrar:hover,
.visor__flecha:hover {
  background: rgba(196, 165, 106, 0.35);
}

.visor__cerrar {
  top: 10px;
  right: 10px;
  z-index: 2;
}

.visor__flecha {
  top: 50%;
  z-index: 2;
  margin-top: -24px;
}

.visor__flecha--atras {
  left: 8px;
}

.visor__flecha--adelante {
  right: 8px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
