html {
  scroll-behavior: smooth;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Nunito', sans-serif;
  background-color: #090A20;
  color: #fff;
  transition: background-color 0.3s ease, color 0.3s ease;
  min-height: 100vh;
  position: relative;
}

body.dark {
  background-color: #000000;
  color: #CF621B;
}

/* Header mejorado */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 25px 20px;
  background-color: #0b0a20;
  backdrop-filter: blur(10px);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  transition: background-color 0.3s ease;
}

.contenedor-boton-cambio-tema {
  display: flex;
  align-items: center;
}

.boton-cambio-tema {
  width: 60px;
  height: 30px;
  background: linear-gradient(135deg, #CF621B 0%, #E9722C 100%);
  border-radius: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px;
  cursor: pointer;
  position: relative;
  transition: background 0.3s ease;
}

.pelota-boton-cambio-tema {
  width: 22px;
  height: 22px;
  background-color: white;
  border-radius: 50%;
  position: absolute;
  left: 4px;
  transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  z-index: 2;
}

.icono-sol, .icono-luna {
  font-size: 14px;
  z-index: 1;
  transition: opacity 0.3s ease;
}

.icono-sol {
  color: #fff;
  margin-left: 5px;
}

.icono-luna {
  color: #090A20;
  margin-right: 5px;
  opacity: 0;
}

body.dark .pelota-boton-cambio-tema {
  transform: translateX(30px);
}

body.dark .icono-sol {
  opacity: 0;
}

body.dark .icono-luna {
  opacity: 1;
}

.logo-container {
  flex: 1;
  display: flex;
  justify-content: center;
}

.logo {
  max-height: 45px;
  transition: transform 0.3s ease;
}

.logo:hover {
  transform: scale(1.05);
}

.menu-toggle {
  background: linear-gradient(135deg, #CF621B 0%, #E9722C 100%);
  color: white;
  border: none;
  border-radius: 8px;
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 1.2rem;
}

.menu-toggle:hover {
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(207, 98, 27, 0.5);
}

.menu-toggle.active {
  transform: rotate(90deg);
}

/* Menú mejorado */
.menu {
  position: fixed;
  top: 75px;
  right: -100%;
  width: 320px;
  height: calc(100vh - 75px);
  background: linear-gradient(135deg, #1A1C3B 0%, #090A20 100%);
  backdrop-filter: blur(10px);
  padding: 30px 20px;
  z-index: 999;
  overflow-y: auto;
  transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -5px 0 25px rgba(0, 0, 0, 0.3);
}

body.dark .menu {
  background: linear-gradient(135deg, #000000 0%, #0A0A0A 100%);
  box-shadow: -5px 0 25px rgba(207, 98, 27, 0.2);
}

.menu.active {
  right: 0;
}

.menu ul {
  list-style: none;
  margin-bottom: 30px;
}

.menu ul li {
  margin-bottom: 15px;
}

.menu ul li a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
  display: block;
  padding: 12px 15px;
  border-radius: 10px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  border: 1px solid transparent;
}

body.dark .menu ul li a {
  color: #CF621B;
  border: 1px solid rgba(207, 98, 27, 0.3);
}

.menu ul li a::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(207, 98, 27, 0.2), transparent);
  transition: left 0.7s ease;
}

body.dark .menu ul li a::before {
  background: linear-gradient(90deg, transparent, rgba(207, 98, 27, 0.3), transparent);
}

.menu ul li a:hover {
  background-color: rgba(207, 98, 27, 0.1);
  transform: translateX(5px);
  border-color: #CF621B;
}

body.dark .menu ul li a:hover {
  background-color: rgba(207, 98, 27, 0.2);
  border-color: #E9722C;
  box-shadow: 0 5px 15px rgba(207, 98, 27, 0.2);
}

.menu ul li a:hover::before {
  left: 100%;
}

/* Dropdown mejorado */
nav {
  margin-top: 20px;
  position: relative;
}

.dropdown-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #CF621B 0%, #E9722C 100%);
  color: white;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
  padding: 15px;
  border-radius: 10px;
  transition: all 0.3s ease;
  margin-bottom: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

body.dark .dropdown-toggle {
  background: linear-gradient(135deg, #CF621B 0%, #E9722C 100%);
  color: #000;
  border: 1px solid rgba(207, 98, 27, 0.5);
  box-shadow: 0 2px 8px rgba(207, 98, 27, 0.3);
}

.dropdown-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(207, 98, 27, 0.4);
}

body.dark .dropdown-toggle:hover {
  box-shadow: 0 5px 15px rgba(207, 98, 27, 0.5);
}

.dropdown-toggle::after {
  content: '\f078';
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  transition: transform 0.3s ease;
}

.dropdown-toggle.active::after {
  transform: rotate(-180deg);
}

/* styles.css - Modifica esta sección del dropdown */
.dropdown-menu {
  list-style: none;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease, opacity 0.3s ease;
  background-color: rgba(42, 46, 86, 0.3);
  border-radius: 10px;
  margin-top: 5px;
  opacity: 0;
  border: 1px solid rgba(207, 98, 27, 0.2);
}

body.dark .dropdown-menu {
  background-color: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(207, 98, 27, 0.4);
}

.dropdown-menu.active {
  max-height: 500px;
  opacity: 1;
}

/* Asegúrate de que el dropdown sea visible cuando el menú esté abierto */
.menu.active .dropdown-menu.active {
  visibility: visible;
}

.dropdown-menu li {
  margin: 0;
}

.dropdown-menu li a {
  color: #ddd;
  text-decoration: none;
  font-size: 0.95rem;
  display: block;
  padding: 12px 20px;
  border-left: 3px solid transparent;
  transition: all 0.3s ease;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark .dropdown-menu li a {
  color: rgba(207, 98, 27, 0.9);
  border-bottom: 1px solid rgba(207, 98, 27, 0.2);
}

.dropdown-menu li:last-child a {
  border-bottom: none;
}

.dropdown-menu li a:hover {
  background-color: rgba(207, 98, 27, 0.1);
  border-left-color: #CF621B;
  color: #fff;
  padding-left: 25px;
}

body.dark .dropdown-menu li a:hover {
  background-color: rgba(207, 98, 27, 0.2);
  border-left-color: #CF621B;
  color: #CF621B;
  box-shadow: 0 2px 8px rgba(207, 98, 27, 0.2);
}

/* Footer Styles */
.footer {
  background-color: #090A20;
  color: #fff;
  padding: 40px 20px;
  text-align: center;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.footer-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.footer-logo img {
  width: 150px;
  margin-bottom: 20px;
}

.footer-info {
  margin-bottom: 20px;
}

.footer-info p {
  margin: 5px 0;
  transition: color 0.3s ease;
}

.footer-info a {
  color: #E9722C;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-social ul {
  display: flex;
  justify-content: center;
  align-items: center;
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-social ul li {
  margin: 0 10px;
  background: none;
}

.footer-social ul li div {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: transparent;
}

.footer-social ul li a.icon {
  position: relative;
  display: block;
  width: 60px;
  height: 60px;
  text-align: center;
  line-height: 63px;
  background: #CF621B;
  border-radius: 50%;
  font-size: 30px;
  color: #fff;
  transition: .5s;
  margin-bottom: 10px;
  z-index: 1;
}

.footer-social ul li a.icon::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #CF621B;
  transition: .5s;
  z-index: -1;
}

.footer-social ul li a.icon:hover::before {
  box-shadow: 0 0 15px #CF621B;
  background-color: #000;
}

.footer-social ul li a.icon:hover {
  color: #CF621B;
  box-shadow: 0 0 5px #CF621B;
  text-shadow: 0 0 5px #CF621B;
  background-color: #000;
}

.footer-social ul li a.usuario {
  position: relative;
  font-size: 14px;
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  padding: 5px 15px;
  background: #CF621B;
  border-radius: 20px;
  transition: .5s;
  z-index: 1;
}

.footer-social ul li a.usuario::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 20px;
  transition: .5s;
  transform: scale(.9);
  z-index: -1;
}

.footer-social ul li a.usuario:hover::before {
  box-shadow: 0 0 15px #CF621B;
}

.footer-social ul li a.usuario:hover {
  color: #fff;
  text-shadow: 0 0 5px #CF621B;
  background-color: #000;
}

.footer-social ul li a.icon:hover + a.usuario, .footer-social ul li a.usuario:hover {
  box-shadow: 0 0 5px #CF621B;
  text-shadow: 0 0 5px #CF621B;
}

.footer-map {
  width: 100%;
  height: 400px;
  margin-top: 2rem;
}

.footer-map iframe {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Botón de WhatsApp */
.whatsapp-button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #128C7E;
  color: white;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  text-align: center;
  line-height: 60px;
  font-size: 2rem;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
  transition: background-color 0.3s ease, transform 0.3s ease;
  z-index: 11111;
}

.whatsapp-button:hover {
  background-color: #075E54;
  transform: scale(1.1);
}

/* Botones de navegación de galería */
.flecha-der {
  position: fixed;
  padding: 10px;
  font-size: 2rem;  
  background-color: #090A20;
  color: white;
  border-radius: 15px;
  width: 60px;
  height: 90px;
  cursor: pointer;
  z-index: 99999;
  top: 50%;
  right: 20%;
}

.flecha-izq {
  position: fixed;
  padding: 10px;
  font-size: 2rem;  
  background-color: #090A20;
  color: white;
  border-radius: 15px;
  width: 60px;
  height: 90px;
  cursor: pointer;
  z-index: 99999;
  top: 50%;
  left: 20%;
}

.btn-cerrar {
  position: fixed;
  padding: 5px;
  font-size: 1rem;  
  font-weight: 700;
  background-color: rgba(255, 0, 0, 1);
  color: white;
  border-radius: 50%;
  border: none;
  width: 40px;
  height: 40px;
  cursor: pointer;
  z-index: 9999;
  top: 2.5vh;
  right: 20vh;
}

.btn-cerrar:hover {
  background-color: rgb(151, 1, 1) !important;
}

.flechas {
  display: none;
}

.flechas.show {
  display: block;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw; 
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.866);
  z-index: 999;
}

.overlay.show {
  display: block;
}

/* Créditos HVM */
.hvm-credits {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

body.dark .hvm-credits {
  border-top: 1px solid rgba(207, 98, 27, 0.3);
}

.hvm-credits a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: white;
  text-decoration: none;
  transition: opacity 0.3s;
}

body.dark .hvm-credits a {
  color: #CF621B;
}

.hvm-credits a:hover {
  opacity: 0.8;
}

.hvm-logo {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

/* Media Queries */
@media (min-width: 768px) {
  .footer-container {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
  
  .footer-logo, .footer-info, .footer-social {
    margin: 0 20px;
  }
  
  .footer-logo img {
    margin-bottom: 0;
  }
  
  .footer-social {
    margin-bottom: 0;
  }
  
  .footer-map iframe {
    height: 400px;
  }
}

@media (max-width: 768px) {
  .menu {
    width: 280px;
  }
  
  .footer-social ul {
    flex-direction: column;
  }
  
  .footer-social ul li {
    margin: 10px 0;
  }
  
  .flecha-der, .flecha-izq {
    width: 40px;
    height: 70px;
    font-size: 1.5rem;
    top: 50%;
  }

  .flecha-der {
    right: 5%;
  }

  .flecha-izq {
    left: 5%;
  }

  .btn-cerrar {
    position: fixed;
    padding: 5px;
    font-size: 1rem;  
    background-color: rgba(255, 0, 0, 1);
    color: white;
    border-radius: 15px;
    width: 40px;
    height: 40px;
    cursor: pointer;
    z-index: 9999;
    top: 20vh;
    right: 4vh;
  }
}

@media (max-width: 480px) {
  header {
    padding: 18px 15px;
  }
  
  .logo {
    max-height: 40px;
  }
  
  .menu-toggle {
    width: 40px;
    height: 40px;
  }
  
  .menu {
    width: 85%;
  }
}

/* Habilitar scroll vertical cuando el dropdown está activo */
.dropdown-menu.active {
  max-height: 60vh; /* limita la altura al 60% de la pantalla */
  overflow-y: auto; /* activa scroll vertical si hay muchos items */
  opacity: 1;
}

/* Opcional: mejorar la barra de scroll */
.dropdown-menu.active::-webkit-scrollbar {
  width: 6px;
}
.dropdown-menu.active::-webkit-scrollbar-thumb {
  background: #CF621B;
  border-radius: 10px;
}
.dropdown-menu.active::-webkit-scrollbar-track {
  background: transparent;
}