/* =========================================================
   ONEPA HEADER
   APPLE-STYLE / SMALL / CLEAN
   TRANSLUCENT GREY HEADER WITH BLACK TEXT
   ========================================================= */

.reference-header {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  width: 100%;
  background: rgba(242, 242, 242, 0.78);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.10);
  min-height: calc(48px + var(--banner-h, 0px));
  transition: min-height 0.22s ease;
}

/* KEEP PAGE CONTENT IN PLACE */
body {
  padding-top: calc(48px + var(--banner-h, 0px));
  transition: padding-top 0.3s ease;
}

/* APPLE-STYLE BLUR WHEN SERVICES IS OPEN */
body:has(.reference-header.services-open)::before {
  content: "";
  position: fixed;
  top: calc(48px + var(--banner-h, 0px));
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 900;
  background: rgba(255, 255, 255, 0.12);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  pointer-events: none;
  transform: translateZ(0);
}

/* =========================================================
   REGION BANNER
   Sits on top of the header, same colors as the header.
   Height is controlled by --banner-h (set by header.js).
   ========================================================= */

.site-banner {
  height: var(--banner-h, 0px);
  overflow: hidden;
  box-sizing: border-box;
  border-bottom: 1px solid rgba(0, 0, 0, 0.10);
  transition: height 0.3s ease, opacity 0.2s ease;
}

.site-banner.is-closed {
  opacity: 0;
}

.site-banner-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 28px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  color: #000000;
}

.site-banner-text {
  margin: 0;
  font-size: 12px;
  line-height: 1.3;
  text-align: center;
}

.site-banner-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-banner-select {
  -webkit-appearance: none;
  appearance: none;
  height: 28px;
  min-width: 170px;
  padding: 0 30px 0 12px;
  border: 0;
  border-radius: 8px;
  background-color: rgba(0, 0, 0, 0.06);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none' stroke='%23000' stroke-width='1.5'%3E%3Cpath d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  color: #000000;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
}

.site-banner-continue {
  height: 28px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: #ffffff;
  color: #000000;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.site-banner-continue:hover {
  opacity: 0.7;
}

.site-banner-close {
  position: relative;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.site-banner-close span::before,
.site-banner-close span::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 1.5px;
  background: #000000;
}

.site-banner-close span::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.site-banner-close span::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.site-banner-close:hover {
  opacity: 0.65;
}

/* HEADER INNER */
.header-inner {
  width: 100%;
  max-width: 1200px;
  height: 48px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  box-sizing: border-box;
}

/* LOGO */
.header-logo-link {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: auto;
  height: 48px;
  margin: 0;
  padding: 0;
  line-height: 0;
  text-decoration: none;
}

.reference-header-logo {
  display: block;
  width: 82px;
  height: auto;
  max-height: 38px;
  object-fit: contain;
  object-position: center;
  font-size: 0;
  color: transparent;
}

.reference-header-logo.logo-missing {
  visibility: hidden;
}

/* DESKTOP NAVIGATION */
.header-nav {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 26px;
  height: 48px;
  margin-left: auto;
  padding: 0;
}

/* NORMAL HEADER LINKS */
.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0;
  margin: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  color: #000000;
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  font-size: 13px;
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.nav-link:hover {
  color: #000000;
  opacity: 0.65;
}

.nav-link.active {
  color: #000000;
  font-weight: 400;
  -webkit-text-stroke: 0.35px #000000;
}

/* SERVICES CONTAINER */
.services-dropdown {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  width: max-content;
  min-width: 0;
  height: 48px;
  margin: 0;
  padding: 0;
}

/* SERVICES LINK */
.services-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  width: max-content;
  height: 48px;
  padding: 0;
  margin: 0;
  flex: 0 0 48px;
}

/* SERVICES SUBMENU */
.services-menu {
  position: absolute;
  top: 48px;
  left: 0;
  transform: translateY(-5px);
  width: max-content;
  min-width: 0;
  padding: 4px 0 0;
  margin: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 1200;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease,
    visibility 0.18s ease;
}

/* INVISIBLE MOUSE BRIDGE */
.services-menu::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 0;
  width: 100%;
  height: 8px;
  background: transparent;
}

/* SHOW SERVICES ON HOVER */
.services-dropdown:hover .services-menu,
.reference-header.services-open .services-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

/* SERVICES MENU ITEMS */
.services-menu-item {
  display: block;
  width: max-content;
  padding: 7px 0;
  margin: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  color: #000000;
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.15s ease;
}

