/* =====================
   HEADER Y NAVEGACIÓN
====================== */
header {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  align-items: center;
  background-color: #000;
  padding: 10px 20px;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 8px rgba(255, 255, 255, 0.2);
}

.logo {
  grid-column: 1 / 3;
}

.logo img {
  height: 50px;
  width: auto;
}

.menu-principal {
  grid-column: 5 / 9;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.menu-principal a {
  color: #fff;
  text-decoration: none;
  font-size: 1rem;
  background-color: var(--primary);
  padding: 12px 32px; /* Más espacio a los lados */
  width: auto;
  box-sizing: border-box;
  display: inline-block;
  border-radius: 5px;
  text-align: center;
  transition: background-color 0.3s ease;
}

.menu-principal a:last-child {
  background-color: var(--secondary);
}

.menu-principal a:hover {
  background-color: #234e9eda;
}

.menu-principal a:last-child:hover {
  background-color: #e23c1be0;
}

.redes-sociales {
  grid-column: 11 / 13;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.redes-sociales a {
  background-color: white;
  border-radius: 50%;
  text-decoration: none;
}

.icono-red-social img {
  width: 24px;
  height: 24px;
  transition: transform 0.3s ease;
}

.icono-red-social:hover img {
  transform: scale(1.2);
}

/* =====================
   HAMBURGUESA Y SIDEBAR NAV
====================== */
.btn-hamburguesa {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1002;
}

.btn-hamburguesa span {
  display: block;
  width: 28px;
  height: 4px;
  margin: 4px 0;
  background: var(--primary);
  border-radius: 2px;
  transition: 0.3s;
}

.sidebar-nav {
  display: none;
}

.sidebar-redes-sociales {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 18px;
  margin-top: 30px;
  width: 100%;
}

.sidebar-redes-sociales .icono-red-social img {
  width: 32px;
  height: 32px;
}

.sidebar-nav.open~.btn-hamburguesa,
.btn-hamburguesa.hide {
  display: none !important;
}

/* =====================
   MEDIA QUERIES PARA HEADER
====================== */

/* 900px (sidebar y hamburguesa) */
@media (max-width: 900px) {
  .menu-principal,
  .redes-sociales {
    display: none !important;
  }

  .btn-hamburguesa {
    display: flex;
    position: absolute;
    right: 20px;
    top: 20px;
  }

  .sidebar-nav {
    display: flex;
    position: fixed;
    top: 0;
    right: 0;
    width: 300px;
    height: 100vh;
    background: var(--white);
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    flex-direction: column;
    align-items: flex-start;
    padding: 30px 20px 20px 30px;
    transform: translateX(100%);
    transition: transform 0.7s cubic-bezier(.77, 0, .18, 1);
  }

  .sidebar-nav.open {
    transform: translateX(0);
  }

  .sidebar-nav nav {
    display: flex;
    flex-direction: column;
    width: 100%;
  }

  .sidebar-nav nav a {
    color: var(--primary);
    text-decoration: none;
    font-size: 1.3rem;
    margin: 18px 0;
    font-weight: 500;
    transition: color 0.2s;
  }

  .sidebar-nav nav a:hover {
    color: var(--secondary);
  }

  .close-sidebar {
    background: none;
    border: none;
    font-size: 2.2rem;
    color: var(--primary);
    position: absolute;
    top: 10px;
    right: 18px;
    cursor: pointer;
    z-index: 1002;
  }
}

/* 901px+ (ocultar sidebar) */
@media (min-width: 901px) {
  .sidebar-nav {
    display: none !important;
    transform: none !important;
  }
}