/* ==========================================================================
   SOLUCIONES HOSPITALARIAS — PRODUCT DISCOVERY & PRODUCT EXPERIENCE
   Versión: 2.0 (Cinematic Constellation Engine & Ambient Product Experience)
   Inspiración: Composición cinematográfica viva, asimetría y profundidad óptica
   ========================================================================== */

/* --------------------------------------------------------------------------
   01. DISCOVERY SECTION WRAPPER & ATMÓSFERA CELESTIAL
   -------------------------------------------------------------------------- */
.discovery-section {
  position: relative;
  width: 100%;
  min-height: auto;
  padding: clamp(2.5rem, 4vh, 4rem) 0 clamp(2.5rem, 4vh, 4rem);
  /* Transición fluida limpia sin cielo ruidoso */
  background: #FAFAFA;
  overflow: hidden;
  z-index: var(--z-base);
  box-sizing: border-box;
}

/* Velo de Niebla Atmosférica Superior (Fundido suave con el Hero) */
.discovery-top-mist {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 140px;
  background: linear-gradient(180deg, rgba(235, 245, 255, 0.9) 0%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
  z-index: 1;
}

/* Resplandor Celestial de Fondo */
.discovery-sky-glow {
  position: absolute;
  top: 15%;
  left: 50%;
  transform: translateX(-50%);
  width: min(1000px, 90vw);
  height: 500px;
  background: radial-gradient(ellipse at center, rgba(56, 182, 255, 0.16) 0%, rgba(0, 74, 173, 0.04) 50%, transparent 75%);
  filter: blur(50px);
  pointer-events: none;
  z-index: 0;
}

/* --------------------------------------------------------------------------
   02. TEATRO ESPACIAL DE DESCUBRIMIENTO
   -------------------------------------------------------------------------- */
.discovery-theatre {
  position: relative;
  width: 100%;
  max-width: var(--container-max-w);
  margin: 0 auto;
  padding: 0 var(--space-4);
  box-sizing: border-box;
  z-index: 2;
}

/* Centro Narrativo / Encabezado Flotante */
.discovery-narrative-core {
  position: relative;
  text-align: center;
  max-width: min(92vw, 760px);
  margin: 0 auto clamp(1.5rem, 3vh, 2.5rem);
  z-index: 5;
  transition: opacity 0.65s var(--ease-natural), transform 0.65s var(--ease-natural);
}

.discovery-narrative-core.is-dimmed {
  opacity: 0;
  transform: translateY(-16px) scale(0.97);
  pointer-events: none;
}

.discovery-pill-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.35rem 1.1rem;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 74, 173, 0.12);
  border-radius: var(--radius-pill);
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--letter-spacing-tag);
  text-transform: uppercase;
  color: var(--color-brand-blue);
  box-shadow: 0 4px 14px rgba(0, 74, 173, 0.06);
  margin-bottom: var(--space-3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.tag-sparkle {
  color: var(--color-brand-cyan);
  font-size: 0.9rem;
}

.discovery-title {
  font-family: var(--font-ui);
  font-size: clamp(2rem, 3.8vw, 3.2rem);
  font-weight: var(--font-weight-bold);
  line-height: 1.14;
  letter-spacing: -0.02em;
  color: var(--color-brand-blue-deep);
  margin-bottom: var(--space-3);
  text-wrap: balance;
}

.discovery-subtitle {
  font-family: var(--font-ui);
  font-size: var(--text-base);
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
  max-width: 600px;
  margin: 0 auto;
}

/* --------------------------------------------------------------------------
   03. CANVAS ESPACIAL DE COMPOSICIÓN CINEMÁTICA (LIVING CONSTELLATION)
   -------------------------------------------------------------------------- */
.catalog-carousel-wrapper {
  position: relative;
  width: 100vw;
  margin-left: 50%;
  transform: translateX(-50%);
  overflow: hidden;
  padding: var(--space-4) 0;
  cursor: grab;
}

.catalog-carousel-wrapper:active {
  cursor: grabbing;
}

.catalog-carousel-track {
  display: flex;
  gap: var(--space-4);
  padding: 0 var(--space-4);
  width: max-content;
  animation: scroll-carousel 40s linear infinite;
}

.catalog-carousel-wrapper:hover .catalog-carousel-track {
  animation-play-state: paused;
}

@keyframes scroll-carousel {
  0% { transform: translateX(0); }
  100% { transform: translateX(calc(-50% - (var(--space-4) / 2))); }
}

/* Tarjeta de Catálogo */
.catalog-card {
  position: relative;
  flex: 0 0 clamp(280px, 24vw, 340px);
  background: #FFFFFF;
  border: 1px solid rgba(0, 74, 173, 0.1);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px rgba(0, 45, 110, 0.06);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.4s var(--ease-natural), box-shadow 0.4s var(--ease-natural), border-color 0.4s var(--ease-natural);
}

.catalog-card:hover {
  transform: translateY(-8px);
  border-color: rgba(0, 74, 173, 0.3);
  box-shadow: 0 20px 40px rgba(0, 45, 110, 0.14);
}

.catalog-card-image-wrap {
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--surface-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.catalog-card-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 12px 24px rgba(0, 45, 110, 0.1));
}

