:root {
  --hestya-header-height: 82px;
  --hestya-topbar-bg: #101317;
  --hestya-topbar-text: rgba(255, 255, 255, 0.8);
  --hestya-topbar-link: #ffffff;
  --hestya-header-bg: rgba(255, 255, 255, 0.96);
  --hestya-header-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
  --hestya-header-shadow-stuck: 0 16px 36px rgba(15, 23, 42, 0.12);
  --hestya-footer-bg: #0f141a;
}

.hestya-shell {
  width: min(var(--hestya-shell-max-width), calc(100vw - var(--hestya-shell-gutter-desktop)));
  max-width: none;
  margin: 0 auto;
  box-sizing: border-box;
}

.hestya-topbar,
.hestya-header {
  width: 100%;
}

.hestya-topbar .hestya-shell,
.hestya-header .hestya-shell {
  width: min(var(--hestya-shell-max-width), calc(100% - var(--hestya-shell-gutter-desktop)));
}

.hestya-topbar {
  display: none;
  background:
    linear-gradient(90deg, rgba(16, 19, 23, 0.98) 0%, rgba(21, 27, 35, 0.98) 100%);
  color: var(--hestya-topbar-text);
  font-size: 0.875rem;
}

.hestya-topbar__inner,
.hestya-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.hestya-topbar__inner {
  min-height: 44px;
}

.hestya-topbar__start,
.hestya-topbar__links,
.hestya-header-actions,
.hestya-primary-nav__menu {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.hestya-topbar__phone,
.hestya-topbar__nav a {
  color: var(--hestya-topbar-link);
}

.hestya-topbar__phone,
.hestya-header__phone,
.hestya-mobile-nav__phone,
.hestya-footer__contact-list a {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
}

.hestya-topbar__phone:hover,
.hestya-topbar__nav a:hover,
.hestya-primary-nav a:hover,
.hestya-footer a:hover {
  color: var(--hestya-color-accent);
}

.hestya-topbar__text {
  margin: 0;
  color: var(--hestya-topbar-text);
}

.hestya-topbar__links,
.hestya-primary-nav__menu,
.hestya-mobile-nav__list,
.hestya-footer__menu,
.hestya-footer__contact-list,
.hestya-footer-bottom__menu {
  margin: 0;
  padding: 0;
  list-style: none;
}

.hestya-topbar__nav a,
.hestya-primary-nav a,
.hestya-footer__menu a,
.hestya-footer-bottom__menu a {
  text-decoration: none;
}

.hestya-topbar__links li + li {
  position: relative;
  padding-left: 1rem;
}

.hestya-topbar__links li + li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 1px;
  height: 0.875rem;
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-50%);
}

.hestya-topbar__icon,
.hestya-header__action-icon,
.hestya-footer__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.125rem;
  height: 1.125rem;
}

.hestya-topbar__icon svg,
.hestya-header__action-icon svg,
.hestya-footer__icon svg,
.hestya-header__icon-link svg,
.hestya-mobile-nav__close svg,
.hestya-mobile-nav__phone svg,
.hestya-mobile-nav__submenu-toggle svg {
  display: block;
  width: 100%;
  height: 100%;
}

.hestya-header {
  position: relative;
  z-index: 40;
  background: var(--hestya-header-bg);
  border-bottom: 1px solid var(--hestya-color-border);
  backdrop-filter: blur(14px);
}

.hestya-header--sticky {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
}

.hestya-header.is-stuck {
  box-shadow: var(--hestya-header-shadow-stuck);
}

.hestya-header__inner {
  min-height: var(--hestya-header-height);
}

.hestya-header__branding {
  display: flex;
  align-items: center;
  min-width: 0;
}

.hestya-header__branding .custom-logo-link,
.hestya-footer__logo-wrap .custom-logo-link {
  display: inline-flex;
  align-items: center;
}

.hestya-header__branding .custom-logo,
.hestya-footer__logo-wrap .custom-logo {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 56px;
}

.hestya-header__site-title,
.hestya-footer__site-title {
  color: var(--hestya-color-text-strong);
  font-size: 1.25rem;
  font-weight: 700;
  text-decoration: none;
}

.hestya-primary-nav {
  display: none;
  flex: 1 1 auto;
  min-width: 0;
  justify-content: center;
}

.hestya-primary-nav__menu > li {
  position: relative;
  padding-bottom: 0.625rem;
  margin-bottom: -0.625rem;
}

.hestya-primary-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--hestya-color-text-strong);
  font-weight: 600;
  white-space: nowrap;
}

.hestya-primary-nav .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  margin: 0;
  padding: 1.375rem 0 0.75rem;
  list-style: none;
  background: #ffffff;
  border: 1px solid var(--hestya-color-border);
  border-radius: 18px;
  box-shadow: var(--hestya-header-shadow);
  background-clip: padding-box;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  transform: translateY(8px);
}

