/* ==================================================
   OLIVER'S BARBERSHOP - HOME
   Hallmark v2.0.0
   ================================================== */

html:has(.home-page),
body.home-page {
  overflow-x: clip;
}

/* ==================================================
   CONFIGURACIÓN DE SECCIONES CLARAS
   ================================================== */

:where(.about, .pricing, .booking) {
  --color-text-primary: var(--color-text-on-light);
  --color-text-secondary: var(--color-text-secondary-light);
  --color-text-accent: var(--color-text-gold-on-light);
  --color-focus-ring: var(--color-focus-ring-light);
}

main > section {
  scroll-margin-top: calc(var(--height-header) + var(--space-4));
}

/* ==================================================
   HERO - COMPOSICIÓN PRINCIPAL
   ================================================== */

.hero {
  min-height: 720px;
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  overflow: clip;
}

.hero::before {
  content: "";
  position: absolute;
  z-index: var(--z-background);
  inset: 0;
  background: var(--color-surface-hero) url("../videos/hero-poster.jpg") center
    32% / cover no-repeat;
  background-image: image-set(
    url("../videos/hero-poster-v1.webp") type("image/webp"),
    url("../videos/hero-poster.jpg") type("image/jpeg")
  );
}

.hero::after {
  content: "";
  position: absolute;
  z-index: var(--z-overlay);
  inset: 0;
  background: var(--color-overlay-hero-uniform);
  pointer-events: none;
}

.hero-content {
  padding-block: calc(var(--height-header) + var(--space-20)) var(--space-24);
}

/* ==================================================
   HERO - TIPOGRAFÍA
   ================================================== */

.hero h1 {
  font: var(--font-weight-medium) var(--text-hero-refined)/1.08
    var(--font-display);
  letter-spacing: -0.035em;
  max-width: 16ch;
  min-width: 0;
  overflow-wrap: break-word;
  text-wrap: balance;
  margin: 0 0 var(--space-6);
  text-shadow: var(--shadow-hero-heading);
}

.hero .lead {
  color: var(--color-text-hero);
  font-size: var(--text-hero-lead);
  max-width: 46ch;
  margin: 0;
  text-wrap: balance;
  text-shadow: var(--shadow-hero-description);
}

/* ==================================================
   HERO - ACCIONES PRINCIPALES
   ================================================== */

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-top: var(--space-8);
}

/* ==================================================
   HERO - SUCURSALES
   ================================================== */

.hero-sucursales {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  list-style: none;
  padding: 0;
  margin: var(--space-6) 0 0;
  color: var(--color-text-hero-meta);
  font-size: var(--text-sm);
  text-shadow: var(--shadow-hero-description);
}

.hero-sucursales li {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.hero-sucursales li + li::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold);
  flex-shrink: 0;
}

.hero-sucursales a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  transition: color var(--duration-fast);
}

.hero-sucursales a:hover,
.hero-sucursales a:focus-visible {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ==================================================
   HERO - VIDEO
   ================================================== */

.hero-video {
  position: absolute;
  inset: 0;
  z-index: var(--z-background);
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 32%;
  pointer-events: none;
}

.hero-controls {
  position: absolute;
  bottom: var(--space-6);
  left: 0;
  right: 0;
  display: flex;
  justify-content: end;
}

.hero-video-toggle {
  border: 1px solid var(--color-border-dark-strong);
  background: var(--color-overlay-video-control);
  color: var(--cream);
  min-height: 44px;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
}

.hero-video-toggle:hover {
  border-color: var(--gold);
}

.hero-video-toggle:active {
  background: var(--color-surface-page);
}

.hero-video-toggle[hidden] {
  display: none;
}

/* ==================================================
   NOSOTROS - COMPOSICIÓN PRINCIPAL
   ================================================== */

.about {
  padding-block: var(--space-section);
  background: var(--cream);
  color: var(--ink);
}

.about-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  align-items: center;
  gap: clamp(32px, 5vw, 80px);
}

/* ==================================================
   NOSOTROS - FOTOGRAFÍA
   ================================================== */

.about .photo-composition {
  min-width: 0;
  margin: 0;
}

.about .photo-composition img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  max-height: 600px;
  object-fit: cover;
  object-position: center;
  filter: none;
}

/* ==================================================
   NOSOTROS - CONTENIDO
   ================================================== */

