html,
body {
  overflow-x: hidden;
}

/* =========================
   HEADER
========================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 2000;
  padding: 14px 0;
  background: rgba(255, 253, 249, 0.92);
  border-bottom: 1px solid rgba(232, 238, 232, 0.8);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

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

.header-container {
  display: grid;
  grid-template-columns: 130px 1fr auto;
  align-items: center;
  gap: 32px;
}

.site-logo {
  display: inline-flex;
  align-items: center;
}

.site-logo,
.site-logo img {
  width: 130px;
}

.site-logo img {
  display: block;
  height: auto;
}

/* =========================
   DESKTOP NAVIGATION
========================= */

.site-nav {
  justify-self: center;
}

.primary-menu {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.primary-menu li {
  margin: 0;
}

.primary-menu a {
  display: block;
  color: var(--color-text);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: color 0.25s ease;
}

.primary-menu a:hover,
.primary-menu .current-menu-item > a {
  color: var(--color-primary);
}

/* =========================
   DESKTOP ACTIONS
========================= */

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-phone {
  color: var(--color-primary-dark);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.header-phone:hover {
  color: var(--color-primary);
}

.header-btn {
  min-height: 44px;
  padding-inline: 22px;
  font-size: 14px;
}

/* =========================
   MOBILE ELEMENTS
========================= */

.mobile-toggle,
.mobile-close,
.mobile-menu-header,
.mobile-menu-bottom {
  display: none;
}

.mobile-toggle {
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-white);
  cursor: pointer;
  transition:
    opacity 0.2s ease,
    border-color 0.2s ease,
    background-color 0.2s ease;
}

.mobile-toggle:hover {
  border-color: rgba(111, 155, 114, 0.35);
  background: var(--color-primary-light);
}

.mobile-toggle:focus-visible {
  outline: 3px solid rgba(111, 155, 114, 0.22);
  outline-offset: 2px;
}

.mobile-toggle span {
  display: block;
  width: 19px;
  height: 2px;
  margin: 4px auto;
  border-radius: 999px;
  background: var(--color-text);
}

/* =========================
   BACKDROP
========================= */

.menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1900;

  background: rgba(32, 42, 37, 0.48);

  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  overscroll-behavior: none;

  transition:
    opacity 0.3s ease,
    visibility 0s linear 0.3s;
}

.menu-backdrop.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;

  transition:
    opacity 0.3s ease,
    visibility 0s linear 0s;
}

/* =========================
   TABLET + MOBILE
========================= */

@media (max-width: 1180px) {
  .site-header {
    z-index: 2000;
    background: rgba(255, 253, 249, 0.98);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .header-container {
    grid-template-columns: auto auto;
  }

  .site-logo,
  .site-logo img {
    width: 100px;
  }

  /* Sidebar */

  .site-nav {
    position: fixed;
    top: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 2100;

    width: min(390px, calc(100vw - 24px));
    height: auto;
    max-height: none;

    display: flex;
    flex-direction: column;

    padding: 24px;
    padding-bottom: max(24px, env(safe-area-inset-bottom));

    overflow-x: hidden;
    overflow-y: auto;

    background: #fffdf9;
    border: 1px solid rgba(232, 238, 232, 0.95);
    border-radius: 18px;

    box-shadow: -24px 24px 80px rgba(32, 42, 37, 0.22);

    transform: translate3d(calc(100% + 40px), 0, 0);
    visibility: hidden;
    pointer-events: none;

    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;

    transition:
      transform 0.34s cubic-bezier(0.22, 0.61, 0.36, 1),
      visibility 0s linear 0.34s;
  }

  .site-nav.is-open {
    transform: translate3d(0, 0, 0);
    visibility: visible;
    pointer-events: auto;

    transition:
      transform 0.34s cubic-bezier(0.22, 0.61, 0.36, 1),
      visibility 0s linear 0s;
  }

  /* Header inside sidebar */

  .mobile-menu-header {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;

    padding-bottom: 26px;
    margin-bottom: 26px;

    border-bottom: 1px solid var(--color-border);
  }

  .mobile-menu-logo {
    display: inline-flex;
    align-items: center;
  }

  .mobile-menu-logo img {
    display: block;
    width: 92px;
    height: auto;
  }

  .mobile-close {
    display: inline-flex;
    flex: 0 0 auto;
    position: relative;
    z-index: 5;

    width: 42px;
    height: 42px;

    align-items: center;
    justify-content: center;

    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;

    color: var(--color-text);
    font-family: inherit;
    font-size: 34px;
    font-weight: 400;
    line-height: 1;

    cursor: pointer;
    touch-action: manipulation;

    transition:
      color 0.2s ease,
      background-color 0.2s ease;
  }

  .mobile-close:hover {
    color: var(--color-primary);
    background: var(--color-primary-light);
  }

  .mobile-close:focus-visible {
    outline: 3px solid rgba(111, 155, 114, 0.25);
    outline-offset: 2px;
  }

  /* Mobile menu links */

  .primary-menu {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: stretch;
    gap: 18px;

    padding: 0;
    margin: 0;

    list-style: none;
  }

  .primary-menu li {
    width: 100%;
  }

  .primary-menu a {
    display: block;
    width: 100%;

    color: var(--color-text);
    font-size: 22px;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.03em;
  }

  .primary-menu a:hover,
  .primary-menu .current-menu-item > a {
    color: var(--color-primary-dark);
  }

  /* Bottom section */

  .mobile-menu-bottom {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    gap: 14px;

    margin-top: auto;
    padding-top: 26px;
    padding-bottom: max(4px, env(safe-area-inset-bottom));

    border-top: 1px solid var(--color-border);
  }

  .mobile-menu-contact {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 12px;

    color: var(--color-text);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
  }

  .mobile-menu-contact:hover {
    color: var(--color-primary-dark);
  }

  .mobile-menu-contact > span:last-child {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .mobile-menu-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 42px;
    height: 42px;

    border-radius: 50%;
    background: var(--color-primary-light);
    color: var(--color-primary-dark);

    font-size: 16px;
    font-weight: 900;
  }

  .mobile-menu-btn {
    width: 100%;
    min-width: 0;
    margin-top: 8px;
  }

  /* Header mobile */

  .header-actions {
    display: none;
  }

  .mobile-toggle {
    display: block;
    justify-self: end;
  }

  .mobile-toggle.is-active {
    opacity: 0;
    pointer-events: none;
  }

  /* Scroll lock */

  html.menu-open,
  body.menu-open {
    overflow: hidden !important;
    overscroll-behavior: none;
  }
}

/* =========================
   SMALL MOBILE
========================= */

@media (max-width: 560px) {
  .site-header {
    padding: 10px 0;
  }

  .site-logo,
  .site-logo img {
    width: 94px;
  }

  .site-nav {
    top: 12px;
    right: 12px;
    bottom: 12px;

    width: calc(100vw - 24px);

    padding: 24px;
    padding-bottom: max(24px, env(safe-area-inset-bottom));

    border-radius: 16px;
  }

  .mobile-menu-header {
    padding-bottom: 22px;
    margin-bottom: 22px;
  }

  .primary-menu {
    gap: 16px;
  }

  .primary-menu a {
    font-size: 21px;
  }

  .mobile-menu-bottom {
    gap: 12px;
    padding-top: 22px;
  }

  .mobile-menu-contact {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 11px;
    font-size: 14px;
  }

  .mobile-menu-icon {
    width: 40px;
    height: 40px;
  }
}

/* =========================
   WORDPRESS ADMIN BAR MOBILE
========================= */

@media (max-width: 782px) {
  .admin-bar .site-header {
    top: 46px;
  }
}