/* ---------- Header / nav ---------- */
.top-bar {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  padding-inline: 1.25rem;
  background: rgba(250, 248, 245, 0.9);
  z-index: 10;
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);

  .top-bar__inner {
    max-width: 1440px;
    width: 100%;
    margin: 0 auto;

    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    min-height: 68px;
    .nav__actions {
      justify-self: end;
      display: flex;
      gap: 1.5rem;
    }
  }
}

.brand {
  font-weight: 800;
  font-size: 1.7rem;
  color: var(--color-text);
  letter-spacing: -0.01em;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(1rem, 0.468rem + 1.418vw, 2rem);
}

.nav__mobile {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: var(--color-surface);
  transform: translateX(100%);
  transition: transform 0.5s ease-in-out;

  .nav--mobile__inner {
    position: relative;
    overflow-y: auto;
    max-height: 100vh;
    display: flex;
    width: 100%;
    flex-direction: column;
    gap: 1.5rem;
    padding: 2rem 1.5rem;

    .nav__toggle {
      position: absolute;
      top: 1.5rem;
      right: 1.5rem;
    }

    .nav {
      align-items: start;
      flex-direction: column;
      gap: 1.5rem;
    }

    .nav--mobile__socialLinks {
      display: flex;
      > a {
        display: block;
        > i {
          width: 2rem;
          height: 2rem;
        }
      }
    }
  }
}

.nav__mobile.is-open {
  width: 100%;
  transform: translateX(0);
}

.top-bar__inner .nav__toggle {
  width: fit-content;
  justify-self: end;
  display: none;
}

.nav .nav__item {
  position: relative;
  color: var(--color-text);
  font-weight: 500;
  padding-block: 0.4rem;
  line-height: 1.2;
  text-wrap: nowrap;
}

.nav .nav__item::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0px;
  height: 2px;
  width: 0;
  border-radius: 2px;
  background: transparent;
  transition: all 0.3s ease;
}

.nav .nav__item:hover {
  color: var(--color-primary);

  &:not(.is-active)::after {
    width: 100%;
    background: var(--color-primary);
  }

  &.is-active::after {
    width: 10px;
  }
}

.nav .nav__item.is-active {
  color: var(--color-primary);
  font-weight: 600;

  &::after {
    width: 100%;
    right: 0;
    background: var(--color-primary);
  }
}

.profile-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  color: var(--color-text);
  border-radius: 999px;
}

.profile-link:hover {
  color: var(--color-primary);
  background: var(--color-accent);
}

/* ---------- Cart badge ---------- */
.cart-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  color: var(--color-text);
  width: 1.8rem;
  height: 1.8rem;
}

.cart-link__badge {
  position: absolute;
  top: -0.9rem;
  right: -0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  margin-left: 0.4rem;
  padding: 0 0.35rem;
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  background: var(--color-primary);
  border-radius: 999px;
}

.cart-link__icon {
  width: 1.8rem;
  height: 1.8rem;
}

@media (max-width: 649px) {
  .top-bar .top-bar__inner {
    display: flex;
    .nav,
    .nav__actions {
      display: none;
    }
    .nav__toggle {
      display: inline-flex;
    }
  }
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 4rem;
  padding-block: 2.5rem;
  border-top: 1px solid var(--color-border);
  color: var(--color-muted);
  font-size: 0.9rem;
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .nav {
    gap: 0.9rem;
    font-size: 0.95rem;
  }
}