.about-content {
  min-width: 0;
}

.about-content .eyebrow {
  margin: 0 0 var(--space-4);
}

.about .section-title {
  margin-top: 0;
}

.about-content .section-title {
  max-width: 16ch;
  text-wrap: balance;
}

.about-description {
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  line-height: 1.8;
  max-width: 55ch;
  margin: var(--space-5) 0 0;
}

/* ==================================================
   NOSOTROS - SUCURSALES
   ================================================== */

.about-sucursales {
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--color-border-rule-light);
}

.about-sucursales h3 {
  font-family: var(--font-display);
  font-weight: var(--font-weight-medium);
  font-size: var(--text-feature-title);
  line-height: 1.2;
  margin: 0 0 var(--space-4);
}

.about-sucursales ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-4);
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-6);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

.about-sucursales li {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.about-sucursales li::before {
  content: "";
  width: 5px;
  height: 5px;
  background: var(--color-text-gold-on-light);
  border-radius: 50%;
  flex-shrink: 0;
}

/* ==================================================
   GALERÍA - COMPOSICIÓN PRINCIPAL
   ================================================== */

.gallery {
  padding-block: var(--space-section);
}

.gallery-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) repeat(2, minmax(0, 0.85fr));
  grid-template-rows: 275px 275px;
  gap: var(--space-grid-gallery);
}

.gallery-item {
  position: relative;
  overflow: clip;
  background: var(--color-surface-gallery);
  margin: 0;
  min-width: 0;
}

.gallery-item:first-child {
  grid-row: span 2;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.6);
}

.gallery-item::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    0deg,
    var(--color-overlay-gallery) 0%,
    var(--color-overlay-gallery) 45%,
    transparent 100%
  );
  pointer-events: none;
}

/* ==================================================
   GALERÍA - DESCRIPCIONES
   ================================================== */

.gallery-caption {
  position: absolute;
  z-index: var(--z-caption);
  left: var(--space-6);
  right: var(--space-6);
  bottom: var(--space-6);
}

.gallery-caption strong {
  font: var(--font-weight-medium) var(--text-gallery-title)/1.3
    var(--font-display);
  display: block;
  overflow-wrap: break-word;
  min-width: 0;
}

.gallery-caption span {
  display: block;
  margin-top: var(--space-2);
  color: var(--color-text-on-dark);
  font-size: var(--text-sm);
}

/* ==================================================
   CONTACTO Y RESERVACIONES
   ================================================== */

.booking {
  background: var(--cream);
  color: var(--ink);
  padding-block: var(--space-section);
}

.booking-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-16);
  align-items: start;
}

.booking .section-title {
  margin-top: 0;
}

.contact-list {
  display: grid;
  gap: var(--space-6);
  margin-top: var(--space-8);
}

/* ==================================================
   CONTACTO - SUCURSALES
   ================================================== */

.sucursal-contacto {
  border-top: 1px solid var(--color-border-rule-light);
  padding-top: var(--space-5);
  min-width: 0;
}

.sucursal-contacto h3 {
  margin: 0;
  font: var(--font-weight-medium)
    var(--text-feature-title)/var(--leading-heading) var(--font-display);
  overflow-wrap: break-word;
  min-width: 0;
}

.sucursal-contacto p {
  margin: var(--space-2) 0;
  font-size: var(--text-base);
  line-height: var(--leading-body);
  color: var(--color-text-secondary);
}

.sucursal-foto {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  margin-bottom: var(--space-4);
}

.sucursal-acciones {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-6);
}

.sucursal-acciones a,
.consulta-paquete > a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: var(--color-text-gold-on-light);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ==================================================
   RESERVACIONES - INFORMACIÓN
   ================================================== */

.booking-form {
  min-width: 0;
  border-top: 1px solid var(--color-border-rule-light);
  padding-top: var(--space-6);
}

.booking-form .form-note {
  font-size: var(--text-base);
}

/* ==================================================
   CONSULTA DE PAQUETES
   ================================================== */

.consulta-paquete {
  border-bottom: 1px solid var(--color-border-rule-light);
  padding-bottom: var(--space-6);
  margin-bottom: var(--space-8);
}

.consulta-paquete h3 {
  overflow-wrap: break-word;
  min-width: 0;
}

