/* =========================================================
   OLIVERS BARBERSHOP
   Galería interactiva de profesionales
   ========================================================= */

.barberos {
  --altura-escenario: clamp(280px, 34vw, 440px);
  --duracion-carrusel: 620ms;
  --curva-carrusel: cubic-bezier(0.22, 1, 0.36, 1);
  padding-block: var(--space-section);
  background: var(--color-surface-panel);
  color: var(--color-text-on-dark);
}

.barberos [hidden] {
  display: none !important;
}

/* ENCABEZADO */

.barberos-encabezado {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  gap: var(--space-12);
  margin-bottom: var(--space-8);
}

.barberos-encabezado .section-title,
.barberos-encabezado .lead {
  margin: 0;
}

.barberos-encabezado .lead {
  max-width: 45ch;
}

.barberos :is(h2, h3) {
  min-width: 0;
  overflow-wrap: break-word;
  text-wrap: balance;
}

/* FILTRO POR SUCURSAL */

/* =========================================================
   FILTRO VISUAL POR SUCURSAL
   ========================================================= */

.barberos-filtro {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-8);
}

.barberos-selector {
  width: 100%;
  min-width: 0;
}

.barberos-filtro-titulo {
  margin: 0 0 var(--space-4);
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  text-align: center;
}

.barberos-sucursales {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* =========================================================
   BOTONES DE SUCURSALES
   ========================================================= */

.barberos-sucursal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  min-height: 48px;
  padding: var(--space-3) var(--space-6);
  border: 1px solid var(--color-border-dark-strong);
  background: transparent;
  color: var(--color-text-on-dark);
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition:
    background var(--duration-fast) ease,
    color var(--duration-fast) ease,
    border-color var(--duration-fast) ease;
}

.barberos-sucursal-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--color-brand-gold);
}

/* Estado hover */

.barberos-sucursal-btn:hover {
  border-color: var(--color-brand-gold);
  background: rgba(203, 163, 107, 0.08);
}

/* Sucursal seleccionada */

.barberos-sucursal-btn.is-selected {
  background: var(--color-brand-gold);
  border-color: var(--color-brand-gold);
  color: var(--color-text-button-primary);
}

.barberos-sucursal-btn.is-selected svg {
  color: currentColor;
}

.barberos-sucursal-btn.is-selected:hover {
  background: var(--color-brand-gold-light);
}

/* Accesibilidad */

.barberos :is(a, button, select):focus-visible {
  outline: var(--focus-ring-width) solid var(--color-brand-gold);
  outline-offset: var(--focus-ring-offset);
}

/* =========================================================
   FILTRO VISUAL - MÓVIL
   ========================================================= */

@media (max-width: 600px) {
  .barberos-sucursales {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-2);
  }

  .barberos-sucursal-btn {
    width: 100%;
    min-height: 48px;
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-sm);
  }
}

/* CONTENEDOR PRINCIPAL */

.barberos-experiencia {
  position: relative;
}

.barberos-escenario {
  position: relative;
  isolation: isolate;
}

/* Vista alternativa cuando JavaScript no está disponible */

.barberos-lista {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-8);
}

.barbero {
  min-width: 0;
}

.barbero-retrato {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 3 / 2;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  appearance: none;
  font: inherit;
}

.barbero-retrato img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.barbero-iniciales {
  display: grid;
  place-items: center;
  width: 110px;
  aspect-ratio: 1;
  border: 1px solid var(--color-border-gold-hover);
  border-radius: 50%;
  color: var(--color-brand-gold);
  font-family: var(--font-display);
  font-size: 3rem;
}

.barbero-retrato:has(img:not([hidden])) .barbero-iniciales {
  visibility: hidden;
}

/* =========================================================
   ESCENARIO CIRCULAR
   Se activa únicamente cuando JavaScript está disponible
   ========================================================= */

.barberos.is-enhanced .barberos-lista {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  padding-top: calc(var(--altura-escenario) + 68px);
  overflow: hidden;
  isolation: isolate;
  perspective: 1100px;
  touch-action: pan-y;
}

