.mobile-menu {
  display: grid;
  align-items: center;
  padding: var(--desktop-padding) 0;
  grid-template-columns: 1fr 9fr;
  position: sticky;
  top: 0;
  z-index: 999;
  background-color: var(--color-white-transparent);
}

body.admin-bar .mobile-menu {
  top: 46px;
}

.hamburger-btn {
  width: 5rem;
  background: none;
  border: none;
  cursor: pointer;
  opacity: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.hamburger-btn,
.mobile-logo-link {
  transition: all 0.3s;
}

.hamburger-btn .line {
  display: block;
  width: 2rem;
  margin: 0 auto;
  height: 0.3rem;
  border-radius: var(--small-radius);
  background: var(--color-dark);
}

.mobile-logo {
  max-height: 4rem;
  width: auto;
  display: block;
}

.desktop-menu {
  display: none;
}

.site-wrapper {
  transition: transform 0.4s cubic-bezier(0.77, 0.2, 0.05, 1);
  min-height: 100vh;
}

.offcanvas-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 90vw;
  height: 100vh;
  background-color: var(--color-white-transparent);
  padding: var(--desktop-padding);
  z-index: 1000;
  transform: translateX(-100%);
  transition: transform 0.4s cubic-bezier(0.77, 0.2, 0.05, 1);
  overflow-y: auto;
}

.nav-categories {
  list-style: none;
}

.nav-categories a {
  display: block;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-primary);
  color: var(--color-primary);
  text-transform: uppercase;
  font-size: 14px;
}

body.menu-open {
  overflow: hidden;
}

body.menu-open .offcanvas-menu {
  transform: translateX(0);
}

body.menu-open .site-wrapper {
  transform: translateX(0);
}

body.menu-open .hamburger-btn,
body.menu-open .mobile-logo-link {
  opacity: 0;
}

.offcanvas-header {
  display: flex;
  justify-content: flex-end;
}

.close-btn {
  background: none;
  border: none;
  color: var(--color-primary);
  font-size: 2.8rem;
  cursor: pointer;
}

.menu-social {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 1rem 0;
}

.menu-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: transparent;
  color: var(--color-primary);
  transition: all 0.3s ease;
}

.menu-social a:hover {
  background: var(--color-primary);
  color: var(--color-white) !important;
}

.menu-social a svg {
  display: block;
  width: 1.3rem;
  height: 1.3rem;
  fill: currentColor;
  transition: all 0.3s ease;
}

.search-form {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 17rem;
  height: 2rem;
  background-color: var(--color-white);
  border: 1.5px solid var(--color-primary-transparent);
  border-radius: 50px;
  transition: all 0.3s ease;
}

.search-form:focus-within {
  background: var(--color-white);
  border-color: var(--color-primary);
}

.search-field {
  flex: 1;
  min-width: 0;
  padding: 0 1rem;
  border: none;
  outline: none;
  background: transparent;
  color: var(--color-dark);
  font-family: inherit;
}

.search-field::placeholder {
  color: var(--color-medium);
}

.search-submit {
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--color-primary);
  transition: all 0.3s ease;
  cursor: pointer;
}

.search-submit:hover {
  background: var(--color-primary);
  color: var(--color-white);
}

.search-submit svg {
  display: block;
  width: 1.3rem;
  height: 1.3rem;
  flex: 0 0 1rem;
  fill: currentColor;
  margin: 0 auto;
  transition: all 0.3s ease;
}

.offcanvas-menu .search-form {
  max-width: 100%;
}

@media screen and (min-width: 768px) {
  .mobile-menu,
  .offcanvas-menu {
    display: none;
  }

  body.menu-open .site-wrapper {
    transform: none;
  }

  body.menu-open {
    overflow: auto;
  }

  .desktop-menu {
    display: contents;
  }

  .top-header {
    position: sticky;
    top: 0;
    z-index: 999;
    height: 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--color-white);
  }

  body.admin-bar .top-header {
    top: 32px;
  }

  .custom-logo-link,
  .desktop-menu > .logo {
    height: 5rem;
    padding: 0.5rem var(--desktop-padding);
    display: flex !important;
    align-items: center;
    justify-content: center;
    background-color: var(--color-white);
  }

  .desktop-menu .custom-logo {
    width: auto;
    height: 100%;
    max-width: 100%;
    object-fit: contain;
  }

  .nav-categories-desktop {
    position: sticky;
    margin-top: var(--desktop-padding);
    top: 3rem;
    z-index: 998;
    list-style: none;
    width: 100%;
    padding: var(--desktop-padding);
    margin-bottom: var(--desktop-padding);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--desktop-padding);
    background-color: var(--color-white);
    border-top: 1.5px solid var(--color-primary);
    border-bottom: 1.5px solid var(--color-primary);
  }

  body.admin-bar .nav-categories-desktop {
    top: calc(32px + 3rem);
  }

  .desktop-menu .nav-categories-desktop li a {
    color: var(--color-text);
    text-transform: uppercase;
    font-weight: bold;
    font-size: 14px;
    transition: color 0.2s ease;
  }

  .desktop-menu .nav-categories-desktop li a:hover {
    color: var(--color-primary) !important;
  }
}