.catalog-card-content {
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.catalog-card-title {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--color-brand-blue-deep);
  margin-bottom: var(--space-1);
}

.catalog-card-modality {
  font-family: var(--font-ui);
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Modificadores cuando hay un producto en foco (Experiencia) */
.catalog-carousel-wrapper.is-dimmed {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(20px);
  transition: opacity 0.6s var(--ease-natural), transform 0.6s var(--ease-natural);
}

/* --------------------------------------------------------------------------
   04. PRODUCT EXPERIENCE STAGE (ESCENARIO FOCAL DE DETALLES & CONVERSIÓN)
   -------------------------------------------------------------------------- */
.product-experience-stage {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s var(--ease-natural), visibility 0.4s var(--ease-natural);
  z-index: 45;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.product-experience-stage.is-active {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
}

.discovery-theatre.is-experience-mode {
  min-height: clamp(520px, 70vh, 720px);
}

.focal-experience-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--space-2) 0;
  box-sizing: border-box;
}

/* Barra Superior de Navegación & Retorno */
.focal-top-nav {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  margin-bottom: var(--space-4);
  animation: fadeInDown 0.5s var(--ease-natural) forwards;
  z-index: 60;
}

.btn-back-explore {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.6rem 1.3rem;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(0, 74, 173, 0.16);
  border-radius: var(--radius-pill);
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--letter-spacing-wide);
  color: var(--color-brand-blue-deep);
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0, 74, 173, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.25s var(--ease-natural);
}

.btn-back-explore:hover {
  background: var(--color-brand-blue);
  color: var(--color-pure-white);
  border-color: var(--color-brand-blue);
  box-shadow: 0 6px 22px rgba(0, 74, 173, 0.22);
  transform: translateX(-3px);
}

.back-icon {
  width: 16px;
  height: 16px;
  transition: transform 0.25s var(--ease-natural);
}

.btn-back-explore:hover .back-icon {
  transform: translateX(-3px);
}

/* Constelación Contextual de 3 Columnas (Narrativa + Imagen Hero + Especificaciones) */
.focal-info-constellation {
  display: grid;
  grid-template-columns: 1fr 1.15fr 1fr;
  gap: clamp(1.2rem, 2.5vw, 2rem);
  width: 100%;
  max-width: 1200px;
  margin: auto auto;
  align-items: center;
  pointer-events: auto;
  z-index: 55;
}

@media (max-width: 992px) {
  .focal-info-constellation {
    grid-template-columns: 1fr;
    max-width: 520px;
  }
}

/* Tarjetas Flotantes Glassmórficas */
.focal-card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(0, 74, 173, 0.1);
  border-radius: var(--radius-xl);
  padding: clamp(1.4rem, 2.5vw, 2rem);
  box-shadow: var(--shadow-floating);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-sizing: border-box;
}

/* Tarjeta Izquierda: Narrativa Editorial */
.focal-narrative-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  animation: fadeInLeft 0.6s var(--ease-natural) forwards;
}

.focal-badge-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.focal-modality-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.85rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--letter-spacing-wide);
  background: var(--color-brand-cyan-soft);
  color: var(--color-brand-blue-dark);
  border: 1px solid rgba(56, 182, 255, 0.3);
}

.focal-modality-badge.sale-only {
  background: #FEF3C7;
  color: #92400E;
  border-color: #FCD34D;
}

.focal-category-badge {
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-tertiary);
}

.focal-title {
  font-family: var(--font-ui);
  font-size: clamp(1.5rem, 2.4vw, 2.1rem);
  font-weight: var(--font-weight-bold);
  color: var(--color-brand-blue-deep);
  line-height: 1.18;
  letter-spacing: -0.01em;
}

.focal-desc {
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
}

