/* Tablet and mobile overrides (loaded up to 1024px) */
@media (max-width: 1024px) {
  .page {
    padding: 0 16px;
  }

  .header__nav {
    gap: 0.75rem;
  }

  .header__search {
    max-width: 240px;
  }

  .header__menu {
    gap: 1.25rem;
    padding: 0.75rem 0;
  }

  .header__cta {
    display: none;
  }
}

@media (max-width: 768px) {
  .header {
    position: sticky;
    top: 0;
    z-index: 900;
    background-color: #fff;
  }

  .header__nav {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "search search"
      "logo menu"
      "actions actions";
    align-items: center;
    gap: 0.75rem;
  }

  .header__search {
    grid-area: search;
    max-width: none;
    width: 100%;
  }

  .header__logo {
    grid-area: logo;
    justify-self: center;
    margin: 0.25rem 0;
  }

  .header__user-actions {
    grid-area: actions;
    justify-content: center;
  }

  .menu-toggle {
    display: inline-flex;
    grid-area: menu;
    justify-self: end;
  }

  .main-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: min(80vw, 320px);
    height: 100vh;
    padding: 1.5rem 1rem;
    background-color: #fff;
    box-shadow: -12px 0 24px rgba(0, 0, 0, 0.15);
    transition: right 0.3s ease;
    z-index: 1001;
  }

  .main-nav.active {
    right: 0;
  }

  .header__menu {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    padding: 0;
    border: 0;
  }

  .main-menu__link {
    width: 100%;
    padding: 0.75rem 1rem;
  }

  .scroll-top {
    width: 48px;
    height: 48px;
    right: 16px;
    bottom: 16px;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 17px;
  }

  .scroll-top {
    width: 44px;
    height: 44px;
    right: 12px;
    bottom: 12px;
  }
}
