/* Header site — Divizia 2 „Getica" */
.d2ih { width: 100%; box-sizing: border-box; }
.d2ih--sticky { position: sticky; top: 0; z-index: 100; }
.d2ih--shadow { box-shadow: var(--shadow-md, 0 4px 12px rgba(20,23,26,.1)); }
.d2ih__wrap { max-width: var(--container-max, 1200px); margin: 0 auto; padding: 0 24px; }
.d2ih__tricolor { height: 4px; background: var(--tricolor, linear-gradient(90deg,#002b7f 0 33.33%,#fcd116 33.33% 66.66%,#ce1126 66.66%)); }

.d2ih__util { background: var(--getica-red, #dd0321); color: #fff; }
.d2ih__util-inner { height: 34px; display: flex; align-items: center; justify-content: space-between;
  font-family: var(--font-display, sans-serif); font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em; }
.d2ih__util-inner > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .92; }
.d2ih__lang { display: flex; gap: 14px; flex-shrink: 0; }
.d2ih__lang span { opacity: .5; }

.d2ih__main { background: #fff; border-bottom: 1px solid var(--border-subtle, #d4dade); }
.d2ih__main-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-top: 10px; padding-bottom: 10px; min-height: 52px; }
.d2ih__logo { display: flex; align-items: center; gap: 14px; text-decoration: none; min-width: 0; }
.d2ih__logo img { height: 52px; width: auto; flex-shrink: 0; }
.d2ih__brandtext { line-height: 1.05; min-width: 0; }
.d2ih__name { display: block; font-family: var(--font-display, sans-serif); font-weight: 700; font-size: 18px; text-transform: uppercase; letter-spacing: .01em; color: var(--ink-900, #14171a); white-space: nowrap; }
.d2ih__sub { display: block; font-family: var(--font-serif, Georgia, serif); font-style: italic; font-size: 15px; color: var(--getica-red, #dd0321); }

.d2ih__nav { display: flex; align-items: center; gap: 8px; }
.d2ih__menu { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.d2ih__menu a { position: relative; display: block; font-family: var(--font-display, sans-serif); font-weight: 500; font-size: 14px;
  text-transform: uppercase; letter-spacing: .06em; padding: 8px 14px; border-radius: 6px; text-decoration: none; color: var(--ink-700, #2c3338); transition: color .12s; }
.d2ih__menu a:hover, .d2ih__menu .current-menu-item > a { color: var(--getica-red, #dd0321); }
.d2ih__menu .current-menu-item > a::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 0; height: 3px; background: var(--getica-red, #dd0321); border-radius: 2px; }

/* --- Sub-meniuri (dropdown ierarhic) --- */
.d2ih__menu li { position: relative; }
.d2ih__menu .menu-item-has-children > a { padding-right: 28px; }
.d2ih__menu .menu-item-has-children > a::before { content: ""; position: absolute; right: 12px; top: 50%; width: 7px; height: 7px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-65%) rotate(45deg); opacity: .7; }
.d2ih__menu .sub-menu { list-style: none; margin: 0; padding: 8px; position: absolute; top: 100%; left: 0; min-width: 230px;
  background: #fff; border: 1px solid var(--border-subtle, #d4dade); border-top: 3px solid var(--getica-red, #dd0321);
  border-radius: 10px; box-shadow: var(--shadow-md, 0 4px 12px rgba(20,23,26,.1)); z-index: 60;
  opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity .18s, transform .18s, visibility .18s; }
.d2ih__menu li:hover > .sub-menu, .d2ih__menu li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.d2ih__menu .sub-menu a { display: block; padding: 9px 12px; border-radius: 6px; font-size: 13.5px; letter-spacing: .04em; color: var(--ink-700, #2c3338); white-space: nowrap; }
.d2ih__menu .sub-menu a:hover { background: var(--surface-sunken, #e8ebed); color: var(--getica-red, #dd0321); }
.d2ih__menu .sub-menu .current-menu-item > a::after { display: none; }
/* Nivel 3 — submeniu lateral */
.d2ih__menu .sub-menu .menu-item-has-children > a::before { transform: translateY(-50%) rotate(-45deg); right: 10px; }
.d2ih__menu .sub-menu .sub-menu { top: -11px; left: 100%; }
.d2ih__buttons { display: flex; align-items: center; gap: 10px; margin-left: 10px; }
.d2ih__buttons .d2i-btn { padding: 10px 20px; font-size: 13px; }

.d2ih__burger { display: none; width: 44px; height: 44px; flex-direction: column; align-items: center; justify-content: center; gap: 5px; background: none; border: 1px solid var(--border-default, #aab2b9); border-radius: 10px; cursor: pointer; }
.d2ih__burger span { width: 20px; height: 2px; background: var(--ink-900, #14171a); border-radius: 2px; transition: transform .2s, opacity .12s; }
.d2ih.is-open .d2ih__burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.d2ih.is-open .d2ih__burger span:nth-child(2) { opacity: 0; }
.d2ih.is-open .d2ih__burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Prag mobil — controlat prin --d2ih-break (JS adaugă clasa .d2ih--mobile) */
.d2ih--mobile .d2ih__burger { display: flex; }
.d2ih--mobile .d2ih__nav { position: absolute; left: 0; right: 0; top: 100%; background: #fff;
  border-bottom: 1px solid var(--border-subtle, #d4dade); box-shadow: var(--shadow-md, 0 4px 12px rgba(20,23,26,.1));
  flex-direction: column; align-items: stretch; max-height: 0; overflow: hidden; transition: max-height .36s ease; z-index: 99; }
.d2ih--mobile.is-open .d2ih__nav { max-height: calc(100vh - 60px); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.d2ih--mobile .d2ih__main { position: relative; }
.d2ih--mobile .d2ih__menu { flex-direction: column; align-items: stretch; padding: 8px 16px; gap: 0; }
.d2ih--mobile .d2ih__menu a { padding: 14px 12px; font-size: 16px; border-left: 3px solid transparent; }
.d2ih--mobile .d2ih__menu .current-menu-item > a { border-left-color: var(--getica-red, #dd0321); background: rgba(221,3,33,.05); }
.d2ih--mobile .d2ih__menu .current-menu-item > a::after { display: none; }
/* ----- Căutare (lupă + modal) ----- */
.d2ih__search-toggle { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px;
  flex-shrink: 0; margin-left: 6px; background: transparent; border: none; cursor: pointer; color: var(--ink-700, #2c3338);
  border-radius: 50%; transition: background .15s, color .15s; }
.d2ih__search-toggle:hover { background: var(--surface-sunken, #e8ebed); color: var(--getica-red, #dd0321); }
.d2ih__search-toggle svg { width: 22px; height: 22px; }
.d2ih__search[hidden] { display: none; }
.d2ih__search { position: fixed; inset: 0; z-index: 1200; display: flex; align-items: flex-start; justify-content: center; }
.d2ih__search-overlay { position: absolute; inset: 0; background: rgba(0,15,3,.55); backdrop-filter: blur(2px); }
.d2ih__search-panel { position: relative; margin-top: 14vh; width: min(680px, 92vw); background: #fff;
  border-radius: 14px; border-top: 4px solid var(--getica-red, #dd0321); box-shadow: 0 24px 60px rgba(0,0,0,.35);
  padding: 32px 32px 36px; animation: d2ihSearchIn .25s cubic-bezier(.16,1,.3,1); }
@keyframes d2ihSearchIn { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
.d2ih__search-x { position: absolute; top: 16px; right: 18px; width: 38px; height: 38px; border: none; cursor: pointer;
  background: transparent; font-size: 18px; color: var(--text-muted, #545d65); border-radius: 50%; }
.d2ih__search-x:hover { background: var(--surface-sunken, #e8ebed); }
.d2ih__search-title { font-family: var(--font-display, sans-serif); font-weight: 700; font-size: 20px; text-transform: uppercase;
  letter-spacing: .02em; color: var(--ink-900, #14171a); margin-bottom: 18px; }
.d2ih__search-form { display: flex; gap: 10px; }
.d2ih__search-input { flex: 1; padding: 14px 18px; font-size: 16px; font-family: var(--font-body, sans-serif);
  border: 2px solid var(--border-default, #aab2b9); border-radius: 999px; outline: none; }
.d2ih__search-input:focus { border-color: var(--getica-red, #dd0321); }
.d2ih__search-submit { flex-shrink: 0; }
@media (max-width: 600px) {
  .d2ih__search-panel { margin-top: 8vh; padding: 24px 20px 28px; }
  .d2ih__search-form { flex-direction: column; }
  .d2ih__search-submit { width: 100%; }
}
/* Pe mobil ascundem banda utilitară de sus (text tăiat oricum) */
@media (max-width: 768px) {
  .d2ih__util { display: none; }
  .d2ih__logo { gap: 10px; min-width: 0; flex: 1; }
  .d2ih__logo img { height: 42px; }
  .d2ih__brandtext { overflow: hidden; }
  .d2ih__name { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .d2ih__sub { font-size: 12px; }
  .d2ih__nav { flex-shrink: 0; gap: 4px; }
}
@media (max-width: 380px) {
  .d2ih__name { font-size: 12px; }
  .d2ih__logo img { height: 36px; }
}

.d2ih--mobile .d2ih__buttons { padding: 12px 16px 16px; margin-left: 0; }
.d2ih--mobile .d2ih__buttons .d2i-btn { width: 100%; }

/* Sub-meniuri pe mobil — afișate inline (acordeon vizual) */
.d2ih--mobile .d2ih__menu .sub-menu { position: static; opacity: 1; visibility: visible; transform: none;
  box-shadow: none; border: none; border-radius: 0; padding: 0 0 0 14px; min-width: 0;
  background: transparent; border-left: 2px solid var(--border-subtle, #d4dade); margin: 0 0 6px 12px; }
.d2ih--mobile .d2ih__menu .sub-menu a { color: var(--ink-700, #2c3338); font-size: 14px; padding: 10px 12px; white-space: normal; }
.d2ih--mobile .d2ih__menu .menu-item-has-children > a::before { transform: translateY(-65%) rotate(45deg); }
.d2ih--mobile .d2ih__menu .sub-menu .sub-menu { top: auto; left: auto; }
