/* Reset y tipografía base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', sans-serif;
  background: linear-gradient(to bottom, #fdf1f8, #f1f8fd);
  color: #333;
  line-height: 1.6;
}

/* Lazy load fade-in */
img[loading="lazy"] {
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

img[loading="lazy"][data-loaded] {
  opacity: 1;
}

/* Header */
.main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background-color: #ffe4f2;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  position: relative;
  z-index: 100;
  flex-wrap: wrap;
}

.logo {
  height: 60px;
  object-fit: contain;
}

/* Hamburguesa - Oculta en desktop, visible en móvil + MOVIDA A LA DERECHA */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 25px;
  height: 18px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 101;
  margin-left: auto;
  margin-right: 1rem;
}

.hamburger span {
  display: block;
  height: 3px;
  width: 100%;
  background-color: #d678b5;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Navbar - Estilo base */
.navbar .nav-links {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  padding: 0;
  margin: 0;
}

.navbar .nav-links li {
  font-weight: 600;
}

.navbar .nav-links a {
  text-decoration: none;
  color: #d678b5;
  transition: color 0.3s ease;
}

.navbar .nav-links a:hover {
  color: #b34e9f;
}

/* Sección About */
.about-section {
  padding: 2rem;
  text-align: center;
}

.about-section h2 {
  font-family: 'Dancing Script', cursive;
  font-size: 2.5rem;
  color: #d678b5;
  margin-bottom: 1rem;
}

.about-section p {
  max-width: 700px;
  margin: 1rem auto;
}

.about-image img {
  width: 80%;
  max-width: 400px;
  height: auto;
  border-radius: 20px;
  box-shadow: 0 6px 12px rgba(0,0,0,0.1);
  margin: 1rem auto;
  display: block;
}

/* Sección Miembros */
.members-section {
  padding: 3rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

.integrante {
  display: flex;
  align-items: center;
  gap: 2rem;
  justify-content: center;
  flex-wrap: wrap;
}

.integrante:nth-child(even) {
  flex-direction: row-reverse;
}

.descripcion {
  flex: 1;
  min-width: 280px;
  max-width: 400px;
}

.descripcion h3 {
  font-family: 'Dancing Script', cursive;
  font-size: 2rem;
  color: #d678b5;
  margin-bottom: 0.5rem;
}

.carrusel {
  flex: 1;
  max-width: 300px;
  width: 100%;
  aspect-ratio: 1/1;
  overflow: hidden;
  border-radius: 1rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  position: relative;
}

.carrusel img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}

.carrusel img.active {
  opacity: 1;
}

/* Galería */
.galeria-section {
  padding: 2rem;
  text-align: center;
}

.galeria-section h2 {
  font-family: 'Dancing Script', cursive;
  font-size: 2.5rem;
  color: #d678b5;
  margin-bottom: 2rem;
}

.galeria-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  padding: 0 1rem;
}

.galeria-grid img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.3s ease;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.galeria-grid img:hover {
  transform: scale(1.05);
}

/* Lightbox Imágenes */
.lightbox {
  display: none;
  position: fixed;
  z-index: 999;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  justify-content: center;
  align-items: center;
}

.lightbox-img {
  max-width: 90%;
  max-height: 80%;
  border-radius: 20px;
  box-shadow: 0 6px 20px rgba(255,255,255,0.2);
}

.lightbox .close {
  position: absolute;
  top: 2rem;
  right: 2rem;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
}

/* === VIDEOS SECTION - DISEÑO UNIFICADO === */
.videos-section {
  padding: 4rem 1rem 6rem;
  text-align: center;
  background: linear-gradient(135deg, #fff5fa 0%, #f9f0ff 50%, #fff5fa 100%);
  position: relative;
  overflow: hidden;
}

.videos-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 30% 20%, rgba(214, 120, 181, 0.1) 0%, transparent 50%),
              radial-gradient(circle at 70% 80%, rgba(160, 102, 201, 0.08) 0%, transparent 50%);
  pointer-events: none;
}

