/* unified-menu.css - Arreglos específicos para el menú responsive */

/* ================= CORRECCIONES DEL MENÚ RESPONSIVE ================= */

/* Base: asegurar que el menú siempre tenga z-index correcto */
.sidebar-modern {
    position: fixed;
    top: 0;
    left: 0;
    width: 50px;
    height: 100vh;
    background-color: #ffffff;
    z-index: 1100;
    transition: all 0.3s ease;
  }
  
  /* Botón hamburguesa oculto por defecto en desktop */
  .hamburger-btn {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 2100;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: none;
    font-size: 1.5rem;
  }
  
  /* Botón de cierre oculto por defecto */
  .close-btn {
    display: none;
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #fff;
    cursor: pointer;
    z-index: 2101;
  }
  
  /* Prevenir scroll cuando menú o modal está abierto */
  body.sidebar-open,
  body.modal-firma-open {
    overflow: hidden;
    position: relative;
    height: 100%;
  }
  
  /* Asegurar que modal siempre tenga z-index mayor que sidebar */
  .modal-overlay {
    z-index: 9999;
  }
  
  /* Ajuste de contenido principal */
  .main-content {
    transition: margin-left 0.3s ease, width 0.3s ease;
  }
  
  /* ================= CORRECCIONES PARA ESCRITORIO (>1024px) ================= */
  @media (min-width: 1025px) {
    /* Asegurar visibilidad del menú en desktop */
    .sidebar-modern {
      display: flex !important;
      width: 50px !important;
      opacity: 1 !important;
    }
    
    /* Ocultar elementos de móvil */
    .hamburger-btn, 
    .close-btn {
      display: none !important;
    }
    
    /* Ajustar contenido */
    .main-content {
      margin-left: 50px !important;
      width: calc(100% - 50px) !important;
    }
    
    /* Menú vertical con texto rotado */
    .sidebar-modern .menu-items {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      height: 100%;
      width: 100%;
      padding: 0;
      margin: 0;
      list-style: none;
    }
    
    .sidebar-modern .menu-items li {
      writing-mode: vertical-rl;
      text-orientation: mixed;
      transform: rotate(180deg);
      margin-left: 18px;
      width: 100%;
      text-align: center;
    }
    
    .sidebar-modern .menu-items a {
      color: #000;
      text-decoration: none;
      font-size: 1.2rem;
      font-weight: bold;
      text-transform: uppercase;
      letter-spacing: 2px;
    }
  }
  
  /* ================= CORRECCIONES PARA TABLET (768px-1024px) ================= */
  @media (min-width: 768px) and (max-width: 1024px) {
    /* Ajustar tamaño del menú */
    .sidebar-modern {
      display: flex !important;
      width: 40px !important;
      opacity: 1 !important;
    }
    
    /* Ocultar elementos de móvil */
    .hamburger-btn, 
    .close-btn {
      display: none !important;
    }
    
    /* Ajustar contenido */
    .main-content {
      margin-left: 40px !important;
      width: calc(100% - 40px) !important;
    }
    
    /* Hacer texto del menú más pequeño */
    .sidebar-modern .menu-items li {
      margin-left: 12px !important;
    }
    
    .sidebar-modern .menu-items a {
      font-size: 1rem !important;
    }
  }
  
  /* ================= CORRECCIONES PARA MÓVIL (<768px) ================= */
  @media (max-width: 767px) {
    /* Ocultar menú por defecto */
    .sidebar-modern {
      display: none;
      width: 100% !important;
      height: 100vh;
      background: rgba(38, 37, 34, 0.95);
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
    }
    
    /* Mostrar botón hamburguesa */
    .hamburger-btn {
      display: flex !important;
    }
    
    /* Ajustar contenido al ancho completo */
    .main-content {
      margin-left: 0 !important;
      width: 100% !important;
    }
    
    /* Cuando el menú está abierto */
    .sidebar-modern.show {
      display: flex;
      opacity: 1;
      flex-direction: column;
      align-items: center;
      justify-content: flex-start;
    }
    
    /* Configurar cabecera del menú móvil */
    .sidebar-modern.show .menu-header {
      display: block;
      width: 100%;
      text-align: right;
      padding-bottom: 1rem;
    }
    
    /* Mostrar botón de cierre */
    .sidebar-modern.show .close-btn {
      display: block;
    }
    
    /* Ajustar items del menú */
    .sidebar-modern.show .menu-items {
      margin-top: 3rem;
      flex-direction: column;
      align-items: center;
      width: 100%;
      padding: 0;
      list-style: none;
    }
    
    /* IMPORTANTE: Forzar orientación horizontal en móvil */
    .sidebar-modern.show .menu-items li {
      writing-mode: horizontal-tb !important;
      transform: none !important;
      margin: 1.5rem 0;
      text-align: center;
      width: 100%;
    }
    
    .sidebar-modern.show .menu-items a {
      color: #fff;
      font-size: 1.6rem;
      display: inline-block;
      padding: 1rem;
      text-decoration: none;
      font-weight: bold;
      text-transform: uppercase;
    }
    
    /* Cuando el modal está abierto, ocultar botón hamburguesa */
    body.modal-firma-open .hamburger-btn {
      display: none !important;
    }
  }