/* Luz ambiental detrás del profesional principal */

.barberos.is-enhanced .barberos-lista::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: min(100%, 850px);
  height: var(--altura-escenario);
  transform: translateX(-50%);
  background: radial-gradient(
    ellipse at 50% 55%,
    rgba(203, 163, 107, 0.16),
    rgba(203, 163, 107, 0.04) 45%,
    transparent 72%
  );
  pointer-events: none;
  z-index: 0;
}

/* Base del escenario */

.barberos.is-enhanced .barberos-lista::after {
  content: "";
  position: absolute;
  top: calc(var(--altura-escenario) - 24px);
  left: 50%;
  width: 88%;
  height: 38px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.5), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.barberos.is-enhanced .barbero {
  display: contents;
}

/* Posición y perspectiva de cada retrato */

.barberos.is-enhanced .barbero-retrato {
  position: absolute;
  top: 0;
  left: 50%;
  width: min(52%, 540px);
  height: var(--altura-escenario);
  aspect-ratio: auto;
  z-index: var(--orden, 1);
  transform: translateX(-50%) translateX(var(--desplazamiento, 0px))
    scale(var(--escala, 1)) rotateY(var(--rotacion, 0deg));
  transform-origin: center bottom;
  opacity: var(--visibilidad, 1);
  cursor: pointer;
  transition:
    transform var(--duracion-carrusel) var(--curva-carrusel),
    opacity 350ms ease,
    filter 350ms ease;
}

/* Tratamiento de los profesionales secundarios */

.barberos.is-enhanced .barbero:not(.is-active) .barbero-retrato {
  filter: brightness(0.65) saturate(0.72);
}

/* Profesional seleccionado */

.barberos.is-enhanced .barbero.is-active .barbero-retrato {
  filter: brightness(1.06) saturate(1)
    drop-shadow(0 12px 25px rgba(0, 0, 0, 0.3));
}

/* Retratos fuera del área visible */

.barberos.is-enhanced .barbero.is-offstage .barbero-retrato {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

@media (hover: hover) {
  .barberos.is-enhanced .barbero:not(.is-active) .barbero-retrato:hover {
    filter: brightness(0.9) saturate(1);
  }
}

/* =========================================================
   INFORMACIÓN DEL BARBERO
   ========================================================= */

.barbero-informacion {
  min-width: 0;
  padding-top: var(--space-6);
}

.barberos.is-enhanced .barbero-informacion {
  position: relative;
  z-index: 10;
  width: min(100%, 700px);
  margin-inline: auto;
  padding: var(--space-6) var(--space-4);
  text-align: center;
  animation: barbero-informacion-entrada 380ms var(--curva-carrusel) both;
}

.barbero-etiqueta {
  margin: 0 0 var(--space-3);
  color: var(--color-brand-gold);
  font-size: var(--text-label);
  font-weight: var(--font-weight-medium);
  text-transform: uppercase;
  letter-spacing: 0.22em;
}

.barbero h3 {
  margin: 0 0 var(--space-2);
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 3.5rem);
  font-weight: var(--font-weight-medium);
  line-height: 1.1;
}

.barbero-sucursal {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  line-height: var(--leading-body);
}

.barbero-reputacion {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
  margin: var(--space-4) 0 0;
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
}

.barberos.is-enhanced .barbero-reputacion {
  justify-content: center;
}

.barbero-reputacion small {
  flex-basis: 100%;
  font-size: inherit;
}

.barbero-calificacion {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text-on-dark);
}

.barbero-calificacion .icono-tijeras {
  width: 18px;
  height: 18px;
  color: var(--color-brand-gold);
}

/* ESPECIALIDADES */

.barbero-especialidades {
  margin-top: var(--space-6);
}

.barbero-especialidades h4 {
  margin: 0 0 var(--space-3);
  color: var(--color-text-secondary);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-regular);
}

.barbero-especialidades ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  max-width: 620px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.barberos.is-enhanced .barbero-especialidades ul {
  justify-content: center;
}