.consulta-paquete p {
  color: var(--color-text-secondary);
  font-size: var(--text-base);
  line-height: var(--leading-body);
}

.consulta-paquete ul {
  margin: var(--space-4) 0;
  padding-left: var(--space-5);
  line-height: var(--leading-body);
}

.consulta-paquete .consulta-paquete-precio {
  font-size: var(--text-feature-title);
  font-variant-numeric: tabular-nums;
  color: var(--color-text-on-light);
}

.consulta-paquete-precio span {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
}

/* ==================================================
   ANIMACIONES DE APARICIÓN PROGRESIVA
   ================================================== */

.reveal {
  opacity: 1;
  transform: none;
}

.reveal.is-animating {
  animation: reveal-in var(--duration-reveal) var(--ease-reveal) both;
}

@keyframes reveal-in {
  from {
    transform: translateY(16px);
  }

  to {
    transform: translateY(0);
  }
}

/* ==================================================
   RESPONSIVE - TABLET
   Hasta 980px
   ================================================== */

@media (max-width: 980px) {
  .hero-content {
    padding-top: calc(var(--height-header-mobile) + var(--space-16));
  }

  main > section {
    scroll-margin-top: calc(var(--height-header-mobile) + var(--space-4));
  }

  .about-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-8);
  }

  .about .photo-composition img {
    max-height: 500px;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(3, 280px);
  }

  .booking-grid {
    gap: var(--space-8);
  }
}

/* ==================================================
   RESPONSIVE - MÓVIL
   Hasta 730px
   ================================================== */

@media (max-width: 730px) {
  /* Hero */

  .hero {
    min-height: 680px;
  }

  .hero::after {
    background: var(--color-overlay-hero-uniform-mobile);
  }

  .hero h1 {
    font-size: clamp(2.8rem, 9vw, 4rem);
    max-width: 16ch;
  }

  .hero .lead {
    font-size: var(--text-base);
  }

  /* Separación de secciones */

  .about,
  .gallery,
  .booking {
    padding-block: var(--space-section-mobile);
  }

  /* Nosotros */

  .about-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-8);
  }

  .about .photo-composition img {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    max-height: 440px;
  }

  .about-content .section-title {
    max-width: none;
  }

  .about-sucursales .button {
    width: 100%;
  }

  /* Galería */

  .gallery-grid {
    grid-template-rows: repeat(3, 240px);
  }

  /* Reservaciones */

  .booking-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ==================================================
   RESPONSIVE - MÓVILES PEQUEÑOS
   Hasta 480px
   ================================================== */

@media (max-width: 480px) {
  /* Hero */

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero h1 {
    font-size: clamp(2.6rem, 10.5vw, 3.2rem);
  }

  .hero-content {
    padding-top: calc(var(--height-header-mobile) + var(--space-10));
  }

  .hero-sucursales {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
  }

  .hero-sucursales li + li::before {
    display: none;
  }

  /* Nosotros */

  .about .photo-composition img {
    max-height: 365px;
  }

  /* Galería */

  .gallery-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
  }

  .gallery-item,
  .gallery-item:first-child {
    grid-row: auto;
    height: auto;
  }

  .gallery-item img {
    height: 280px;
  }

  .gallery-item::after {
    display: none;
  }

  .gallery-caption {
    position: static;
    padding: var(--space-5);
    background: var(--color-surface-page);
  }
}

/* ==================================================
   RESPONSIVE - PANTALLAS DE POCA ALTURA
   ================================================== */

@media (min-width: 731px) and (max-height: 600px) {
  .hero {
    min-height: 100svh;
  }

  .hero-content {
    padding-block: calc(var(--height-header) + var(--space-5)) var(--space-20);
  }

  .hero h1 {
    font-size: var(--text-hero-compact);
    max-width: 24ch;
    margin-bottom: var(--space-4);
  }

  .hero .lead {
    font-size: var(--text-base);
    line-height: var(--leading-body);
    max-width: 66ch;
  }

  .hero-actions {
    margin-top: var(--space-5);
  }

  .hero-controls {
    bottom: var(--space-3);
  }
}

/* ==================================================
   ACCESIBILIDAD - MOVIMIENTO REDUCIDO
   ================================================== */

@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal.is-animating {
    opacity: 1;
    transform: none;
    animation: none;
    transition: none;
  }

  .hero-sucursales a {
    transition: none;
  }
}
