/* ===== Header v2: big logo, pill menu, Servicii dropdown, full-screen menu on phones. Used only when the option cb_header = 2 (or ?header=2 locally). ===== */
.hdr-v2 header.site { display: none; }
header.v2 { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--paper) 82%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line-soft); transition: box-shadow .2s ease; }
header.v2.scrolled { box-shadow: 0 18px 40px -28px rgba(0, 0, 0, .55); }
.v2-wrap { width: min(1240px, 100% - 2 * var(--pad)); margin-inline: auto; display: flex; align-items: center; justify-content: space-between; gap: 24px; }

/* top strip */
.v2-top { border-bottom: 1px solid var(--line-soft); font: 500 11px/1 var(--font-mono); letter-spacing: .18em; text-transform: uppercase; color: var(--muted); max-height: 40px; overflow: hidden; transition: max-height .25s ease, opacity .2s ease; }
.v2-top .v2-wrap { height: 40px; }
header.v2.scrolled .v2-top { max-height: 0; opacity: 0; border-bottom-width: 0; }
.v2-top a { color: var(--muted); text-decoration: none; } .v2-top a:hover { color: var(--ink); }
.v2-top-r { display: inline-flex; align-items: center; gap: 14px; }
.v2-sep { width: 1px; height: 14px; background: var(--line-soft); }
.v2-top .cbm { font-size: 12px; letter-spacing: .04em; text-transform: none; font-weight: 500; }
.v2-top .cbm-b { width: 26px; height: 26px; } .v2-top .cbm-b svg { width: 15px; height: 15px; }

/* main bar */
.v2-main .v2-wrap { height: 118px; transition: height .25s ease; }
header.v2.scrolled .v2-main .v2-wrap { height: 84px; }
.v2-logo { flex: none; display: block; width: 104px; transition: width .25s ease; }
.v2-logo img { width: 100%; height: auto; }
header.v2.scrolled .v2-logo { width: 66px; }

/* pill navigation */
.v2-nav { flex: 1; display: flex; justify-content: center; }
.v2-pill { list-style: none; margin: 0; padding: 5px; display: flex; gap: 2px; border: 1px solid var(--line-soft); border-radius: 999px; background: linear-gradient(135deg, var(--face-a), var(--face-b)); }
.v2-pill > li { position: relative; }
.v2-pill a, .v2-sub-btn { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 18px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font: 500 12px/1 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; text-decoration: none; cursor: pointer; transition: background .18s ease, color .18s ease; }
.v2-pill .no { color: var(--accent-text); font-size: 10px; letter-spacing: .1em; }
.v2-pill a:hover, .v2-sub-btn:hover, .has-sub:focus-within > .v2-sub-btn, .has-sub.open > .v2-sub-btn { background: color-mix(in srgb, var(--ink) 9%, transparent); color: var(--ink); }
.v2-pill > li > a[aria-current="page"], .v2-sub-btn.is-current { background: var(--ink); color: var(--paper); } .v2-pill > li > a[aria-current="page"] .no, .v2-sub-btn.is-current .no { color: var(--accent-hi); }
.v2-pill a:focus-visible, .v2-sub-btn:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.v2-sub-btn svg { transition: transform .2s ease; } .has-sub.open .v2-sub-btn svg { transform: rotate(180deg); }

/* dropdown */
.v2-mega { position: absolute; left: 50%; top: calc(100% + 18px); width: min(720px, 92vw); transform: translate(-50%, 8px); opacity: 0; visibility: hidden; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper-2); box-shadow: 0 40px 70px -30px rgba(0, 0, 0, .7); transition: opacity .18s ease, transform .18s ease, visibility .18s; }
.v2-mega::before { content: ""; position: absolute; left: 0; right: 0; top: -22px; height: 22px; }
.has-sub:hover > .v2-mega, .has-sub:focus-within > .v2-mega, .has-sub.open > .v2-mega { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.v2-mega-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.v2-mega-grid a { display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; height: auto; padding: 14px; border-radius: 12px; text-transform: none; letter-spacing: 0; font: 400 14px/1.3 var(--font); color: var(--ink); background: transparent; }
.v2-mega-grid a:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); }
.v2-ic { grid-row: 1 / span 2; display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line-soft); border-radius: 12px; color: var(--ink); background: var(--paper); }
.v2-ic svg { width: 26px; height: 26px; }
.v2-mega-grid b { font-weight: 600; font-size: 15px; } .v2-mega-grid span:not(.v2-ic) { color: var(--muted); font-size: 13px; }
.v2-mega-all { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; padding: 14px 16px; height: auto; border-top: 1px solid var(--line-soft); border-radius: 0 0 10px 10px; color: var(--accent-text); font: 500 12px/1 var(--font-mono); letter-spacing: .16em; text-transform: uppercase; }

/* actions */
.v2-actions { flex: none; display: flex; align-items: center; gap: 12px; }
.v2-burger { display: none; width: 46px; height: 46px; padding: 0; border-radius: 12px; align-items: center; justify-content: center; flex-direction: column; gap: 5px; }
.v2-burger i { display: block; width: 20px; height: 1.6px; background: var(--ink); transition: transform .2s ease, opacity .2s ease; }
.v2-burger[aria-expanded="true"] i:nth-child(1) { transform: translateY(6.6px) rotate(45deg); } .v2-burger[aria-expanded="true"] i:nth-child(2) { opacity: 0; } .v2-burger[aria-expanded="true"] i:nth-child(3) { transform: translateY(-6.6px) rotate(-45deg); }