.hestya-primary-nav li:hover > .sub-menu,
.hestya-primary-nav li:focus-within > .sub-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.hestya-primary-nav .sub-menu a {
  display: block;
  min-height: auto;
  padding: 0.625rem 1rem;
}

.hestya-header-actions {
  flex-wrap: nowrap;
  flex: 0 0 auto;
  gap: 0.75rem;
}

.hestya-header__phone,
.hestya-header__cta,
.hestya-header__icon-link,
.hestya-header__menu-toggle,
.hestya-mobile-nav__close,
.hestya-mobile-nav__cta,
.hestya-footer__cta {
  border-radius: 999px;
}

.hestya-header__phone,
.hestya-header__cta,
.hestya-header__icon-link,
.hestya-header__menu-toggle,
.hestya-mobile-nav__close,
.hestya-mobile-nav__cta,
.hestya-footer__cta {
  min-height: 46px;
  border: 1px solid transparent;
}

.hestya-header__phone {
  padding: 0 1rem;
  background: var(--hestya-color-surface-soft);
  color: var(--hestya-color-text-strong);
  font-weight: 600;
  white-space: nowrap;
}

.hestya-header__cta,
.hestya-mobile-nav__cta,
.hestya-footer__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 1.25rem;
  background: var(--hestya-color-accent);
  box-shadow: var(--hestya-shadow-button);
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.hestya-header__cta:hover,
.hestya-mobile-nav__cta:hover,
.hestya-footer__cta:hover {
  color: #ffffff;
  background: var(--hestya-color-accent-strong);
}

.hestya-header__icon-link,
.hestya-header__menu-toggle,
.hestya-mobile-nav__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0 0.95rem;
  background: #ffffff;
  color: var(--hestya-color-text-strong);
  cursor: pointer;
}

.hestya-header__icon-link,
.hestya-header__cart a,
.hestya-header__cart button {
  min-width: 46px;
}

.hestya-header__cart {
  display: inline-flex;
  align-items: center;
}

.hestya-header__cart .cart-contents,
.hestya-header__cart .site-header-cart a,
.hestya-header__cart .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 0.95rem;
  background: #ffffff;
  border: 1px solid var(--hestya-color-border);
  border-radius: 999px;
  color: var(--hestya-color-text-strong);
  text-decoration: none;
  white-space: nowrap;
}

.hestya-header__menu-toggle {
  margin-left: 0.25rem;
}

.hestya-mobile-nav {
  position: fixed;
  inset: 0;
  height: 100dvh;
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.24s ease, visibility 0s linear 0.24s;
}

.hestya-mobile-nav[hidden] {
  display: none;
}

.hestya-mobile-nav.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}

.hestya-mobile-nav__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 12, 20, 0.56);
  opacity: 0;
  transition: opacity 0.28s ease;
}

.hestya-mobile-nav__panel {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  z-index: 1;
  width: min(calc(100vw - 0.5rem), 420px);
  max-width: calc(100vw - 0.5rem);
  min-height: 100dvh;
  padding: 1rem 1rem 1.125rem;
  background: #ffffff;
  border-radius: 28px 0 0 28px;
  box-shadow: var(--hestya-header-shadow);
  overflow-y: auto;
  transform: translate3d(24px, 0, 0) scale(0.985);
  transform-origin: right center;
  opacity: 0;
  transition:
    transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.22s ease;
  will-change: transform, opacity;
}

.hestya-mobile-nav.is-open .hestya-mobile-nav__backdrop {
  opacity: 1;
}

.hestya-mobile-nav.is-open .hestya-mobile-nav__panel {
  transform: translate3d(0, 0, 0) scale(1);
  opacity: 1;
}

.hestya-mobile-nav__header,
.hestya-mobile-nav__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.hestya-mobile-nav__header {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--hestya-color-border);
}

.hestya-mobile-nav__title {
  color: var(--hestya-color-text-strong);
  font-size: 1rem;
  font-weight: 700;
}

.hestya-mobile-nav__close {
  width: 46px;
  padding: 0;
  background: var(--hestya-color-surface-muted);
}

.hestya-mobile-nav__menu {
  padding: 1rem 0 0.5rem;
}

.hestya-mobile-nav__list > li {
  border-bottom: 1px solid var(--hestya-color-border);
}

.hestya-mobile-nav__list a {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 0.95rem 3.75rem 0.95rem 0;
  color: var(--hestya-color-text-strong);
  font-weight: 600;
  text-decoration: none;
}

.hestya-mobile-nav__list .menu-item-has-children {
  position: relative;
}

.hestya-mobile-nav__submenu-toggle {
  position: absolute;
  top: 0.35rem;
  right: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--hestya-color-text-strong);
  cursor: pointer;
}

