/* header.css - Estilos del header */

/* Eliminar padding del container en header */
.header .container {
    padding: 0;
}

/* Header principal - Estilo consolidado */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.logo {
    flex-shrink: 0;
}

.logo img {
    width: 100px;
    height: 60px;
    object-fit: contain;
    margin-top: 5px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem; /* Desktop: 2rem laterales */
    min-height: 70px;
}

.left-section {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.right-section {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: auto;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    line-height: 1;
    height: 48px;
    box-sizing: border-box;
    background-color: #000;
    color: #fff;
    text-decoration: none;
    border: none;
}

.cta-button:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.credits-display {
    background: white;
    color: black;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 14px;
    font-weight: 500;
}

.credits-display span:first-child {
    color: #3a40ea !important;
}

.user-avatar {
    position: relative;
    cursor: pointer;
}

.avatar-circle {
    width: 40px;
    height: 40px;
    background-color: #6b7280;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 16px;
}

.user-dropdown {
    position: absolute;
    top: 45px;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    min-width: 180px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.user-dropdown.show {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-submenu {
    position: absolute;
    top: 0;
    right: 100%;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    min-width: 150px;
    display: none;
    z-index: 1001;
}

.language-submenu.show {
    display: block;
}

.dropdown-item {
    display: block;
    padding: 12px 16px;
    color: #374151;
    text-decoration: none;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.2s;
}

.dropdown-item:hover {
    background-color: #f9fafb;
    color: #1f2937;
}

.dropdown-item:last-child {
    border-bottom: none;
}

/* Hamburger base styles */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 8px;
    background: none;
    border: none;
    height: auto;
    justify-content: center;
    gap: 0;
    align-items: flex-start;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: #000;
    margin: 3px 0;
    transition: 0.3s;
}

.language-selector select {
    background-color: white;
    color: black;
    border: 2px solid black;
    border-radius: 25px;
    padding: 0 35px 0 20px;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
    appearance: none;
    min-width: 120px;
    height: 48px;
    line-height: 48px;
    vertical-align: top;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
}

.nav-menu ul {
    display: flex;
    align-items: center;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 2rem;
}

.nav-menu a {
    font-weight: 500;
    color: #000;
    text-decoration: none;
}

/* Responsive 768px - comportamiento móvil */
@media (max-width: 768px) {
  .header .container {
      all: unset !important;
      display: block !important;
      width: 100% !important;
  }
  .header-content {
      padding: 0; /* sin padding lateral ni vertical; lo asignamos por secciones */
      min-height: 60px;
      flex-wrap: nowrap;
  }
  .left-section {
      flex: 0 0 auto;
      gap: 0.5rem;
      order: 1;
      padding: 0 !important; /* Sin padding */
      margin: 0 !important; /* Sin margen */
  }
  .logo {
      order: 1;
      padding: 0 !important;
      margin-top: 0 !important;
      margin-bottom: 0 !important;
      margin-right: 0 !important;
      margin-left: 16px !important; /* 16px desde borde izquierdo */
      width: fit-content !important; /* Se ajusta al contenido */
      min-width: 0 !important;
      flex-shrink: 0;
  }
  
  .logo a {
      display: block;
      padding: 0;
      margin: 0;
      line-height: 0;
  }
  
  .logo img {
      display: block;
      margin: 0 !important;
      padding: 0 !important;
      height: 40px !important;
      width: auto !important;
  }
  .hamburger {
      display: flex;
      order: 2;
  }
  .main-nav {
      position: absolute;
      top: 100%;
      left: 0;
      width: 100%;
      background: white;
      box-shadow: 0 2px 10px rgba(0,0,0,0.1);
      display: none;
      z-index: 1000;
      order: 3;
  }
  .main-nav.active { display: block; }
  .main-nav ul {
      display: flex;
      flex-direction: column;
      padding: 1rem;
  }
  .main-nav li {
      margin: 0.5rem 0;
      width: 100%;
  }
  .right-section {
      flex: 0 0 auto;
      margin-left: auto;
      order: 2;
      gap: 0.5rem !important; /* Mantener gap entre botón y avatar */
      padding: 0 !important;
      margin-right: 8px !important; /* Los 8px van aquí en el contenedor */
  }
  .user-info {
      order: 1;
      margin-left: auto;
      margin-right: 0 !important;
      padding: 0 !important;
      display: flex;
      align-items: center;
      justify-content: flex-end;
  }
  .credits-display {
      padding: 2px 6px;
      font-size: 12px;
  }
  .avatar-circle {
      width: 36px;
      height: 36px;
      margin-right: 0 !important; /* Sin margen propio */
  }
  .avatar-circle span {
      font-size: 14px;
  }
  .cta-button {
      height: 36px;
      padding: 0 1rem;
      font-size: 14px;
  }
  
  /* Forzar altura en TODOS los botones del header en móvil */
  .header button,
  .header a.btn,
  .header .btn-primary {
      height: 36px !important;
      min-height: 36px !important;
  }
}

/* Ultra-estrecho: priorizar avatar y evitar desbordes */
@media (max-width: 400px) {
  .header .container {
      all: unset !important;
      display: block !important;
      width: 100% !important;
  }
  .header-content { padding: 0; /* Sin padding, lo controlan las secciones */ }
  .left-section { padding: 0 !important; margin: 0 !important; }
  .logo {
      padding: 0 !important;
      margin-top: 0 !important;
      margin-bottom: 0 !important;
      margin-right: 0 !important;
      margin-left: 16px !important; /* 16px desde borde izquierdo */
      width: fit-content !important;
      min-width: 0 !important;
      flex-shrink: 0;
  }
  .logo a {
      display: block;
      padding: 0;
      margin: 0;
      line-height: 0;
  }
  .logo img {
      display: block;
      margin: 0 !important;
      padding: 0 !important;
      height: 40px !important;
      width: auto !important;
  }
  .right-section {
      gap: 0.5rem !important;
      padding: 0 !important;
      margin-right: 8px !important;
  }
  .user-info {
      margin-right: 0 !important;
      padding: 0 !important;
  }
  .avatar-circle {
      width: 32px;
      height: 32px;
      margin-right: 0 !important;
  }
  .credits-display { display: none; }
}
