/* Shared navigation and contact controls, loaded after the page layout styles. */
:root { --header-height: 88px; --whatsapp: #176747; --whatsapp-hover: #105237; }

#site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
}

#site-header .site-header {
  position: relative;
  overflow: visible;
  border-bottom: 1px solid #e6e5dc;
  background: rgba(251, 250, 247, .96);
  backdrop-filter: blur(18px);
  box-shadow: 0 3px 24px #28251f06;
}

#site-header .header-inner {
  width: min(100% - 48px, 1440px);
  min-height: var(--header-height);
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 24px;
}

#site-header .brand { min-width: 0; gap: 10px; }
#site-header .brand-mark {
  flex: 0 0 42px;
  width: 42px;
  height: 46px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: 1.05rem;
}
#site-header .brand-copy { min-width: 0; }
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: contain; }
.site-footer .brand-mark { background: transparent; border-radius: 0; }
.site-footer .brand-mark img { filter: brightness(0) invert(1); opacity: .9; }
#site-header .brand-copy strong { font-size: 1.08rem; letter-spacing: -.025em; }
#site-header .brand-copy small {
  max-width: 205px;
  margin-top: 6px;
  font-size: .58rem;
  font-weight: 600;
  letter-spacing: .07em;
  line-height: 1.4;
}
#site-header .site-nav {
  justify-self: center;
  border-radius: 16px;
  background: #eeeee7;
  padding: 5px;
}
#site-header .nav-list { gap: 1px; }
#site-header .nav-list a {
  min-height: 39px;
  padding: 9px 10px;
  border: 0;
  border-radius: 11px;
  color: #5a6054;
  font-size: .78rem;
  font-weight: 600;
  line-height: 1.3;
  transition: background-color .18s, color .18s, box-shadow .18s;
}
#site-header .nav-list a:hover { background: #ffffffaa; color: var(--olive-dark); }
#site-header .nav-list a[aria-current="page"] {
  background: var(--white);
  color: var(--olive-dark);
  box-shadow: 0 2px 5px #28251f0a, 0 0 0 1px #34402b08;
}
#site-header .header-actions { gap: 10px; }
#site-header .nav-toggle, #site-header .mobile-menu-head { display: none; }
#site-header .site-nav > .language-picker { display: none; }

