/* ============================================
   GALERÍA SELECTOR — Explora Miami
   Acordeón horizontal de paneles fotográficos
   Desktop: expand horizontal · Móvil: expand vertical
   Fondo: --blanco-arena  #FFFDF7
   ============================================ */

/* ── Override sección (sobre destino.css y radial-gallery.css) ── */
.destino-galeria {
  padding: 0;
  background: var(--blanco-arena, #FFFDF7);
  overflow: visible;
}

/* ── Contenedor principal ── */
.selector-gallery {
  width: 100%;
  background: var(--blanco-arena, #FFFDF7);
  padding: 4.5rem 0 4rem;
}

/* ── Header ── */
.selector-gallery__header {
  padding: 0 1.5rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}
.selector-gallery__header h2 {
  font-family: var(--serif, 'Playfair Display', Georgia, serif);
  font-style: italic;
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  color: var(--tinta, #1a2a35);
  margin: 0;
  line-height: 1.2;
}

/* ── Track: flex row de paneles ── */
.sg-track {
  display: flex;
  width: 100%;
  max-width: 1200px;
  height: 440px;
  margin: 0 auto;
  padding: 0 1.5rem;
  align-items: stretch;
  gap: 3px;
}

/* ── Panel individual ── */
.sg-option {
  position: relative;
  flex: 1 1 0%;
  overflow: hidden;
  cursor: pointer;
  background-color: var(--tinta, #1a2a35);
  border: 2px solid transparent;
  border-radius: 6px;
  /* Transición de expansión */
  transition:
    flex          0.70s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow    0.50s ease,
    border-color  0.30s ease;
  will-change: flex-grow;
  box-shadow: 0 4px 18px rgba(0,0,0,0.16);
  /* Estado inicial para entrada animada */
  opacity: 0;
  transform: translateX(-60px);
}

/* Panel activo */
.sg-option.is-active {
  flex: 7 1 0%;
  border-color: rgba(255, 255, 255, 0.60);
  box-shadow: 0 16px 52px rgba(0,0,0,0.36);
  z-index: 5;
}

/* ── Imagen del panel ── */
.sg-option__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
  transition: transform 0.70s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}
/* Inactivo: ligero zoom in para dar profundidad */
.sg-option:not(.is-active) .sg-option__img {
  transform: scale(1.10);
}
/* Activo: zoom normal */
.sg-option.is-active .sg-option__img {
  transform: scale(1.00);
}

/* ── Sombra de degradado (legibilidad del texto) ── */
.sg-option__shadow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.75)  0%,
    rgba(0, 0, 0, 0.22)  45%,
    transparent          72%
  );
  opacity: 0.20;
  transition: opacity 0.50s ease;
  z-index: 1;
}
.sg-option.is-active .sg-option__shadow {
  opacity: 1;
}

/* ── Botón zoom (ver foto completa) ── */
.sg-option__zoom {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(7, 30, 43, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.72);
  transition:
    opacity   0.35s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    background 0.2s ease;
  z-index: 6;
  padding: 0;
  pointer-events: auto;
}
.sg-option.is-active .sg-option__zoom {
  opacity: 1;
  transform: scale(1);
}
.sg-option__zoom:hover {
  background: rgba(0, 188, 212, 0.88);
  border-color: rgba(0, 188, 212, 0.50);
}
.sg-option__zoom:focus-visible {
  outline: 2px solid var(--turquesa, #00BCD4);
  outline-offset: 2px;
}

/* ── Etiqueta: icono + texto ── */
.sg-option__label {
  position: absolute;
  bottom: 1.2rem;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0 1.1rem;
  pointer-events: none;
  z-index: 3;
}

/* Círculo de icono (frosted glass) */
.sg-option__icon {
  min-width: 44px;
  max-width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(7, 30, 43, 0.80);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 2px solid rgba(255, 255, 255, 0.20);
  font-size: 1.15rem;
  flex-shrink: 0;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.28);
  line-height: 1;
}

/* Texto */
.sg-option__info {
  overflow: hidden;
}
.sg-option__title {
  font-family: var(--sans, 'Inter', system-ui, sans-serif);
  font-size: 0.98rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transform: translateX(28px);
  transition:
    opacity   0.50s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.50s cubic-bezier(0.4, 0, 0.2, 1);
}
.sg-option.is-active .sg-option__title {
  opacity: 1;
  transform: translateX(0);
}

/* ── Foco accesible en el panel ── */
.sg-option:focus-visible {
  outline: 3px solid var(--turquesa, #00BCD4);
  outline-offset: -3px;
  z-index: 10;
}

/* ── Animación de entrada (stagger via JS) ── */
@keyframes sg-slide-in {
  from { opacity: 0; transform: translateX(-60px); }
  to   { opacity: 1; transform: translateX(0);     }
}
.sg-option.sg-entered {
  animation: sg-slide-in 0.65s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* ──────────────────────────────────────────
   MÓVIL — acordeón vertical
   ────────────────────────────────────────── */
@media (max-width: 767px) {
  .selector-gallery {
    padding: 3rem 0 2.5rem;
  }
  .selector-gallery__header {
    padding: 0 1.25rem 1.5rem;
  }
  .sg-track {
    flex-direction: column;
    height: auto;
    padding: 0;
    gap: 2px;
    max-width: 100%;
  }
  /* En columna, flex-grow no controla la altura — usamos height explícita */
  .sg-option {
    width: 100%;
    height: 68px;
    flex: none !important;
    border-radius: 0;
    border-left: none;
    border-right: none;
    transition:
      height       0.60s cubic-bezier(0.4, 0, 0.2, 1),
      box-shadow   0.40s ease,
      border-color 0.30s ease;
  }
  .sg-option.is-active {
    height: 260px;
    flex: none !important;
  }
  .sg-option__shadow {
    opacity: 0.55; /* siempre visible en móvil para legibilidad */
  }
  .sg-option.is-active .sg-option__shadow {
    opacity: 1;
  }
  .sg-option__zoom {
    top: 0.6rem;
    right: 0.6rem;
    width: 30px;
    height: 30px;
  }
  .sg-option__label {
    bottom: 0.9rem;
  }
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  .sg-option,
  .sg-option__img,
  .sg-option__title,
  .sg-option__shadow,
  .sg-option__zoom {
    transition: none !important;
    animation: none !important;
  }
  .sg-option {
    opacity: 1 !important;
    transform: none !important;
  }
  .sg-option__title {
    opacity: 1 !important;
    transform: none !important;
  }
}
