/* =========================
   MOBILE FIRST
========================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: var(--color-primary);
}

.header-main {
  position: relative;
  /* top: 0;
  z-index: 1000; */
  background: var(--color-primary);
  padding-block: 1rem;
}

.header-top {
  display: none;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

/* Logo */
.logo img {
  height: 48px;
  width: auto;
}

/* Hamburger */
.nav-toggle {
  width: 28px;
  height: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.nav-toggle .bar {
  width: 100%;
  height: 3px;
  background: #fff;
  border-radius: 2px;
  transition:
    transform 0.3s ease,
    opacity 0.3s ease;
  transform-origin: center;
  will-change: transform;
  /* backface-visibility: hidden; */
}

/* Animate to X */
.nav-toggle.active .bar:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.nav-toggle.active .bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active .bar:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* Navigation hidden by default */
.header-center {
  position: fixed;
  inset: 0 0 0 auto;
  width: 280px;
  /* height: 100%; */
  height: 100dvh;
  overflow-y: auto;
  background: var(--color-primary);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  z-index: 1000;
  /* padding-top: 5rem;
  pointer-events: none; */
}

.header-center.open {
  transform: translateX(0);
  /* opacity: 1; */
  /* pointer-events: auto; */
}

.header-right {
  display: none;
}

/* Vertical nav */
.main-nav > ul {
  list-style: none;
  padding: 1rem;
  margin: 0;
}

.main-nav li {
  margin-bottom: 1rem;
}

.main-nav a {
  color: var(--text-on-dark);
  font-weight: 500;
}

/* Hide dropdowns on mobile */
.dropdown {
  display: none;
}

.has-dropdown > a {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.has-dropdown > a::after {
  content: '+';
  font-size: 18px;
}

.has-dropdown.open > .dropdown {
  display: block;
  margin-top: 0.5rem;
}

.has-dropdown.open > a::after {
  content: '–';
}

.lang-switcher-wrapper {
  display: none;
}

.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 900;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.menu-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* mobile-only */
.mobile-only {
  display: block;
}

.mobile-only > a {
  display: flex;
  align-items: center;
  gap: 10px;
}

.main-nav .mobile-lang .dropdown {
  padding: 0;
  margin-top: 0.5rem;
}

.main-nav .mobile-lang .dropdown a {
  display: flex;
  align-items: center;
  gap: 10px;
}
/* =====================================
   MEDIA QUERIES
===================================== */
/* @media (min-width: 768px) {
  .logo img {
    height: 54px;
  }
} */

/* =====================================
   DESKTOP HEADER
===================================== */
@media (min-width: 1024px) {
  .header-top {
    display: block;
    background-color: var(--color-primary);
    padding: 0.6rem 2rem;
    /* font-size: 0.9rem; */
    color: #fff;
  }

  .header-top .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .nav-toggle {
    display: none;
  }

  /* body.menu-open {
    overflow: visible;
  } */

  .header-top a {
    color: var(--text-on-dark);
    margin-right: 1rem;
  }

  .header-top-left a {
    transition:
      transform 0.2s ease,
      color 0.2s ease,
      opacity 0.2s ease;
  }

  .header-top-left a:hover {
    transform: translateY(-2px);
    color: var(--color-accent);
    opacity: 0.9;
  }

  .header-top-right {
    display: flex;
    align-items: center;
    gap: 1.2rem;
  }

  .header-top-right a {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    transition:
      transform 0.2s ease,
      color 0.2s ease,
      opacity 0.2s ease;
  }

  .header-top-right a:hover {
    transform: translateY(-2px);
    color: var(--color-accent);
    opacity: 0.9;
  }

  .header-top-right iconify-icon {
    display: block;
    flex-shrink: 0;
  }

  .header-top-left,
  .header-top-right {
    display: flex;
    align-items: center;
  }

  /* Show desktop */
  .site-header {
    /* position: sticky;
    top: 0;
    z-index: 100; */
    display: block;
    /* background-color: var(--color-primary); */
  }

  .site-header.is-scrolled {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  }

  .header-main {
    padding: 1rem 2rem;
  }

  /* Horizontal layout */
  .header-container {
    flex-direction: row;
    /* justify-content: space-between;
    align-items: center; */
  }

  .header-left {
    display: flex;
    align-items: center;
  }

  .header-center {
    display: flex;
    flex: 1;
    justify-content: center;
    position: static;
    transform: none;
    height: auto;
    width: auto;
    overflow: visible;
    background: transparent;
    z-index: auto;
  }

  .menu-overlay {
    display: none;
  }

  .header-right {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 2rem;
  }

  .main-nav ul {
    display: flex;
    align-items: center;
    gap: clamp(0.8rem, 1.4vw, 2rem);
    padding: 0;
    flex-wrap: nowrap;
  }

  .main-nav ul ul {
    /* list-style: none;
    margin: 0;
    padding: 0; */
    display: block;
  }

  .logo img {
    height: 64px;
  }

  .main-nav li {
    margin: 0;
    position: relative;
  }

  .main-nav > ul > li > a {
    display: flex;
    align-items: center;
    height: 64px; /* match header height */
    padding-inline: 0.2rem;
    font-weight: 500;
    position: relative;
  }

  .main-nav a:hover {
    text-decoration: none;
    color: var(--color-accent);
  }

  /* Dropdown base (hidden) */
  .has-dropdown {
    position: relative;
  }

  .has-dropdown::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 8px;
  }

  .has-dropdown > a::after {
    content: none;
  }

  .dropdown {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    padding: 6px;
    border-radius: 12px;
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: 0.25s ease;
  }

  .has-dropdown:hover > .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .dropdown li {
    list-style: none;
  }

  /* Dropdown links */
  .dropdown a {
    display: block;
    padding: 10px 14px;
    border-radius: 10px;

    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
    white-space: nowrap;

    transition:
      background 0.2s ease,
      color 0.2s ease,
      transform 0.15s ease;
  }

  /* Hover effect */
  .dropdown a:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-secondary);
    transform: translateX(2px);
  }

  /* SHOW via JS */
  .has-dropdown.is-open > .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .dropdown {
    z-index: 20;
  }

  .dropdown--right {
    left: auto;
    right: 0;
  }

  /* .lang-switcher.is-open .lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  } */

  .lang-switcher-wrapper {
    display: flex;
    position: relative;
    align-items: center;
  }

  .lang-switcher {
    position: relative;
  }

  .lang-switcher a {
    color: var(--text-primary);
  }

  .lang-switcher:hover > .dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .lang-active {
    padding: 10px 14px;
    border-radius: 10px;
    color: var(--text-on-dark) !important;
    /* background: white; */
    /* box-shadow: 0 18px 40px rgba(0, 0, 0, 0.14); */
  }

  .lang-flag {
    width: 20px;
    height: 14px;
    object-fit: cover;
    border-radius: 2px;
  }

  .lang-dropdown a {
    display: flex;
    align-items: center;
    /* gap: 8px; */
    /* padding: 8px 12px; */
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    white-space: nowrap;
    transition: background 0.2s ease;
  }

  .lang-dropdown a:hover {
    background: rgba(0, 0, 0, 0.06);
    /* transform: translateX(2px); */
  }

  .lang-switcher > a::after {
    display: none !important;
  }

  .tooltip-link {
    display: inline-flex;
    text-decoration: none;
    /* display: inline-block; */
  }

  .tooltip-container {
    position: relative;
    /* background-color: #ff3cac;
    background-image: linear-gradient(
      225deg,
      #ff3cac 0%,
      #784ba0 50%,
      #2b86c5 100%
    ); */
    cursor: pointer;
    transition: all 0.2s;
    font-size: 17px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    fill: #fff;
    box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 25px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    /* padding-right: 1rem; */
  }

  .tooltip-container .borde-back {
    width: 60px;
    height: 60px;
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: none;
  }

  .tooltip-container .icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    background-color: var(--color-primary);
    cursor: pointer;
  }

  .tooltip {
    position: absolute;
    top: 50%;
    right: 100%;
    transform: translateY(-50%) translateX(60px);
    width: 160px;
    height: 52px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    /* transition: all 0.6s; */
    border-radius: 50px;
    background-color: var(--color-primary);
    background-image: linear-gradient(-90deg, #fff 0%, #fff 75%, #fff 100%);
    display: flex;
    align-items: center;
    justify-content: left;
    padding-left: 16px;
    color: var(--color-primary);
    font-size: 18px;
    font-weight: 600;
  }

  .tooltip::before {
    position: absolute;
    content: '';
    height: 0.6em;
    width: 0.6em;
    right: -0.2em;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    background: var(--color-primary);
  }

  .tooltip-container:hover .tooltip {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(-50%) translateX(30px);
  }

  .tooltip-container:hover {
    transition: 0.5s linear;
  }

  .mobile-only {
    display: none;
  }
}
/* =====================================
   SMALL DESKTOP FIX (1024px–1279px)
===================================== */
@media (min-width: 1024px) and (max-width: 1279px) {
  /* Reduce overall header padding */
  .header-main {
    padding: 0.8rem 1.5rem;
  }

  /* Smaller logo */
  .logo img {
    height: 52px;
  }

  /* Tighter navigation spacing */
  .main-nav ul {
    gap: 1.2rem;
  }

  /* Slightly smaller nav font */
  .main-nav a {
    font-size: clamp(0.85rem, 0.9vw, 1rem);
  }

  /* Reduce right section spacing */
  .header-right {
    gap: 1rem;
  }

  /* Smaller Online button */
  .tooltip-container {
    width: 42px;
    height: 42px;
  }

  .tooltip-container .borde-back {
    width: 50px;
    height: 50px;
  }

  .tooltip-container .icon {
    width: 42px;
    height: 42px;
  }

  .tooltip-container .icon img {
    width: 65%;
  }

  /* Slightly smaller language switcher */
  .lang-active {
    padding: 6px 10px;
    font-size: 0.85rem;
  }

  .lang-flag {
    width: 16px;
    height: 12px;
  }
}
