/* ------------------------------------------------------------------
   krupkin.pro - header-v2 (variant B), 2026-09
   Every selector is prefixed .hv2 (see BUILD-SPEC.md). Loaded only when
   the ?hv2=1 preview gate is on, as the LAST stylesheet in <head>.

   Fonts: reuses the theme's EXISTING HelveticaNeueCyr woff files (no new
   font files added) - they already ship in homepage_new/fonts/ but that
   folder's own @font-face sheet (homepage_new/css/fonts.css) is only
   linked on the two homepage templates (confirmed empirically: 0 bytes
   of "HelveticaNeueCyr" reach the raw HTML of the service/blog/case
   templates). Declaring the same two weights here guarantees the font
   is available on every template the header renders on, not just home.
   ------------------------------------------------------------------ */

@font-face {
  font-family: "HelveticaNeueCyr";
  src: url("/wp-content/themes/krupkin/homepage_new/fonts/HelveticaNeueCyr-Roman.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "HelveticaNeueCyr";
  src: url("/wp-content/themes/krupkin/homepage_new/fonts/HelveticaNeueCyr-Heavy.woff") format("woff");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

/* ---------- root / bar ---------- */
.hv2, .hv2 *, .hv2 *::before, .hv2 *::after,
.hv2-bottom-cta, .hv2-bottom-cta *, .hv2-bottom-cta *::before, .hv2-bottom-cta *::after {
  box-sizing: border-box;
}
.hv2 {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000; /* below Bootstrap modal (1040/1050), below .pre-loader (9999) */
  font-family: "HelveticaNeueCyr", Helvetica, Arial, sans-serif;
}
body.admin-bar .hv2 { top: 32px; }
@media (max-width: 782px) {
  body.admin-bar .hv2 { top: 46px; }
}

.hv2-skip {
  position: fixed;
  top: -100px; left: 16px;
  z-index: 1001;
  background: #B44336;
  color: #fff;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-family: "HelveticaNeueCyr", Helvetica, Arial, sans-serif;
  text-decoration: none;
  transition: top .15s cubic-bezier(.4,0,.2,1);
}
.hv2-skip:focus { top: 16px; }
.hv2-skip:focus-visible { outline: 3px solid rgba(220,82,66,.45); outline-offset: 2px; }

.hv2__bar {
  position: relative;
  height: 76px;
  background: #0E0E0E;
  display: flex;
  align-items: center;
  transition: height .18s cubic-bezier(.4,0,.2,1);
  border-bottom: 1px solid transparent;
}
.hv2.hv2--compact .hv2__bar {
  height: 60px;
  border-bottom-color: #2A2A2A;
}
.hv2__container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.hv2__logo { display: block; line-height: 0; flex: none; }
.hv2__logo img { width: 171px; height: 20px; display: block; }

/* ---------- desktop nav ---------- */
/* Client feedback 2026-09-22: the logo ran into the first menu item.
   Nav is centered in the space between the logo and the lang+CTA block,
   with a hard minimum gap on both sides. */
.hv2-nav { display: flex; align-items: center; justify-content: center; gap: 28px; flex: 1; margin-inline: 48px; }
@media (max-width: 1199px) { .hv2-nav { margin-inline: 28px; gap: 22px; } }
.hv2-nav__item { position: relative; }
/* The mega panel is anchored to the whole bar, not the trigger (BUILD-SPEC),
   so its own nav item must NOT be the positioning context - it needs to fall
   through to .hv2__bar (position:relative, full width) for left:50% to
   center correctly. Without this the panel centers on the narrow "Послуги"
   item near the left edge and renders mostly off-screen. */
.hv2-nav__item--mega { position: static; }
.hv2-nav__link, .hv2-nav__trigger {
  font-family: inherit;
  font-weight: 400;
  font-size: 15px;
  line-height: 1;
  color: rgba(255,255,255,.8);
  background: none;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  position: relative;
  text-decoration: none;
  white-space: nowrap;
}
.hv2-nav__link:hover, .hv2-nav__trigger:hover,
.hv2-nav__item.is-open > .hv2-nav__trigger { color: #fff; }
.hv2-nav__link::after, .hv2-nav__trigger::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 1px;
  background: #fff;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .18s cubic-bezier(.4,0,.2,1);
}
.hv2-nav__link:hover::after, .hv2-nav__trigger:hover::after,
.hv2-nav__item.is-open > .hv2-nav__trigger::after { transform: scaleX(1); }

.hv2-chev { color: #8C8C8C; transition: transform .18s cubic-bezier(.4,0,.2,1); flex: none; }
.hv2-nav__item.is-open > .hv2-nav__trigger .hv2-chev,
.hv2-nav__item.is-open > .hv2-chev { transform: rotate(180deg); }

.hv2-right { display: flex; align-items: center; gap: 20px; flex: none; }

/* ---------- small dropdowns (Про Бюро / О Бюро, language) ---------- */
.hv2-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 300px;
  background: #1B1B1B;
  border: 1px solid #2A2A2A;
  border-radius: 10px;
  padding: 8px;
  box-shadow: 0 18px 48px rgba(0,0,0,.45);
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity .18s cubic-bezier(.4,0,.2,1), transform .18s cubic-bezier(.4,0,.2,1);
  z-index: 5;
}
.hv2-nav__item.is-open > .hv2-dropdown {
  opacity: 1; transform: translateY(0); pointer-events: auto;
}
/* Client feedback 2026-09-22: short UA / ru labels, so the panel shrinks to fit them. */
.hv2-dropdown--right { left: auto; right: 0; min-width: 132px; }

.hv2-dd-item { display: block; padding: 10px 14px; border-radius: 6px; text-decoration: none; }
.hv2-dd-item:hover, .hv2-dd-item:focus-visible { background: #262626; }
.hv2-dd-item__title { font-size: 15px; color: #fff; display: flex; align-items: center; gap: 4px; }
.hv2-dd-item__desc { font-size: 13px; color: #9A9A9A; margin-top: 2px; }
.hv2-ext { font-size: 12px; color: #8C8C8C; }

.hv2-lang-dd .hv2-lang__trigger { gap: 8px; min-height: 44px; }
.hv2-globe { color: #8C8C8C; flex: none; }
.hv2-dd-lang {
  display: flex; align-items: center; gap: 12px;
  min-height: 44px; padding: 10px 14px; border-radius: 6px;
  text-decoration: none; color: #fff; font-size: 15px;
}
.hv2-dd-lang:hover, .hv2-dd-lang:focus-visible { background: #262626; }
.hv2-acc__label { display: inline-flex; align-items: center; gap: 10px; }
.hv2-flag { display: inline-flex; flex: none; line-height: 0; border-radius: 2px; overflow: hidden; }
.hv2-flag--plain { box-shadow: inset 0 0 0 1px #3A3A3A; }
.hv2-lang__trigger .hv2-flag { margin-right: 2px; }
.hv2-dd-lang__code { font-weight: 900; font-size: 12px; letter-spacing: .06em; color: #8C8C8C; width: 22px; flex: none; }
.hv2-dd-lang__check { margin-left: auto; flex: none; }

/* ---------- mega "Послуги"/"Услуги" ---------- */
.hv2-mega {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  width: min(1200px, 100vw - 48px);
  background: #1B1B1B;
  border-top: 1px solid #2A2A2A;
  border-radius: 0 0 16px 16px;
  padding: 32px;
  box-shadow: 0 18px 48px rgba(0,0,0,.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s cubic-bezier(.4,0,.2,1), transform .18s cubic-bezier(.4,0,.2,1);
  z-index: 5;
}
.hv2-nav__item.is-open > .hv2-mega {
  opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto;
}
.hv2-mega__grid { display: grid; grid-template-columns: 1fr 1fr 1fr 1.1fr; gap: 32px; }
.hv2-mega__col-head {
  font-weight: 900; font-size: 12px; text-transform: uppercase;
  letter-spacing: .14em; color: #8C8C8C; margin-bottom: 10px;
}
.hv2-mega__col-head a { color: inherit; text-decoration: none; }
.hv2-mega__col-head a:hover { color: #fff; }
.hv2-mega__featured { background: #262626; border-radius: 10px; padding: 20px; }
.hv2-mega__featured-label { font-size: 12px; text-transform: uppercase; color: #8C8C8C; margin-bottom: 10px; }
.hv2-mega__featured-name { font-size: 15px; color: #fff; margin-bottom: 6px; }
.hv2-mega__featured-num {
  font-weight: 900; font-size: 44px; color: #fff; margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}
.hv2-mega__featured-sub { font-size: 13px; color: #C4C4C4; margin-bottom: 14px; }
.hv2-mega__featured-link { font-size: 14px; color: #fff; text-decoration: none; border-bottom: 1px solid #2A2A2A; }
.hv2-mega__case + .hv2-mega__case { margin-top: 18px; padding-top: 18px; border-top: 1px solid #3A3A3A; }
.hv2-mega__case .hv2-mega__featured-num { font-size: 32px; }
.hv2-mega__case .hv2-mega__featured-sub { margin-bottom: 10px; }
.hv2-mega__divider { border: none; border-top: 1px solid #3A3A3A; margin: 16px 0; }
.hv2-mega__uba-title { font-weight: 900; font-size: 14px; color: #fff; margin-bottom: 4px; }
.hv2-mega__uba-sub { font-size: 13px; color: #9A9A9A; }
.hv2-mega__footer {
  grid-column: 1 / -1;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px; border-top: 1px solid #2A2A2A; padding-top: 16px; margin-top: 8px;
}
.hv2-mega__footer-left { font-size: 14px; color: #fff; }
.hv2-mega__footer-left a { color: #fff; margin-left: 8px; text-decoration: underline; }
.hv2-mega__footer-right a { font-size: 14px; color: #fff; text-decoration: none; border-bottom: 1px solid #2A2A2A; }

/* ---------- CTA ---------- */
.hv2-cta {
  display: inline-flex; align-items: center; justify-content: center;
  height: 44px; padding-inline: 22px; border-radius: 999px;
  /* Client feedback 2026-09-22: match the site's own buttons - brand coral, not the
     darkened #B44336, and Roman 400 instead of Black 900 (the site uses 400-500). */
  background: #DC5242; color: #fff; font-weight: 400; font-size: 16px;
  text-decoration: none; white-space: nowrap; font-family: inherit;
  transition: background .18s cubic-bezier(.4,0,.2,1), transform .18s cubic-bezier(.4,0,.2,1);
  border: none; cursor: pointer;
}
.hv2-cta:hover { background: #B44336; color: #fff; }
.hv2-cta:active { transform: translateY(1px); }
.hv2-cta--block { width: 100%; }

/* ---------- burger ---------- */
.hv2-burger {
  width: 44px; height: 44px; position: relative;
  background: none; border: none; cursor: pointer; flex: none;
  display: none;
}
.hv2-burger span {
  position: absolute; left: 12px; right: 12px; height: 2px; background: #fff;
  transition: transform .18s cubic-bezier(.4,0,.2,1), opacity .18s cubic-bezier(.4,0,.2,1);
}
.hv2-burger span:nth-child(1) { top: 16px; }
.hv2-burger span:nth-child(2) { top: 22px; }
.hv2-burger span:nth-child(3) { top: 28px; }
.hv2-burger.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.hv2-burger.is-open span:nth-child(2) { opacity: 0; }
.hv2-burger.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---------- responsive: desktop nav >=1024px, mobile below ---------- */
@media (min-width: 1024px) {
  .hv2-burger { display: none !important; }
  .hv2-mobile-panel { display: none !important; }
}
@media (max-width: 1023.98px) {
  .hv2__bar { height: 60px !important; border-bottom-color: transparent !important; }
  .hv2__container { padding-inline: 16px; }
  .hv2__logo img { width: 140px; height: 16px; }
  .hv2-nav { display: none; }
  .hv2-right { display: none; }
  .hv2-burger { display: block; }
}

/* ---------- mobile full-screen panel ---------- */
.hv2-mobile-panel {
  position: fixed;
  top: 60px; left: 0; right: 0; bottom: 0;
  background: #0E0E0E;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: none;
  z-index: 999;
}
.hv2-mobile-panel.is-open { display: block; }
body.hv2-menu-open { overflow: hidden; }
body.admin-bar .hv2-mobile-panel { top: 92px; }
@media (max-width: 782px) {
  body.admin-bar .hv2-mobile-panel { top: 106px; }
}

.hv2-mobile-row {
  display: flex; align-items: center; min-height: 56px;
  padding-inline: 16px; border-bottom: 1px solid #2A2A2A;
  color: #fff; text-decoration: none; font-size: 15px;
}
.hv2-acc__trigger {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  min-height: 56px; padding-inline: 16px; border: none; background: none;
  color: #fff; font-size: 15px; cursor: pointer; font-family: inherit;
  border-bottom: 1px solid #2A2A2A; text-align: left;
}
.hv2-acc__panel {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows .18s cubic-bezier(.4,0,.2,1);
  background: #0E0E0E;
}
.hv2-acc__panel-inner { overflow: hidden; min-height: 0; }
.hv2-acc__trigger[aria-expanded="true"] + .hv2-acc__panel { grid-template-rows: 1fr; }
.hv2-acc__item {
  display: block; padding: 10px 16px 10px 28px;
  text-decoration: none; border-bottom: 1px solid #2A2A2A;
}
.hv2-acc__item .hv2-dd-item__title { font-size: 14px; }
.hv2-acc__item .hv2-dd-item__desc { margin-bottom: 0; }
/* round 5 (client report 2026-09-16): language rows inside the mobile accordion keep the flex row layout */
.hv2-acc__item.hv2-dd-lang { display: flex; align-items: center; gap: 10px; }
/* chevrons flip on any expanded trigger (desktop dropdowns + mobile accordions) */
.hv2-nav__trigger[aria-expanded="true"] .hv2-chev,
.hv2-acc__trigger[aria-expanded="true"] .hv2-chev { transform: rotate(180deg); }
/* third-party Ringostat launcher must not sit on top of the open mobile menu */
body.hv2-menu-open .rngst_phone_button.dropdownMessengers { visibility: hidden !important; }

/* QA 2026-09-18: case links in the mobile panel were 14px tall (min touch target 44px) */
.hv2-mobile-case .hv2-mega__featured-link { display: inline-flex; align-items: center; min-height: 44px; }
.hv2-mobile-case { margin: 16px; background: #262626; border-radius: 10px; padding: 16px; }
.hv2-mobile-case .hv2-mega__featured-num { font-size: 32px; }

.hv2-mobile-cta-wrap {
  position: sticky; bottom: 0; background: #0E0E0E;
  padding: 16px; border-top: 1px solid #2A2A2A;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 1;
}
/* expanded accordion panels scroll clear of the pinned CTA */
.hv2-mobile-panel .hv2-acc__panel { scroll-margin-bottom: calc(112px + env(safe-area-inset-bottom, 0px)); }

/* ---------- mobile fixed bottom CTA bar ---------- */
.hv2-bottom-cta {
  position: fixed; left: 0; right: 0; bottom: 0;
  height: calc(64px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: #0E0E0E;
  border-top: 1px solid #2A2A2A;
  display: flex; align-items: center; padding-inline: 16px;
  z-index: 998; /* below the mobile panel (999) and below .hv2 (1000) */
  transform: translateY(100%);
  transition: transform .18s cubic-bezier(.4,0,.2,1);
  font-family: "HelveticaNeueCyr", Helvetica, Arial, sans-serif;
}
.hv2-bottom-cta.is-visible { transform: translateY(0); }
.hv2-bottom-cta .hv2-cta { height: 44px; }
@media (min-width: 1024px) {
  .hv2-bottom-cta { display: none !important; }
}
body.hv2-menu-open .hv2-bottom-cta { display: none; }

/* Collision guard: lift the Ringostat "Є питання? Зв'яжіться з нами" call/
   messenger launcher above the bottom CTA bar while it is visible, instead
   of letting the bar cover it. Verified live (mobile viewport, 3 templates)
   as the only fixed/sticky bottom-anchored widget on the sampled pages;
   its own "bottom" offset differs slightly across templates (-15px on
   home/blog, ~37px on the case template), so an ADDITIVE translateY is
   used instead of overriding "bottom" to a hardcoded value. !important is
   needed because the widget's positioning comes from a third-party
   stylesheet we do not control and cannot guarantee load order against. */
body.hv2-bar-on .rngst_phone_button.dropdownMessengers {
  transform: translateY(calc(-1 * (64px + env(safe-area-inset-bottom, 0px)))) !important;
}

/* ---------- reduced motion / focus ring ---------- */
@media (prefers-reduced-motion: reduce) {
  .hv2, .hv2 *, .hv2-bottom-cta, .hv2-bottom-cta * {
    transition-duration: .001ms !important;
    animation-duration: .001ms !important;
  }
}
.hv2 :focus-visible, .hv2-bottom-cta :focus-visible {
  outline: 3px solid rgba(220,82,66,.45);
  outline-offset: 2px;
}

/* ---------- spacer ---------- */
.hv2-spacer { height: 76px; }
@media (max-width: 1023.98px) {
  .hv2-spacer { height: 60px; }
}
body.admin-bar .hv2-spacer { margin-top: 32px; }
@media (max-width: 782px) {
  body.admin-bar .hv2-spacer { margin-top: 46px; }
}