.videos-section h2 {
  font-family: 'Dancing Script', cursive;
  font-size: 3rem;
  color: #d678b5;
  margin-bottom: 3rem;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
  position: relative;
  z-index: 1;
}

.video-carousel-container {
  position: relative;
  margin: 0 auto;
  max-width: 1200px;
  z-index: 1;
}

/* === DESKTOP: CARRUSEL 3D === */
@media screen and (min-width: 769px) {
  .video-carousel {
    position: relative;
    height: 450px;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    perspective: 1200px;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
  }

  .video-card {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 320px;
    height: 200px;
    background: linear-gradient(135deg, #fff5fa, #f5f0ff);
    border-radius: 20px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-origin: center center;
    backface-visibility: hidden;
  }

  .video-card:hover {
    box-shadow: 0 15px 40px rgba(0,0,0,0.25);
  }

  .carousel-controls {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
  }

  .carousel-controls button {
    background: linear-gradient(135deg, #d678b5, #b34e9f);
    color: white;
    border: none;
    width: 60px;
    height: 60px;
    font-size: 1.8rem;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
  }

  .carousel-controls button:hover {
    transform: scale(1.1) translateY(-3px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.3);
  }
}

/* === MÓVIL: CARRUSEL HORIZONTAL MEJORADO - VERSIÓN ESTÉTICA + BARRA DE PROGRESO === */
@media screen and (max-width: 768px) {
  .video-carousel-container {
    padding: 2rem 0;
    position: relative;
  }

  .video-carousel {
    display: flex;
    overflow-x: hidden;
    scroll-behavior: smooth;
    padding: 2rem 1rem;
    position: relative;
    width: 100%;
    height: 440px;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
  }

  .video-card {
    flex: 0 0 90vw;
    max-width: 340px;
    height: 280px;
    margin: 0 auto;
    background: linear-gradient(145deg, #fff0f8, #f8f4ff);
    border-radius: 28px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    cursor: pointer;
    position: relative;
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform-origin: center center;
    will-change: transform, opacity;
    border: 1px solid rgba(214, 120, 181, 0.15);
    display: flex;
    flex-direction: column;
  }

  .video-card.active {
    transform: scale(1.03) translateY(-12px);
    box-shadow: 0 20px 50px rgba(214, 120, 181, 0.35), 
                0 0 0 3px rgba(214, 120, 181, 0.1);
    z-index: 10;
  }

  .video-card.inactive {
    transform: scale(0.92);
    opacity: 0.65;
    filter: blur(1.5px);
  }

  .desktop-only {
    display: none;
  }

  /* === OVERLAY VIDEO MEJORADO === */
  .video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.3) 60%, transparent 100%);
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 2.8rem;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    pointer-events: none;
    border-radius: 28px 28px 0 0;
    z-index: 5;
  }

  .video-card:hover .video-overlay,
  .video-card.playing .video-overlay {
    opacity: 1;
    transform: scale(1.02);
    pointer-events: auto;
  }

  .video-overlay .video-icon {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    padding: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transform: scale(1);
  }

  .video-card:hover .video-overlay .video-icon {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.3);
  }

  .video-overlay.loading .video-icon {
    opacity: 0;
    transform: scale(0.8);
  }

  .video-overlay.loading .video-loader {
    display: block !important;
    opacity: 1;
    animation: pulse 1.5s infinite ease-in-out;
  }

  @keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.6; }
    50% { transform: scale(1.2); opacity: 1; }
  }

  /* === BARRA DE PROGRESO === */
  .progress-container {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    position: absolute;
    bottom: -10px;
    left: 0;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 6;
  }

  .video-card.playing .progress-container {
    opacity: 1;
  }

  .progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #d678b5, #b34e9f);
    border-radius: 2px;
    transition: width 0.1s linear;
    position: relative;
  }

  .progress-buffer {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 2px;
    z-index: -1;
  }

  .buffer-spinner {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    color: white;
    display: none;
    z-index: 1;
  }

  .video-card.playing .buffer-spinner {
    display: block;
    animation: spin 1s linear infinite;
  }

  /* === INDICADORES CON ANIMACIÓN DE PULSO === */
  .carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-top: 2.8rem;
    padding: 0 1.2rem;
  }

  .carousel-indicators span {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: rgba(214, 120, 181, 0.25);
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    position: relative;
    transform: scale(1);
  }

  .carousel-indicators span::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: linear-gradient(135deg, #d678b5, #b34e9f);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.5s ease;
    box-shadow: 0 0 0 0 rgba(214, 120, 181, 0.7);
  }

  .carousel-indicators span.active {
    background-color: transparent;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(214, 120, 181, 0.4);
  }

  .carousel-indicators span.active::before {
    width: 100%;
    height: 100%;
    box-shadow: 0 0 0 4px rgba(214, 120, 181, 0.4);
    animation: indicatorPulse 1.8s infinite;
  }

  @keyframes indicatorPulse {
    0% { box-shadow: 0 0 0 0 rgba(214, 120, 181, 0.4); }
    70% { box-shadow: 0 0 0 8px rgba(214, 120, 181, 0); }
    100% { box-shadow: 0 0 0 0 rgba(214, 120, 181, 0); }
  }

  /* Pequeño efecto táctil al presionar */
  .video-card:active {
    transform: scale(0.97) translateY(2px);
    transition: transform 0.1s ease-out;
  }
}

