/* =========================================================
   VARIABLES Y CONFIGURACIÓN BASE
   ========================================================= */
   :root {
    --primary-color: #2A2A72;
    --secondary-color: #009FFD;
    --accent-color: #FF0076;
    --text-light: #ffffff;
    --bg-dark: rgba(0, 0, 0, 0.95);
    --easing: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --header-height: 80px;
  }
  
  /* =========================================================
     RESET Y ESTILOS BASE
     ========================================================= */
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    margin-top: var(--header-height);
  }
  
  /* =========================================================
     HEADER
     ========================================================= */
  header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--bg-dark);
    padding: 10px 20px;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    height: var(--header-height);
  }
  header a {
    text-decoration: none;
  }
  /* Logo */
  header img {
    height: 60px;
    width: auto;
    transition: transform 0.4s var(--easing);
    z-index: 1001;
  }
  header img:hover {
    transform: scale(1.05) rotate(-2deg);
  }
  
  /* =========================================================
     MENÚ HAMBURGUESA
     ========================================================= */
  .hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 1002;
    margin-left: auto;
    transition: transform 0.3s var(--easing);
  }
  .hamburger span {
    display: block;
    width: 30px;
    height: 3px;
    background: var(--text-light);
    margin: 5px 0;
    transition: all 0.4s var(--easing);
    transform-origin: center;
    /* Fuerza la aparición de las 3 líneas por encima de otros elementos */
    z-index: 1003;
  }
  /* Animación cuando está activo */
  .hamburger.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }
  .hamburger.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
  }
  .hamburger.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }
  
  /* =========================================================
     MENÚ PRINCIPAL
     ========================================================= */
  .menu-principal {
    display: flex;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
    transition: all 0.4s var(--easing);
  }
  .menu-item {
    color: var(--text-light);
    text-decoration: none;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    position: relative;
    transition: all 0.3s ease;
    border-radius: 5px;
  }
  
  .menu-item::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #ffcc00 0%, #ff9900 100%);
    transition: width 0.3s ease;
  }
  
  .menu-item:hover {
    color: #ffcc00;
  }
  .menu-item:hover::after {
    width: 100%;
  }
  
  /* =========================================================
     SUBMENÚS
     ========================================================= */
  .has-submenu {
    position: relative;
  }
  .menu-desplegable {
    position: relative;
    display: flex;
    flex-direction: column;
  }
  
  .contenido {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-dark);
    min-width: 260px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s var(--easing);
    border-radius: 15px;
    padding: 10px 0;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 1000;
  }
  .contenido.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
  .arrow {
    font-size: 0.8em;
    margin-left: 8px;
    transition: transform 0.3s var(--easing);
  }
  .arrow.rotate {
    transform: rotate(180deg);
  }
  
  /* =========================================================
     SUBMENÚ SERVICIOS - ESPECÍFICO
     ========================================================= */
  
  /* Submenú Filosofía y Servicios: Mejorar proporciones */
  .menu-item.filosofia .contenido,
  .menu-item.servicios .contenido {
    min-width: 300px; /* Aumentar el ancho para mayor visibilidad */
  }
  
  /* Submenú Filosofía */
  .submenu-item{
    display: flex;
    align-items: center; /* Alinear verticalmente la imagen con el texto */
    gap: 10px; /* Espaciado entre la imagen y el texto */
    text-decoration: none;
    transition: all 0.2s ease;
    color: white;
    font-size: 0.95rem;
    padding: 15px;
    position: relative;
  }
  
  .submenu-item img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #ffcc00;
    box-shadow: 0 0 10px rgba(255, 204, 0, 0.8);
  }
  
  .submenu-item:hover {
    background: rgba(255, 204, 0, 0.1);
    color: #ffcc00;
    padding-left: 25px;
  }
  
  .submenu-item:hover img {
    transform: scale(1.1);
  }
  
  /* Submenú servicio */
  .submenu-itemServ {
    padding: 12px 20px;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.9);
    transition: all 0.2s ease;
    text-decoration: none;
    display: block;
    align-items: center;
    gap: 10px;
  }
  
  .submenu-itemServ {
    display: flex;
    align-items: center; /* Alinear verticalmente la imagen con el texto */
    gap: 10px; /* Espaciado entre la imagen y el texto */
    text-decoration: none;
    transition: all 0.2s ease;
    color: white;
    font-size: 0.95rem;
    padding: 15px;
  }
  .submenu-itemServ img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #ffcc00;
    box-shadow: 0 0 10px rgba(255, 204, 0, 0.8);
  }
  .submenu-itemServ:hover {
    background: rgba(255, 204, 0, 0.1);
    transform: translateY(-3px);
    padding-left: 15px;
  }
  .submenu-itemServ:hover img {
    transform: scale(1.1);
  }
  
  /* =========================================================
     RESPONSIVE
     ========================================================= */
  @media (max-width: 768px) {
    .hamburger {
      display: block;
    }
    .menu-principal {
      position: fixed;
      top: var(--header-height);
      right: -100%;
      width: 85%;
      max-width: 300px;
      height: calc(100vh - var(--header-height));
      background: var(--bg-dark);
      flex-direction: column;
      padding: 20px;
      overflow-y: auto;
      transition: right 0.4s var(--easing);
    }
    .menu-principal.active {
      right: 0;
    }
    .menu-item {
      width: 100%;
      padding: 15px 20px;
      border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
    .has-submenu .contenido {
      position: static;
      background: transparent;
      box-shadow: none;
      opacity: 1 !important;
      visibility: visible !important;
      transform: none !important;
      max-height: 0;
      overflow: hidden;
      padding: 0;
      transition: max-height 0.3s var(--easing);
    }
    .has-submenu .contenido.visible {
      max-height: 500px;
      padding: 10px 0 0 20px;
    }
    #servicios-submenu {
      grid-template-columns: 1fr;
    }
    .submenu-itemServ {
      padding: 10px;
    }
    .submenu-itemServ img {
      width: 40px;
      height: 40px;
    }
    header {
      padding: 10px 15px !important;
      gap: 15px;
    }
    header > a:first-child {
      flex: 0 0 auto !important;
      max-width: 180px;
    }
    .hamburger {
      order: 1 !important;
      margin-left: auto !important;
      padding: 8px;
    }
  }
  /* Efectos de hover en dispositivos que los soportan */
  @media (hover: hover) {
    .has-submenu:hover .contenido {
      opacity: 1;
      visibility: visible;
      transform: translateY(0);
    }
    .menu-item:hover {
      transform: translateY(-2px);
    }
  }
  .no-scroll {
    overflow: hidden;
  }
  
  @media (max-width: 768px) and (hover: hover) {
    .has-submenu:hover .contenido {
      max-height: 500px;
      padding: 10px 0 0 20px;
    }
  }
  