/* header.css - BefEnergy */

/* --- ESTRUCTURA BÁSICA --- */

.cabecera {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #23272f;
  padding: 0 40px;
  height: 70px;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  font-family: 'Montserrat', Arial, sans-serif;
}

.logo {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.logo img {
  height: 40px;
  margin-right: 10px;
}

.logo span {
  font-weight: bold;
  font-size: 1.5em;
  color: #ffffff;
}

/* --- MENÚ --- */
.cabecera nav ul {
  list-style: none;
  display: flex;
  gap: 30px;
  margin: 0;
  padding: 0;
}

.cabecera nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px; /* Igual que el botón */
  padding: 0 18px; /* Horizontal igual, sin excesivo vertical */
  border-radius: 20px;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
  line-height: 1;
}

.cabecera nav a:hover,
.btn-presupuesto:hover {
  background: #ecc101;
  color: #000000;
}

.btn-presupuesto {
  background: #ffd932;
  color: #000000 !important;
  font-weight: bold;
}

/* --- MENÚ HAMBURGUESA --- */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}

.menu-toggle span {
  width: 25px;
  height: 3px;
  background-color: #fff;
  transition: all 0.3s ease;
}

/* Animaciones para hamburguesa activa */
.menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* --- SELECTOR DE IDIOMA --- */
.idioma-selector {
  display: flex;
  gap: 10px;
}

.idioma-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.idioma-bandera {
  height: 20px;
  width: 30px;
  object-fit: cover;
}

/* Selector vertical tipo switch, alineado a la izquierda del header */
.idioma-switch {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 100;
    background: transparent;
}

.idioma-switch-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f5f5f5;
    border: none;
    border-radius: 32px;
    padding: 6px 18px 6px 6px;
    cursor: pointer;
    transition: background 0.2s;
    min-width: 120px;
    position: relative;
}

.idioma-switch-btn .idioma-switch-circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #ddd;
    display: inline-block;
    transition: background 0.2s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.idioma-switch-btn[data-lang="es"].selected .idioma-switch-circle {
    background: #e53935; /* rojo */
}
.idioma-switch-btn[data-lang="ca"].selected .idioma-switch-circle {
    background: #ffd600; /* amarillo */
}
.idioma-switch-btn[data-lang="en"].selected .idioma-switch-circle {
    background: #2979ff; /* azul */
}

.idioma-switch-btn .idioma-switch-label {
    font-size: 1em;
    font-weight: 600;
    color: #23272f;
    letter-spacing: 0.02em;
}

.idioma-switch-btn.selected {
    background: #e0e0e0;
}

.slide-in-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.slide-in-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.presupuesto-dropdown {
  position: relative;
}

.submenu-correo {
  position: absolute;
  top: 110%; /* un poco más abajo del botón */
  right: 0;
  background-color: #23272f;
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  padding: 12px 18px;
  display: none;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
  min-width: 220px;
}

.submenu-correo a {
  color: #ffffff;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.submenu-correo a:hover {
  color: #ffd932;
}

.submenu-correo.visible {
  display: flex;
}


@media (max-width: 740px) {
    .idioma-switch {
        position: static;
        transform: none;
        margin: 18px auto 0 auto;
        flex-direction: column;
        align-items: center;
    }
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
  .cabecera {
    padding: 0 20px;
  }

  .menu-toggle {
    display: flex;
  }

  .cabecera nav {
    position: absolute;
    top: 70px;
    left: 0;
    width: 100%;
    background: #23272f;
    display: none;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
    gap: 10px;
    z-index: 1000;
  }

  .cabecera nav ul {
    flex-direction: column;
    gap: 20px;
  }

  .cabecera nav.show {
    display: flex;
  }

  .idioma-selector-container {
    display: none;
  }
}

/* Estilos específicos para el selector de idioma en desktop */
@media (min-width: 769px) {
  .idioma-selector-container {
    display: flex;
    align-items: center;
    gap: 10px;
  }
}