.services-menu-item:hover {
  background: transparent;
  color: #000000;
  opacity: 0.65;
}

/* HEADER EXPANSION — DESKTOP */
.reference-header.services-open {
  min-height: calc(250px + var(--banner-h, 0px));
}

.reference-header.services-open .header-inner {
  height: 48px;
}

/* KEYBOARD ACCESS */
.services-dropdown:focus-within .services-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

/* MOBILE HAMBURGER — HIDDEN BY DEFAULT */
.header-mobile-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 22px;
  height: 16px;
  padding: 0;
  margin: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  flex: 0 0 auto;
}

.header-mobile-toggle .hamburger-line {
  display: block;
  width: 100%;
  height: 1.5px;
  border-radius: 2px;
  background: #000000;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.header-mobile-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.header-mobile-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) {
  opacity: 0;
}

.header-mobile-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* MOBILE NAVIGATION — BASE */
.mobile-nav-panel {
  display: none;
  flex-direction: column;
  width: 100%;
  box-sizing: border-box;
  background: rgba(242, 242, 242, 0.94);
  border-top: 1px solid rgba(0, 0, 0, 0.12);
}

.mobile-nav-panel.is-open {
  display: flex;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 44px;
  padding: 0 20px;
  box-sizing: border-box;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
  color: #000000;
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  font-size: 14px;
  font-weight: 400;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.mobile-nav-link.active {
  color: #000000;
  font-weight: 500;
}

/* MOBILE SERVICES GROUP */
.mobile-nav-group {
  display: flex;
  flex-direction: column;
}

/* MOBILE SERVICES ROW: link to /servicos + arrow button */
.mobile-services-row {
  display: flex;
  align-items: center;
  width: 100%;
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
  box-sizing: border-box;
}

.mobile-services-link {
  flex: 1 1 auto;
  width: auto;
  border-bottom: 0;
}

.mobile-services-trigger {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 44px;
  margin: 0;
  padding: 0 20px 0 12px;
  background: transparent;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.mobile-services-submenu {
  display: none;
  flex-direction: column;
  padding: 0;
  background: rgba(242, 242, 242, 0.96);
}

.mobile-nav-group.is-open .mobile-services-submenu {
  display: flex;
}

.mobile-submenu-item {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0 20px 0 34px;
  box-sizing: border-box;
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
  color: #000000;
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  font-size: 13px;
  font-weight: 400;
  text-decoration: none;
}

.mobile-submenu-item:hover {
  background: rgba(0, 0, 0, 0.06);
}

/* MOBILE SERVICES ARROW */
.services-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
}

.services-arrow::before {
  content: "";
  display: block;
  width: 6px;
  height: 6px;
  border-right: 1.5px solid #000000;
  border-bottom: 1.5px solid #000000;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.mobile-nav-group.is-open .services-arrow::before {
  transform: rotate(225deg);
}

/* TABLET — ORIGINAL BEHAVIOR */
@media (max-width: 900px) {
  .header-inner {
    padding: 0 20px;
    gap: 20px;
  }

  .header-nav {
    gap: 20px;
  }

  .nav-link {
    font-size: 12px;
  }

  .reference-header-logo {
    width: 78px;
  }
}

/* =========================================================
   MOBILE ONLY — APPLE-STYLE FULL-SCREEN MENU
   DESKTOP STYLES ABOVE REMAIN UNCHANGED
   ========================================================= */
@media (max-width: 600px) {
  .reference-header {
    min-height: calc(48px + var(--banner-h, 0px));
    z-index: 2000;
  }

  .header-inner {
    width: 100%;
    height: 48px;
    min-height: 48px;
    padding: 0 18px;
    gap: 0;
  }

  .header-nav {
    display: none !important;
  }

  /* TWO-BAR MOBILE MENU BUTTON */
  .header-mobile-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    position: relative;
    z-index: 2202;
    width: 30px;
    height: 40px;
    padding: 0;
    flex: 0 0 30px;
    background: transparent;
    border: 0;
    -webkit-tap-highlight-color: transparent;
  }

  /* Both bars have their own fixed height and do not overlap */
  .header-mobile-toggle .hamburger-line {
    display: block;
    width: 24px;
    height: 1.5px;
    min-height: 1.5px;
    flex: 0 0 1.5px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 1px;
    background: #1d1d1f;
    opacity: 1;
    transform: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
  }

  /* HIDE ONLY THE THIRD BAR ON MOBILE */
  .header-mobile-toggle .hamburger-line:nth-child(3) {
    display: none !important;
  }

  /* KEEP TWO SEPARATE BARS VISIBLE WHEN CLOSED */
  .header-mobile-toggle[aria-expanded="false"] .hamburger-line:nth-child(1),
  .header-mobile-toggle[aria-expanded="false"] .hamburger-line:nth-child(2) {
    display: block;
    opacity: 1;
    transform: none;
  }

  /* OPTIONAL X ANIMATION WHEN OPEN */
  .header-mobile-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) {
    transform: translateY(3.25px) rotate(45deg);
  }

  .header-mobile-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) {
    transform: translateY(-3.25px) rotate(-45deg);
  }

  .reference-header-logo {
    width: 78px;
    max-height: 34px;
  }

  /* BANNER ON MOBILE */
  .site-banner-inner {
    padding: 10px 18px;
    flex-direction: column;
    gap: 8px;
  }

  .site-banner-select {
    min-width: 0;
    flex: 1 1 auto;
  }

  .site-banner-actions {
    width: 100%;
  }

  /* FULL-SCREEN PANEL COVERS PAGE CONTENT */
  .mobile-nav-panel {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 2100;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    padding:
      calc(max(88px, calc(env(safe-area-inset-top) + 76px)) + var(--banner-h, 0px))
      0
      max(30px, env(safe-area-inset-bottom));
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    box-sizing: border-box;
    background: #f5f5f7;
    border: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(-8px);
    transition:
      opacity 0.22s ease,
      transform 0.22s ease,
      visibility 0.22s ease;
  }

  .mobile-nav-panel.is-open {
    display: flex;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
  }

  /* LARGE APPLE-STYLE LINKS */
  .mobile-nav-link {
    min-height: 50px;
    padding: 5px 30px;
    border: 0;
    color: #333336;
    font-size: 30px;
    font-weight: 500;
    line-height: 1.25;
    letter-spacing: -0.8px;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-nav-link.active {
    color: #000000;
    font-weight: 600;
  }

  .mobile-nav-link:hover {
    background: transparent;
    color: #000000;
  }

  .mobile-nav-group {
    width: 100%;
  }

  /* SERVICES ROW (link + arrow) */
  .mobile-services-row {
    border-bottom: 0;
  }

  .mobile-services-link {
    padding-right: 12px;
  }

  .mobile-services-trigger {
    min-height: 50px;
    padding: 0 30px 0 12px;
  }

  .mobile-services-submenu {
    width: 100%;
    padding: 0 0 8px;
    background: transparent;
  }

  .mobile-submenu-item {
    min-height: 42px;
    padding: 5px 30px 5px 45px;
    border: 0;
    color: #424245;
    font-size: 19px;
    line-height: 1.35;
  }

  .mobile-submenu-item:hover {
    background: transparent;
    color: #000000;
  }

  .services-arrow {
    width: 18px;
    height: 18px;
    flex-basis: 18px;
    margin-left: 12px;
  }

  .services-arrow::before {
    width: 8px;
    height: 8px;
    border-right: 1.5px solid #333336;
    border-bottom: 1.5px solid #333336;
  }

  .reference-header.services-open {
    min-height: calc(48px + var(--banner-h, 0px));
  }

  .services-menu {
    display: none !important;
  }

  body:has(.reference-header.services-open)::before {
    display: none !important;
  }

  /* PREVENT BACKGROUND SCROLL WHEN MENU IS OPEN */
  body.mobile-menu-open {
    overflow: hidden;
    touch-action: none;
  }
}

/* SMALL MOBILE */
@media (max-width: 420px) {
  .header-inner {
    padding: 0 15px;
  }

  .reference-header-logo {
    width: 72px;
  }

  .header-mobile-toggle {
    width: 30px;
    height: 40px;
  }
}

@media (max-width: 380px) {
  .mobile-nav-link {
    min-height: 46px;
    padding-left: 25px;
    padding-right: 25px;
    font-size: 27px;
  }

  .mobile-services-link {
    padding-right: 12px;
  }

  .mobile-services-trigger {
    min-height: 46px;
    padding-right: 25px;
  }

  .mobile-submenu-item {
    padding-left: 38px;
    font-size: 17px;
  }
}

/* REDUCE MOTION */
@media (prefers-reduced-motion: reduce) {
  .reference-header,
  .services-menu,
  .services-menu-item,
  .header-mobile-toggle .hamburger-line,
  .mobile-nav-panel,
  .services-arrow::before,
  .site-banner,
  body {
    transition: none !important;
  }
}