/**
 * Coastal SPA — header + ticker fijos, loader fluido en el mount.
 */
body.coastal-spa-shell {
  --coastal-spa-loader-min: 260ms;
  --coastal-spa-chrome: 140px;
  --cp-promo-bar: #d90429;
  --cp-font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --cp-surface: #fafbfc;
}

body.coastal-spa-shell .main-content {
  background: var(--cp-surface) !important;
}

body.coastal-spa-busy .coastal-spa-ticker,
body.coastal-spa-busy .app-header-itunes {
  pointer-events: none;
}

/* La barra promocional no debe reiniciarse ni ocultarse durante la navegación SPA */
body.coastal-spa-busy .home-promo-ticker-track {
  animation-play-state: running !important;
}

.coastal-spa-ticker,
body.coastal-spa-shell .home-promo-ticker {
  z-index: 90;
}

body.coastal-spa-shell .app-header-itunes {
  position: sticky;
  top: 0;
  z-index: 100;
}

.coastal-spa-mount {
  position: relative;
  min-height: calc(100dvh - var(--coastal-spa-chrome));
  transition: opacity 0.28s ease;
}

.coastal-spa-mount--route-busy {
  min-height: calc(100dvh - var(--coastal-spa-chrome));
}

.coastal-spa-mount--route-busy .coastal-spa-mount__content {
  position: absolute;
  inset: 0;
  width: 100%;
  visibility: hidden;
  pointer-events: none;
}

.coastal-spa-route-overlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cp-surface, #fafbfc);
}

.coastal-spa-route-overlay[hidden] {
  display: none !important;
}

.coastal-spa-route-overlay__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 0;
}

.coastal-spa-route-overlay__label {
  display: none !important;
}

.coastal-spa-mount--home-forming .home-coastal-pulse,
.coastal-spa-mount--home-forming .home-page,
.home-coastal-pulse--pending > .coastal-site-shell {
  visibility: hidden;
}

.coastal-spa-home-forming--static {
  position: relative;
  z-index: 25;
  min-height: 42vh;
  background: var(--cp-surface, #fafbfc);
}

.coastal-spa-home-forming {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42vh;
  padding: 2rem 1rem 3rem;
  background: var(--cp-surface, #fafbfc);
}

.coastal-spa-home-forming__loader {
  flex-direction: column;
  gap: 0.85rem;
  min-height: auto;
  padding: 0;
}

.coastal-spa-home-forming__label {
  font-family: var(--cp-font, 'Plus Jakarta Sans', sans-serif);
  font-size: 0.9375rem;
  font-weight: 600;
  color: #64748b;
  letter-spacing: 0.01em;
}

body.coastal-spa-home-busy {
  overflow: hidden;
}

.coastal-spa-mount--loading {
  opacity: 1;
}

.coastal-spa-mount--ready {
  animation: coastal-spa-fade-in 0.32s ease;
}

body.coastal-spa-shell:not(.page-home) .home-coastal-fab-map,
body.coastal-spa-shell:not(.page-home) .home-coastal-fab-stack,
body.coastal-spa-shell:not(.page-home) .home-chat {
  display: none !important;
}

/* En el mapa no mostramos la barra promocional en movimiento */
body.page-mapa .coastal-spa-ticker,
body.page-mapa .home-promo-ticker,
body.mapa-page-body .home-promo-ticker,
body.coastal-spa-shell.page-mapa .home-promo-ticker {
  display: none !important;
}

@keyframes coastal-spa-fade-in {
  from {
    opacity: 0.35;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.coastal-spa-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 0;
}

.coastal-spa-loader__ring {
  width: 2.25rem;
  height: 2.25rem;
  border: 3px solid rgba(11, 28, 48, 0.1);
  border-top-color: #d90429;
  border-radius: 50%;
  animation: coastal-spa-spin 0.7s linear infinite;
}

@keyframes coastal-spa-spin {
  to {
    transform: rotate(360deg);
  }
}
