/* ==========================================================================
   Juglaría V2 — Estilos personalizados adicionales
   (Tailwind cubre utilidades; aquí solo lo que Tailwind no puede: animaciones,
   el carrusel, el sticky header y el marquee)
   ========================================================================== */

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
}

h1, h2, h3, h4, .font-display {
  font-family: 'Poppins', sans-serif;
}

/* ---------- Header sticky ---------- */
#site-header {
  transition: box-shadow .3s ease, padding .3s ease;
}

#site-header.is-scrolled {
  box-shadow: 0 8px 24px -8px rgba(91, 30, 140, 0.25);
}

#site-logo {
  max-height: 50px;
  width: auto;
  height: 100%;
  object-fit: contain;
  transition: max-height .3s ease;
}

#site-header.is-scrolled #site-logo {
  max-height: 38px;
}

/* ---------- Hero carousel ---------- */
.carousel-slide {
  opacity: 0;
  position: absolute;
  inset: 0;
  transition: opacity 1.2s ease-in-out;
}

.carousel-slide.active {
  opacity: 1;
  position: relative;
}

.carousel-dot {
  width: 12px;
  height: 12px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.5);
  transition: background .3s ease, transform .3s ease;
}

.carousel-dot.active {
  background: #ffffff;
  transform: scale(1.2);
}

/* ---------- Marquee decorativo ---------- */
.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 22s linear infinite;
}

@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ---------- Botón flotante de WhatsApp ---------- */
.whatsapp-pulse {
  box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
  animation: pulseGreen 2s infinite;
}

@keyframes pulseGreen {
  0%   { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.6); }
  70%  { box-shadow: 0 0 0 14px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

/* ---------- Tarjetas de servicio ---------- */
.service-card {
  transition: transform .35s ease, box-shadow .35s ease;
}

.service-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px -12px rgba(91, 30, 140, 0.25);
}

/* ---------- Animación de aparición al hacer scroll ---------- */
.fade-in-observe {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s ease, transform .7s ease;
}

.fade-in-observe.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Scrollbar de marca ---------- */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #FFF8E8; }
::-webkit-scrollbar-thumb { background: #5B1E8C; border-radius: 10px; }

/* ---------- Reproductores de audio (servicios + header) ---------- */
.audio-progress {
  -webkit-appearance: none;
  appearance: none;
  background: #E4CFF4;
  border-radius: 9999px;
  outline: none;
}

.audio-progress::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 9999px;
  background: #5B1E8C;
  cursor: pointer;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px #5B1E8C;
}

.audio-progress::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border-radius: 9999px;
  background: #5B1E8C;
  cursor: pointer;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px #5B1E8C;
}

.audio-progress::-moz-range-track {
  background: #E4CFF4;
  border-radius: 9999px;
  height: 6px;
}

#header-audio-player button svg {
  pointer-events: none;
}

/* ---------- Skeleton mientras carga el JSON ---------- */
.skeleton {
  background: linear-gradient(90deg, #F4EBFB 25%, #E4CFF4 37%, #F4EBFB 63%);
  background-size: 400% 100%;
  animation: skeletonLoading 1.4s ease infinite;
  border-radius: 1rem;
}

@keyframes skeletonLoading {
  0%   { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}


/* ---------- Tarjetas de precios ---------- */
.pricing-card {
  transition: transform .35s ease, box-shadow .35s ease, border-color .35s ease;
}

.pricing-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 24px 48px -18px rgba(91, 30, 140, 0.32);
}

.pricing-card-featured {
  border: 2px solid #F7B733;
  box-shadow: 0 22px 45px -18px rgba(91, 30, 140, 0.32);
}

@media (min-width: 768px) {
  .pricing-card-featured {
    transform: translateY(-10px);
  }

  .pricing-card-featured:hover {
    transform: translateY(-16px);
  }
}

/* ---------- Privacidad y licencia ---------- */
.legal-card {
  scroll-margin-top: 96px;
}

.legal-card p,
.legal-card li {
  overflow-wrap: anywhere;
}

/* ---------- Reproductor principal del header: botón musical responsive ---------- */
.header-music-player {
  display: flex;
  align-items: center;
  gap: .7rem;
  flex-shrink: 0;
}

#header-audio-toggle {
  position: relative;
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 48px;
  border: 0;
  border-radius: 9999px;
  padding: 0;
  cursor: pointer;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
  transition: transform .2s ease, filter .2s ease;
}

#header-audio-toggle:hover { transform: scale(1.07); }
#header-audio-toggle:active { transform: scale(.94); }
#header-audio-toggle:focus-visible {
  outline: 3px solid rgba(247, 183, 51, .55);
  outline-offset: 4px;
}

.music-ring {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: conic-gradient(#5B1E8C 0 33%, #F7B733 33% 66%, #9A4FCB 66% 100%);
  box-shadow: 0 4px 16px rgba(91, 30, 140, .28), 0 0 0 3px rgba(247, 183, 51, .10);
  animation: musicInviteRing 4.5s linear infinite;
}

.music-button-core {
  position: relative;
  z-index: 1;
  width: 38px;
  height: 38px;
  border-radius: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: #5B1E8C;
  box-shadow: inset 0 0 0 1px rgba(91, 30, 140, .08);
}

.music-note {
  width: 21px;
  height: 21px;
  transform-origin: 50% 55%;
  filter: drop-shadow(0 1px 1px rgba(91, 30, 140, .18));
}

/* En reposo el aro sigue llamando la atención; la nota permanece tranquila. */
#header-audio-toggle:not(.is-playing) .music-button-core {
  animation: musicInvitePulse 2.1s ease-in-out infinite;
}

/* Mientras suena, la nota "baila" y el aro gana ritmo. */
#header-audio-toggle.is-playing .music-ring {
  animation-duration: 1.8s;
}

#header-audio-toggle.is-playing .music-note {
  animation: musicNoteDance .72s ease-in-out infinite alternate;
}

@keyframes musicInviteRing {
  to { transform: rotate(360deg); }
}

@keyframes musicInvitePulse {
  0%, 100% { box-shadow: inset 0 0 0 1px rgba(91, 30, 140, .08), 0 0 0 0 rgba(247, 183, 51, .24); }
  50% { box-shadow: inset 0 0 0 1px rgba(91, 30, 140, .08), 0 0 0 7px rgba(247, 183, 51, 0); }
}

@keyframes musicNoteDance {
  0% { transform: translateY(1px) rotate(-9deg) scale(.96); }
  50% { transform: translateY(-2px) rotate(5deg) scale(1.07); }
  100% { transform: translateY(0) rotate(10deg) scale(1); }
}

/* Móvil/tablet: posición realmente centrada, independiente del ancho del logo/menu. */
@media (max-width: 1023px) {
  #nav-inner { position: relative; }

  .header-music-player {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
  }

  .header-music-tagline { display: none; }

  #header-audio-toggle {
    width: 46px;
    height: 46px;
    flex-basis: 46px;
  }

  .music-button-core {
    width: 36px;
    height: 36px;
  }
}

/* Escritorio: se integra junto a navegación/CTA sin perder el lema. */
@media (min-width: 1024px) {
  .header-music-player {
    margin-left: auto;
    padding-left: 1rem;
    border-left: 2px solid #F9C14E;
  }
}

@media (max-width: 430px) {
  #site-logo { max-width: 128px; }
}

@media (prefers-reduced-motion: reduce) {
  .music-ring,
  .music-button-core,
  .music-note {
    animation: none !important;
  }
}
