header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 40px;
  background-color: var(--colorfondo);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 10;
}

header a {
  text-decoration: none;
  color: var(--colorprimario);
  font-weight: 700;
  transition: color 0.3s ease;
}

header img {
  width: 50px;
  height: auto;
}

header nav ul {
  display: flex;
  gap: 50px;
  list-style: none;
  margin: 0;
  padding: 0;
}

header nav ul li a {
  font-size: 1rem;
  padding: 8px 12px;
  border-radius: 4px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

header nav ul li a:hover {
  color: black;
}

header > a:last-child img {
  width: 40px;
  transition: transform 0.3s ease;
}

header #carrito-icon {
  position: relative;
}

header #carrito-total {
  display: none;
  justify-content: center;
  align-items: center;
  position: absolute;
  top: -0.6rem;
  right: -0.4rem;
  aspect-ratio: 1/1;
  font-weight: 500;
  font-size: 0.8rem;
  color: var(--blanco);
  background-color: var(--colorsecundario);
  border-radius: 50%;
  padding: 3px;
  min-width: 1rem;
}

@media (max-width: 700px) {
  header {
    justify-content: space-around;
    padding: 15px 5px;
  }

  header nav ul {
    gap: 10px;
    width: 100%;
  }

  header nav ul li a {
    width: 100%;
    padding: 0;
    text-align: center;
  }

  header > a:last-child {
    align-self: center;
  }
}