.language-picker {
  position: relative;
  display: inline-flex;
  width: fit-content;
  flex-shrink: 0;
  align-items: center;
  direction: ltr;
}
.language-picker::before {
  position: absolute;
  left: 12px;
  width: 17px;
  height: 17px;
  background: currentColor;
  color: #5c6657;
  mask: url('../icons/globe.svg') center / contain no-repeat;
  pointer-events: none;
  content: '';
}
.language-picker::after {
  position: absolute;
  right: 12px;
  width: 5px;
  height: 5px;
  margin-top: -3px;
  border-right: 1.5px solid #5c6657;
  border-bottom: 1.5px solid #5c6657;
  transform: rotate(45deg);
  pointer-events: none;
  content: '';
}
body .language-picker .language-select {
  display: block;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 10px 28px 10px 36px;
  appearance: none;
  border: 1px solid #dedfd5;
  border-radius: 12px;
  background: #fff;
  color: #34402b;
  font-size: .78rem;
  font-weight: 650;
  line-height: 1.3;
  direction: ltr;
  transition: border-color .18s, box-shadow .18s;
}
body .language-picker .language-select:hover { border-color: #929d85; box-shadow: 0 2px 8px #34402b08; }
.language-picker--compact { width: 88px; }
.site-footer .language-picker { margin-top: 10px; }

.whatsapp-icon {
  display: inline-block;
  flex: 0 0 21px;
  width: 21px;
  height: 21px;
  background: currentColor;
  mask: url('../icons/whatsapp.svg') center / contain no-repeat;
}
.button--whatsapp:not(.header-whatsapp):not(.floating-whatsapp)::before {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  background: currentColor;
  mask: url('../icons/whatsapp.svg') center / contain no-repeat;
  content: '';
}
body .button--whatsapp {
  gap: 9px;
  border: 1px solid var(--whatsapp);
  border-radius: 12px;
  background: var(--whatsapp);
  color: #fff;
  font-size: .86rem;
  font-weight: 650;
  box-shadow: 0 3px 8px #17674712;
  transition: background-color .18s, border-color .18s, box-shadow .18s, transform .18s;
}
body .button--whatsapp:hover {
  border-color: var(--whatsapp-hover);
  background: var(--whatsapp-hover);
  color: #fff;
  box-shadow: 0 5px 16px #17674720;
  transform: translateY(-1px);
}
body .button--whatsapp:active { transform: translateY(0); }
body .button--whatsapp:focus-visible { outline-color: #176747; }
#site-header .header-whatsapp { min-height: 44px; padding: 10px 15px; white-space: nowrap; }
body .floating-whatsapp.button--whatsapp {
  inset-inline-end: max(24px, env(safe-area-inset-right));
  inset-block-end: calc(24px + env(safe-area-inset-bottom));
  width: auto;
  min-width: 0;
  height: auto;
  min-height: 54px;
  gap: 10px;
  padding: 13px 19px;
  border: 1px solid #ffffff30;
  border-radius: 18px;
  box-shadow: 0 8px 28px #163e3533, 0 0 0 4px #ffffff70;
}
body .floating-whatsapp .whatsapp-icon { width: 24px; height: 24px; flex-basis: 24px; display: inline-block; }
body .floating-whatsapp [data-i18n] { display: inline; }

#site-header .menu-icon { position: relative; display: block; width: 18px; height: 14px; }
#site-header .menu-icon::before, #site-header .menu-icon::after {
  position: absolute;
  inset-inline: 0;
  height: 1.5px;
  border-radius: 2px;
  background: currentColor;
  content: '';
  transition: transform .18s, top .18s;
}
#site-header .menu-icon::before { top: 3px; }
#site-header .menu-icon::after { top: 10px; }
#site-header [aria-expanded="true"] .menu-icon::before { top: 6px; transform: rotate(45deg); }
#site-header [aria-expanded="true"] .menu-icon::after { top: 6px; transform: rotate(-45deg); }
#site-header .close-icon { font-size: 1.7rem; font-weight: 400; line-height: 1; }

@media (max-width: 1279px) {
  :root { --header-height: 76px; }
  #site-header .header-inner { grid-template-columns: minmax(0, 1fr) auto; gap: 16px; }
  #site-header .header-actions { grid-column: 2; grid-row: 1; }
  #site-header .brand-copy small { display: none; }
  #site-header .nav-toggle { display: inline-grid; width: 44px; min-width: 44px; height: 44px; border-radius: 12px; background: #eeeee7; border-color: #e3e5da; }
  #site-header .site-nav {
    position: fixed;
    justify-self: stretch;
    inset-block: calc(var(--header-height) + 12px) auto;
    inset-inline: auto 24px;
    width: min(440px, calc(100% - 48px));
    max-height: calc(100dvh - var(--header-height) - 36px);
    padding: 20px;
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid #e3e5da;
    border-radius: 22px;
    background: #fbfaf7;
    box-shadow: 0 20px 60px #1f2a2133;
    clip-path: none;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity .18s, transform .18s, visibility .18s;
  }
  html[dir="rtl"] #site-header .site-nav { clip-path: none; }
  #site-header .site-nav.is-open { opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0); }
  #site-header .mobile-menu-head { display: flex; position: static; align-items: center; justify-content: space-between; gap: 12px; padding: 0 0 16px; margin: 0 0 12px; border-bottom: 1px solid #e3e5da; }
  #site-header .mobile-menu-head .brand-mark { flex-basis: 36px; width: 36px; height: 39px; }
  #site-header .mobile-menu-head .brand-copy strong { font-size: 1rem; }
  #site-header .mobile-menu-head .icon-button { width: 36px; min-width: 36px; height: 36px; border-radius: 10px; }
  #site-header .nav-list { flex-direction: column; align-items: stretch; gap: 4px; }
  #site-header .nav-list a { display: flex; min-height: 46px; justify-content: space-between; width: 100%; padding: 12px 14px; font-size: .94rem; white-space: normal; }
  #site-header .nav-list a::after { content: '↗'; font-size: .95rem; color: #87937b; }
  html[dir="rtl"] #site-header .nav-list a::after { content: '↖'; }
  #site-header .nav-list a[aria-current="page"] { background: #e9eee2; box-shadow: none; }
  #site-header .site-nav > .language-picker { display: flex; width: 100%; margin-top: 16px; }
  body.nav-open::before { background: #17271e38; backdrop-filter: blur(4px); }
}

@media (max-width: 760px) {
  :root { --header-height: 72px; }
  #site-header .header-inner { width: calc(100% - 28px); gap: 8px; }
  #site-header .header-actions { gap: 6px; }
  #site-header .brand { gap: 8px; overflow: visible; }
  #site-header .brand-mark { flex-basis: 34px; width: 34px; height: 38px; border-radius: 12px 12px 12px 3px; font-size: .9rem; }
  #site-header .brand-copy strong { max-width: 130px; font-size: .96rem; line-height: 1.12; white-space: normal; overflow: visible; text-overflow: clip; }
  #site-header .header-whatsapp { display: inline-flex; width: 40px; min-width: 40px; min-height: 40px; padding: 0; border-radius: 11px; }
  #site-header .header-whatsapp .whatsapp-icon { display: inline-block; }
  #site-header .header-whatsapp [data-i18n] { display: none; }
  #site-header .header-actions .language-picker { display: flex; width: 74px; }
  #site-header .header-actions .language-select { min-height: 40px; padding: 10px 19px 10px 28px; font-size: .72rem; }
  #site-header .header-actions .language-picker::before { left: 9px; width: 14px; height: 14px; }
  #site-header .header-actions .language-picker::after { right: 9px; width: 4px; height: 4px; }
  #site-header .nav-toggle { width: 40px; min-width: 40px; height: 40px; border-radius: 11px; }
  #site-header .site-nav { inset-inline: 14px; width: calc(100% - 28px); padding: 16px; border-radius: 18px; }
  body .floating-whatsapp.button--whatsapp { inset-inline-end: 18px; inset-block-end: calc(18px + env(safe-area-inset-bottom)); width: 54px; min-width: 54px; height: 54px; min-height: 54px; padding: 0; justify-content: center; border-radius: 17px; }
  body .floating-whatsapp [data-i18n] { display: none; }
}

@media (max-width: 380px) {
  #site-header .brand-copy strong { max-width: 90px; font-size: .87rem; }
  #site-header .brand { gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  #site-header .site-nav, #site-header .menu-icon::before, #site-header .menu-icon::after,
  #site-header .nav-list a, body .button--whatsapp { transition: none; }
}