/* tablet and phone: full-screen menu */
@media (max-width: 1080px) {
  .v2-top { display: none; }
  .v2-main .v2-wrap, header.v2.scrolled .v2-main .v2-wrap { height: 88px; }
  .v2-logo { width: 78px; } header.v2.scrolled .v2-logo { width: 62px; }
  .v2-burger { display: inline-flex; } .v2-cta { display: none; }
  .v2-nav { position: fixed; inset: 88px 0 0 0; z-index: 29; display: none; align-items: flex-start; justify-content: stretch; padding: 22px var(--pad) 40px; overflow-y: auto; background: var(--paper); background-image: radial-gradient(60% 40% at 90% 0%, var(--glow), transparent 70%); }
  .v2-nav.open { display: flex; }
  .v2-pill { flex-direction: column; width: 100%; padding: 0; gap: 0; border: 0; border-radius: 0; background: none; }
  .v2-pill > li { border-bottom: 1px solid var(--line-soft); }
  .v2-pill a, .v2-sub-btn { width: 100%; height: auto; padding: 22px 4px; border-radius: 0; font: 300 clamp(26px, 8vw, 38px)/1.1 var(--font); letter-spacing: -.01em; text-transform: none; color: var(--ink); justify-content: flex-start; gap: 18px; }
  .v2-pill .no { font: 500 12px/1 var(--font-mono); letter-spacing: .2em; width: 26px; }
  .v2-sub-btn svg { margin-left: auto; width: 18px; height: 18px; }
  .v2-pill a:hover, .v2-sub-btn:hover { background: none; }
  .v2-pill a[aria-current="page"], .v2-sub-btn.is-current { background: none; color: var(--accent-text); }
  .v2-mega { position: static; width: 100%; transform: none; opacity: 1; visibility: visible; display: none; padding: 4px 0 18px; border: 0; border-radius: 0; background: none; box-shadow: none; }
  .v2-mega::before { display: none; }
  .has-sub:hover > .v2-mega, .has-sub:focus-within > .v2-mega { opacity: 1; transform: none; }
  .has-sub.open > .v2-mega { display: block; transform: none; }
  .v2-mega-grid { grid-template-columns: 1fr; gap: 0; }
  .v2-mega-grid a { grid-template-columns: 40px 1fr; padding: 12px 4px; border-radius: 0; }
  .v2-mega-grid a .v2-ic { width: 40px; height: 40px; }
  .v2-pill > li:last-child a::after { content: "→"; margin-left: auto; color: var(--accent-text); }
}
@media (prefers-reduced-motion: reduce) { header.v2, .v2-top, .v2-main .v2-wrap, .v2-logo, .v2-mega { transition: none; } }

/* dropdown centred under the whole pill (stays inside the screen) */
@media (min-width: 1081px) { .v2-pill { position: relative; } .v2-pill > li.has-sub { position: static; } .v2-mega { width: min(720px, 94vw); } }

/* sticky: the template-part wrapper is the sticky element (its parent is the whole page) */
.hdr-v2 .wp-site-blocks > .wp-block-template-part:first-child { position: sticky; top: 0; z-index: 30; }
.hdr-v2 header.v2 { position: relative; }
/* the blur creates a containing block for fixed children and would trap the full-screen menu: no blur on tablet and phone */
@media (max-width: 1080px) { header.v2 { backdrop-filter: none; background: var(--paper); } }

/* ===== stable scrolling: the header never changes height (no layout shift, no flicker) ===== */
.hdr-v2 .wp-site-blocks > .wp-block-template-part:first-child { top: -41px; }   /* the top strip (40px + 1px border) slides out of view */
.v2-top, header.v2.scrolled .v2-top { max-height: none; opacity: 1; border-bottom-width: 1px; transition: none; }
.v2-main .v2-wrap, header.v2.scrolled .v2-main .v2-wrap { height: 96px; transition: none; }
.v2-logo, header.v2.scrolled .v2-logo { width: 92px; transform-origin: left center; transition: transform .25s ease; }
header.v2.scrolled .v2-logo { transform: scale(.78); }
@media (max-width: 1080px) {
  .hdr-v2 .wp-site-blocks > .wp-block-template-part:first-child { top: 0; }
  .v2-main .v2-wrap, header.v2.scrolled .v2-main .v2-wrap { height: 88px; }
  .v2-logo, header.v2.scrolled .v2-logo { width: 78px; }
  header.v2.scrolled .v2-logo { transform: scale(.82); }
}

/* no top strip; no bottom line until the page is scrolled */
.hdr-v2 .wp-site-blocks > .wp-block-template-part:first-child { top: 0; }
header.v2 { border-bottom-color: transparent; background: transparent; backdrop-filter: none; }
header.v2.scrolled { border-bottom-color: var(--line-soft); background: color-mix(in srgb, var(--paper) 86%, transparent); backdrop-filter: blur(14px); }
@media (max-width: 1080px) { header.v2 { background: transparent; } header.v2.scrolled { background: var(--paper); backdrop-filter: none; } .v2-nav { background-color: var(--paper); } }

/* dropdown: current service = soft highlight with an orange marker; text colours stay readable in both themes */
.v2-mega-grid a[aria-current="page"] { background: color-mix(in srgb, var(--accent) 12%, transparent); box-shadow: inset 3px 0 0 var(--accent); color: var(--ink); }
.v2-mega-grid a[aria-current="page"] span:not(.v2-ic) { color: var(--ink); opacity: .78; }
.v2-mega-grid a:hover span:not(.v2-ic) { color: var(--ink); }
.v2-mega-grid a { color: var(--ink); }
@media (max-width: 1080px) { .v2-pill > li > a[aria-current="page"], .v2-sub-btn.is-current { background: none; color: var(--accent-text); } .v2-mega-grid a[aria-current="page"] { background: none; box-shadow: none; } .v2-mega-grid a[aria-current="page"] b { color: var(--accent-text); } }