/* Footer Contacto */
.contact-footer {
  background-color: #f7f0ff;
  padding: 60px 20px;
  text-align: center;
  color: #333;
}

.contact-container {
  max-width: 800px;
  margin: 0 auto;
}

.contact-footer h2 {
  font-size: 2rem;
  margin-bottom: 30px;
  color: #a066c9;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.contact-form input,
.contact-form textarea {
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
  resize: none;
}

.contact-form button {
  background-color: #a066c9;
  color: white;
  padding: 12px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.3s ease;
}

.contact-form button:hover {
  background-color: #8a4fb9;
}

.social-icons {
  margin-top: 30px;
  display: flex;
  justify-content: center;
  gap: 25px;
}

.social-icons a {
  font-size: 1.8rem;
  color: #a066c9;
  transition: color 0.3s ease;
}

.social-icons a:hover {
  color: #8a4fb9;
}

/* Responsive */
@media screen and (max-width: 768px) {
  .main-header {
    padding: 1rem;
    justify-content: space-between;
    align-items: center;
  }

  .logo {
    height: 50px;
  }

  .hamburger {
    display: flex;
  }

  .nav-links {
    display: none !important;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
    padding: 1.5rem;
    background: #ffe4f2;
    border-radius: 12px;
    box-shadow: 0 6px 15px rgba(0,0,0,0.1);
    position: absolute;
    top: 70px;
    left: 1rem;
    right: 1rem;
    z-index: 100;
    animation: slideDown 0.3s ease-out;
  }

  @keyframes slideDown {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .navbar.active .nav-links {
    display: flex !important;
  }

  .integrante {
    flex-direction: column !important;
    text-align: center;
  }

  .carrusel {
    margin-top: 1rem;
    max-width: 250px;
  }

  .about-image img {
    width: 90%;
    max-width: 300px;
  }

  .galeria-grid img {
    height: 150px;
  }
}

/* ✅ SOLUCIÓN NUCLEAR: FORZAR RENDERIZADO DE VIDEO EN iOS/Android */
.video-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: inherit;
}

.video-wrapper video {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  z-index: 1 !important;
  background: black !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateZ(0) scale(1) !important;
  -webkit-transform: translateZ(0) scale(1) !important;
  backface-visibility: hidden !important;
  -webkit-backface-visibility: hidden !important;
}

/* Forzar aceleración por hardware */
.video-card {
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}