.barbero-especialidades li {
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--color-border-dark);
  color: var(--color-brand-ivory);
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}

/* RESERVACIONES Y PERFIL */

.barbero-acciones {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-top: var(--space-6);
}

.barberos.is-enhanced .barbero-acciones {
  justify-content: center;
}

.barbero-reservar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--height-button);
  padding: var(--space-3) var(--space-8);
  background: var(--color-brand-gold);
  color: var(--color-text-button-primary);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
  transition: background var(--duration-fast) ease;
}

.barbero-reservar:hover {
  background: var(--color-brand-gold-light);
  color: var(--color-text-button-primary);
}

.barbero-perfil {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--color-brand-gold-light);
  font-size: var(--text-sm);
  text-decoration: underline;
  text-underline-offset: 5px;
}

.barbero-perfil:hover {
  color: var(--color-text-on-dark);
}

/* =========================================================
   CONTROLES DEL CARRUSEL
   ========================================================= */

.barberos-controles {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-5);
  position: absolute;
  top: calc(var(--altura-escenario) + 12px);
  left: 0;
  width: 100%;
  z-index: 20;
}

.barberos-navegar {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid var(--color-border-gold-hover);
  border-radius: 50%;
  background: var(--color-surface-page);
  color: var(--color-brand-gold-light);
  cursor: pointer;
  transition:
    background var(--duration-fast) ease,
    color var(--duration-fast) ease;
}

.barberos-navegar svg {
  width: 23px;
  height: 23px;
}

.barberos-navegar:hover {
  background: var(--color-brand-gold);
  color: var(--color-text-button-primary);
}

.barberos-navegar:disabled {
  opacity: var(--opacity-disabled);
  cursor: not-allowed;
}

.barberos-contador {
  min-width: 65px;
  color: var(--color-brand-gold);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.12em;
  text-align: center;
}

/* TEXTOS AUXILIARES */

.barberos-escala,
.barberos-demo-aviso {
  margin: var(--space-6) 0 0;
  color: var(--color-text-secondary);
  font-size: var(--text-xs);
  text-align: center;
  line-height: var(--leading-body);
}

.barberos-demo-aviso {
  margin: 0 0 var(--space-4);
  color: var(--color-brand-gold-light);
}

.barberos-estado {
  max-width: 65ch;
  margin: var(--space-6) auto;
  color: var(--color-text-secondary);
  text-align: center;
  line-height: var(--leading-body);
}

.barberos-estado a {
  color: var(--color-brand-gold-light);
  text-decoration: underline;
}

/* ANIMACIÓN DE LA INFORMACIÓN */

@keyframes barbero-informacion-entrada {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =========================================================
   TABLETS
   ========================================================= */

@media (max-width: 850px) {
  .barberos {
    --altura-escenario: clamp(260px, 47vw, 390px);
    padding-block: var(--space-section-mobile);
  }

  .barberos-encabezado {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-4);
  }

  .barberos-lista {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .barberos.is-enhanced .barbero-retrato {
    width: min(66%, 480px);
  }
}

/* =========================================================
   TELÉFONOS
   ========================================================= */

@media (max-width: 600px) {
  .barberos {
    --altura-escenario: clamp(230px, 70vw, 340px);
  }

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

  .barberos.is-enhanced .barbero-retrato {
    width: 88%;
  }

  .barbero h3 {
    font-size: clamp(1.8rem, 8vw, 2.5rem);
  }

  .barbero-informacion {
    padding-inline: 0;
  }

  .barberos.is-enhanced .barbero-acciones {
    flex-direction: column;
    gap: var(--space-2);
  }

  .barbero-reservar {
    width: min(100%, 320px);
  }

  .barbero-iniciales {
    width: 100px;
    font-size: 2.5rem;
  }
}

/* ACCESIBILIDAD: MOVIMIENTO REDUCIDO */

@media (prefers-reduced-motion: reduce) {
  .barberos *,
  .barberos *::before,
  .barberos *::after {
    animation: none !important;
    transition: none !important;
  }
}
