/* =================================================================
   ResidentPravo — Shared Header Component
   Source of truth: /ru/residence-permit-cyprus.html
   Linked AFTER inline <style> in every page — same-specificity
   rules here win because they appear later in the cascade.
   ================================================================= */

/* ── Mobile menu: top-aligned layout with close-button clearance ── */
.mobile-menu {
  justify-content: flex-start;
  padding-top: calc(76px + env(safe-area-inset-top, 0px));
  padding-right: clamp(1.5rem, 6vw, 2.5rem);
  padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
  padding-left: clamp(1.5rem, 6vw, 2.5rem);
  gap: 0;
  overflow-y: auto;
}
.mobile-menu.open { z-index: 110; }

/* ── Menu nav items ── */
.mobile-menu a {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--navy);
  padding: .6rem 0;
  border-bottom: 1px solid var(--line);
}

/* ── Language switcher inside menu ── */
.mobile-menu-lang {
  margin-top: .25rem;
}
.mobile-menu-lang a {
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .1em;
  padding: 0;
  border-bottom: none;
}
.mobile-menu-lang-sep {
  font-size: .82rem;
}

/* ── WA button: anchored to bottom, matches base .btn dimensions ── */
.mobile-menu .btn-wa {
  margin-top: auto;
  padding: .85rem 1.4rem;
  font-size: .92rem;
  border-radius: 10px;
  width: 100%;
  justify-content: center;
}

/* ── Close button: unified for both class variants ── */
.mobile-menu-close,
.close-menu-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 0;
  cursor: pointer;
  padding: 0;
  color: #0A2540;
  transition: none;
  -webkit-tap-highlight-color: transparent;
  z-index: 9999;
  pointer-events: auto;
}
.mobile-menu-close:hover,
.close-menu-btn:hover { background: none; }

/* Hide old path-based SVG (currentColor + <path> → rendering artifacts) */
.mobile-menu-close svg { display: none; }
/* New line-based SVG renders cleanly */
.close-menu-btn svg { display: block; }

/* ── Defensive header layout — mobile ── */
@media (max-width: 768px) {
  .header-cta .btn-wa { display: none; }
}

@media (max-width: 720px) {
  .nav { gap: 0.75rem; }
  .brand { min-width: 0; overflow: hidden; }
  .brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .header-cta { flex-shrink: 0; gap: 0.7rem; }
  .lang-switch { white-space: nowrap; flex-shrink: 0; margin-right: 0; }
  .burger { display: flex; flex-shrink: 0; }
  /* Menu items: keep 1.5rem at all breakpoints (no reduction) */
  .mobile-menu a { font-size: 1.5rem; }
}

/* ── Brand tagline: shrink on small screens, never hide ── */
@media (max-width: 480px) {
  .brand-tag { display: block; font-size: .56rem; letter-spacing: .06em; }
  .mobile-menu a { font-size: 1.5rem; }
}

@media (max-width: 430px) {
  :root { --gutter: 1.1rem; }
  .brand-tag { display: block; font-size: .56rem; letter-spacing: .06em; }
  .mobile-menu a { font-size: 1.5rem; }
}

@media (max-width: 375px) {
  :root { --gutter: 1rem; }
  .brand-name { font-size: 1.2rem; }
  .brand-tag { display: block; font-size: .56rem; letter-spacing: .06em; }
  .mobile-menu a { font-size: 1.5rem; }
}

@media (max-width: 320px) {
  :root { --gutter: 0.875rem; }
  .lang-switch { display: none; }
  .brand-tag { display: block; font-size: .52rem; letter-spacing: .04em; }
  .mobile-menu a { font-size: 1.4rem; }
  .mobile-menu { padding-right: 1rem; padding-left: 1rem; }
}