.hestya-mobile-nav__submenu-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.hestya-mobile-nav__submenu-toggle svg {
  width: 1.25rem;
  height: 1.25rem;
  transition: transform 0.2s ease;
}

.hestya-mobile-nav .sub-menu {
  display: block;
  max-height: 0;
  margin: 0;
  padding: 0.25rem 0 0.25rem 1rem;
  list-style: none;
  border-left: 1px solid var(--hestya-color-border);
  opacity: 0;
  overflow: hidden;
  transition:
    max-height 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.18s ease;
}

.hestya-mobile-nav .menu-item-has-children.is-open > .sub-menu {
  max-height: 520px;
  margin: 0 0 0.75rem;
  opacity: 1;
}

.hestya-mobile-nav .sub-menu > li:first-child {
  padding-top: 0.15rem;
}

.hestya-mobile-nav .sub-menu a {
  width: 100%;
  min-height: 42px;
  padding: 0.75rem 0;
  font-weight: 500;
}

.hestya-mobile-nav__footer {
  gap: 0.875rem;
  flex-direction: column;
  align-items: stretch;
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--hestya-color-border);
}

.hestya-mobile-nav__phone {
  min-height: 46px;
  padding: 0.875rem 1.1rem;
  border: 1px solid var(--hestya-color-border);
  border-radius: 999px;
  color: var(--hestya-color-text-strong);
  font-weight: 600;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  justify-content: flex-start;
  align-items: center;
  gap: 0.85rem;
}

.hestya-mobile-nav__phone svg {
  flex: 0 0 1.65rem;
  width: 1.65rem;
  height: 1.65rem;
}

.hestya-mobile-nav__phone span:last-child {
  display: block;
  font-size: 1.05rem;
  line-height: 1.3;
}

body.hestya-mobile-nav-open {
  overflow: hidden;
}

.hestya-header a:focus-visible,
.hestya-topbar a:focus-visible,
.hestya-mobile-nav a:focus-visible,
.hestya-mobile-nav button:focus-visible,
.hestya-footer a:focus-visible {
  outline: 3px solid var(--hestya-color-accent-focus);
  outline-offset: 2px;
}

@media (min-width: 768px) {
  .hestya-topbar {
    display: block;
  }
}

@media (min-width: 1100px) {
  .hestya-header__inner {
    gap: clamp(0.85rem, 1vw, 1.5rem);
  }

  .hestya-primary-nav {
    display: flex;
  }

  .hestya-primary-nav__menu {
    flex-wrap: nowrap;
    gap: clamp(0.8rem, 1vw, 1.45rem);
  }

  .hestya-primary-nav a {
    font-size: clamp(0.94rem, 0.78rem + 0.18vw, 1.08rem);
    letter-spacing: -0.01em;
  }

  .hestya-header__phone {
    padding-inline: 0.9rem;
    font-size: 0.98rem;
  }

  .hestya-header__cta {
    padding-inline: 1.15rem;
  }

  .hestya-header__menu-toggle,
  .hestya-mobile-nav {
    display: none;
  }
}

@media (min-width: 1100px) and (max-width: 1320px) {
  .hestya-header-actions {
    gap: 0.55rem;
  }

  .hestya-header__phone,
  .hestya-header__cta,
  .hestya-header__icon-link,
  .hestya-header__cart .cart-contents,
  .hestya-header__cart .site-header-cart a,
  .hestya-header__cart .button {
    min-height: 44px;
  }
}

@media (max-width: 1279px) {
  .hestya-shell {
    width: min(var(--hestya-shell-max-width-tablet), calc(100vw - var(--hestya-shell-gutter-tablet)));
  }

  .hestya-topbar .hestya-shell,
  .hestya-header .hestya-shell {
    width: min(var(--hestya-shell-max-width-tablet), calc(100% - var(--hestya-shell-gutter-tablet)));
  }
}

@media (max-width: 1099px) {
  .hestya-header__phone,
  .hestya-header__cta {
    display: none;
  }
}

@media (max-width: 767px) {
  .hestya-shell {
    width: calc(100vw - var(--hestya-shell-gutter-mobile));
  }

  .hestya-topbar .hestya-shell,
  .hestya-header .hestya-shell {
    width: calc(100% - var(--hestya-shell-gutter-mobile));
  }

  .hestya-header__inner {
    min-height: 74px;
  }

  .hestya-header__branding .custom-logo {
    max-height: 48px;
  }

  .hestya-header-actions {
    gap: 0.5rem;
  }

  .hestya-header__icon-link,
  .hestya-header__cart .cart-contents,
  .hestya-header__cart .site-header-cart a,
  .hestya-header__cart .button,
  .hestya-header__menu-toggle {
    padding: 0 0.8rem;
  }

  .hestya-header__menu-toggle span:last-child {
    display: none;
  }
}