/* Tarjeta Central: Imagen Focal del Producto */
.focal-image-card {
  background: rgba(255, 255, 255, 0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(1.5rem, 3vw, 2.5rem);
  animation: zoomInSoft 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.focal-image-box {
  position: relative;
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.focal-hero-img {
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  filter: drop-shadow(0 18px 36px rgba(0, 45, 110, 0.2));
  transition: transform 0.4s var(--ease-natural);
}

.focal-hero-img:hover {
  transform: scale(1.05) translateY(-4px);
}

.focal-img-shadow {
  width: 75%;
  height: 14px;
  border-radius: var(--radius-circle);
  background: radial-gradient(ellipse at center, rgba(0, 74, 173, 0.22) 0%, transparent 75%);
  filter: blur(8px);
  margin-top: -6px;
}

@keyframes zoomInSoft {
  0% { opacity: 0; transform: scale(0.88); }
  100% { opacity: 1; transform: scale(1); }
}

/* Tarjeta Derecha: Especificaciones & CTA */
.focal-action-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  animation: fadeInRight 0.6s var(--ease-natural) forwards;
}

.focal-specs-tag {
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-bold);
  letter-spacing: var(--letter-spacing-tag);
  text-transform: uppercase;
  color: var(--color-brand-blue);
}

/* Nube de Chips de Características */
.focal-chips-cloud {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.focal-feature-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.55rem 0.95rem;
  background: rgba(248, 251, 255, 0.85);
  border: 1px solid rgba(0, 74, 173, 0.08);
  border-radius: var(--radius-md);
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  color: var(--color-text-primary);
  line-height: 1.35;
  box-shadow: 0 2px 6px rgba(0, 74, 173, 0.03);
  animation: chipIn 0.5s var(--ease-natural) forwards;
  animation-delay: var(--chip-delay, 0s);
  opacity: 0;
}

.chip-check-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--color-brand-cyan);
}

/* Bloque CTA WhatsApp */
.focal-cta-cluster {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.btn-focal-whatsapp {
  width: 100%;
  padding: 0.95rem 1.5rem;
  font-size: var(--text-sm);
  justify-content: center;
}

.focal-cta-note {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  color: var(--color-text-tertiary);
  text-align: center;
}

/* --------------------------------------------------------------------------
   05. ANIMACIONES KEYFRAMES
   -------------------------------------------------------------------------- */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes chipIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --------------------------------------------------------------------------
   06. RESPONSIVE & ADAPTACIÓN MOBILE ESPECÍFICA
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
  .discovery-spatial-canvas {
    height: 520px;
  }

  .focal-info-constellation {
    margin-left: 0;
    max-width: 100%;
  }

  .focal-card {
    padding: 1.4rem;
  }
}

@media (max-width: 768px) {
  .discovery-section {
    min-height: auto;
    padding: 2.5rem 0 4rem;
  }

  .discovery-title {
    font-size: 2.15rem;
  }

  .discovery-subtitle {
    font-size: var(--text-sm);
  }

  .discovery-spatial-canvas {
    height: 400px;
  }

  .discovery-theatre.is-experience-mode {
    min-height: auto;
  }

  .discovery-theatre.is-experience-mode .discovery-spatial-canvas {
    height: 250px;
  }

  .discovery-theatre.is-experience-mode .product-experience-stage {
    position: relative;
    inset: auto;
    margin-top: -250px;
    height: auto;
  }

  .floating-product-piece {
    width: 190px;
    margin-top: -95px;
    margin-left: -95px;
  }

  .focal-experience-wrapper {
    height: auto;
    min-height: auto;
  }

  .focal-top-nav {
    margin-bottom: 210px;
  }

  .focal-info-constellation {
    margin-top: 0;
    gap: var(--space-3);
  }

  .btn-back-explore {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
  }

  .focal-title {
    font-size: 1.65rem;
  }

  .focal-card {
    padding: 1.15rem;
    border-radius: var(--radius-lg);
  }
}

@media (max-width: 480px) {
  .discovery-spatial-canvas {
    height: 360px;
  }

  .discovery-theatre.is-experience-mode .discovery-spatial-canvas {
    height: 220px;
  }

  .discovery-theatre.is-experience-mode .product-experience-stage {
    margin-top: -220px;
  }

  .focal-top-nav {
    margin-bottom: 180px;
  }

  .floating-product-piece {
    width: 165px;
    margin-top: -82px;
    margin-left: -82px;
  }
}

/* --------------------------------------------------------------------------
   07. ACCESIBILIDAD — PREFERS REDUCED MOTION
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .floating-product-piece {
    transition: transform 0.2s ease, opacity 0.2s ease !important;
    will-change: auto;
  }

  .product-piece-halo,
  .product-cloud-contact-shadow,
  .product-floating-tag,
  .focal-narrative-card,
  .focal-action-card,
  .focal-feature-chip,
  .focal-top-nav {
    animation: none !important;
    transition: opacity 0.2s ease !important;
  }
}
