header {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  position: relative;
  border-radius: 10px;
  border-bottom: 2px solid black;
  padding: 0.1rem 1rem;
  gap: 1rem;
  background-color: firebrick;

  h1 {
    font-size: 1.25rem;

    a {
      text-decoration: none;
      transition: color 0.2s;
      font-weight: 700;
      color: white;

      &:hover, &:focus {
        outline: none;
        color: black;
      }
    }
  }

  nav {
    ul {
      display: flex;
      flex-direction: row;
      gap: 2rem;
      list-style-type: none;
    }

    a {
      text-decoration: none;
      transition: color 0.2s;
      font-weight: 600;
      color: white;

      &:hover, &:focus {
        outline: none;
        color: black;
      }
    }
  }

  p {
    color: #FFFFFF;
    font-weight: 500;
  }

  .hamburger {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 2;

    span {
      display: block;
      width: 25px;
      height: 3px;
      transition: transform 0.2s, opacity 0.5s;
      background-color: white;
    }

    /* Animación cuando se abre */
    &.active span:nth-child(1) {
      transform: translateY(7px) rotate(45deg);
    }

    &.active span:nth-child(2) {
      opacity: 0;
    }

    &.active span:nth-child(3) {
      transform: translateY(-7px) rotate(-45deg);
    }
  }

  .toggle-theme {
    cursor: pointer;
  }
}

/* RESPONSIVE - Mobile */
@media (max-width: 768px) {
  header {
    .hamburger {
      display: flex;
    }

    nav {
      position: absolute;
      top: 100%;
      left: 0;
      right: 0;
      border-radius: 10px;
      max-height: 0;
      overflow: hidden;
      transition: max-height 0.3s ease-out;
      background-color: firebrick;

      &.active {
        max-height: fit-content;
        border-bottom: 2px solid black;
      }

      ul {
        list-style-type: none;
        flex-direction: column;
        gap: 0;
        padding: 0rem 0rem;

        li {
          padding: 0.75rem 1rem;
          border-bottom: 1px solid white;

          &:last-child {
            border-bottom: none;
          }
        }
      }
    }
    
    .theme-toggle {
      display: none;
    }
  }
}
