/* ============================================================
 * SynckPro · Header (réplica WebPros)
 * Transparente sobre hero oscuro → sólido al hacer scroll.
 * ============================================================ */

.synck-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  color: #fff;
  transition: background-color .3s ease, color .3s ease, box-shadow .3s ease;
}

.synck-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: var(--synck-header-h);
}

/* Logo: light por defecto, dark al scrollear */
.synck-header__logo { display: inline-flex; align-items: center; flex-shrink: 0; }
.synck-header__logo img { height: 30px; width: auto; }
.synck-header__logo--dark { display: none; }
.synck-header.is-scrolled { background: #fff; color: var(--synck-gray-900); box-shadow: 0 1px 0 var(--synck-gray-300); }
.synck-header.is-scrolled .synck-header__logo--light { display: none; }
.synck-header.is-scrolled .synck-header__logo--dark { display: block; }

/* Nav */
.synck-nav__list {
  display: flex;
  align-items: center;
  gap: 26px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.synck-nav__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 0;
  color: inherit;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  padding: 10px 0;
  opacity: .95;
}
.synck-nav__link:hover { opacity: 1; }
.synck-nav__caret { transition: transform .2s ease; }
.has-dropdown.is-open .synck-nav__caret { transform: rotate(180deg); }

.synck-nav__item--divider {
  width: 1px;
  height: 22px;
  background: currentColor;
  opacity: .35;
}

/* Acciones del header (móvil): idioma + burger */
.synck-header__actions {
  display: none;
  align-items: center;
  gap: 4px;
  position: relative;
  z-index: 102;
}
.has-lang--mobile .synck-lang__menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 103;
}

/* Dropdown de idioma */
.has-lang { position: relative; }
.synck-lang__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid currentColor;
  background: transparent;
  padding: 0;
  opacity: .95;
}
.synck-lang__toggle:hover { opacity: 1; }
.synck-lang__toggle img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.synck-lang__menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 180px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #fff;
  color: var(--synck-gray-900);
  border: 1px solid var(--synck-gray-300);
  border-radius: 12px;
  box-shadow: 0 20px 44px rgba(6, 7, 13, .18);
  display: none;
}
.has-lang.is-open .synck-lang__menu { display: block; }
.synck-lang__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: none;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: inherit;
  text-align: left;
}
.synck-lang__item:hover { background: #f7f7f3; }
.synck-lang__item img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .08);
}
.synck-lang__item.is-active { font-weight: 700; }

/* CTA morado como en la captura */
.synck-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--synck-core);
  color: #fff !important;
  font-weight: 600;
  font-size: 14px;
  padding: 11px 20px;
  border-radius: 9px;
  text-decoration: none;
  transition: background-color .2s ease, transform .2s ease;
  white-space: nowrap;
}
.synck-btn:hover { background: var(--synck-core-700); }

/* Dropdown */
.has-dropdown { position: relative; }

/* Puente invisible que cubre el gap de 10px entre el toggle y el menú.
   Sin esto, al bajar el mouse al subitem se dispara mouseleave y se cierra. */
.has-dropdown::after {
  content: "";
  position: absolute;
  top: 100%;
  left: -20px;
  right: -20px;
  height: 16px;
  display: none;
}
.has-dropdown.is-open::after { display: block; }

.synck-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  min-width: 430px;
  background: #fff;
  color: var(--synck-gray-900);
  border: 1px solid var(--synck-gray-300);
  border-radius: var(--synck-radius-m);
  box-shadow: 0 12px 40px rgba(12, 13, 16, .16);
  padding: 12px;
  display: grid;
  gap: 4px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
}
.synck-dropdown--sm { min-width: 320px; }

/* Mega dropdown Soluciones: 2 columnas de items + panel imagen.
   Fijo y centrado al viewport para que nunca desborde. */
.synck-dropdown--mega {
  position: fixed;
  top: calc(var(--synck-header-h) + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  min-width: 980px;
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr 250px;
  gap: 16px;
}
.has-dropdown.is-open .synck-dropdown--mega {
  transform: translateX(-50%) translateY(0);
}
.synck-dropdown__cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  align-content: start;
}
/* Placeholder vertical para imagen (se sustituirá más adelante) */
.synck-dropdown__promo {
  background: var(--synck-core);
  border-radius: var(--synck-radius-s);
  min-height: 320px;
}
.synck-dropdown__promo.has-image {
  background:
    linear-gradient(180deg, rgba(6, 7, 13, 0) 30%, rgba(6, 7, 13, .55) 62%, rgba(4, 6, 14, .92) 100%),
    var(--promo-bg) center / cover no-repeat,
    var(--synck-core);
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
  padding: 22px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 20px 44px rgba(3, 6, 18, .35);
}
.synck-dropdown__promo-title {
  margin: 0;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.4px;
  line-height: 1.2;
  text-wrap: balance;
}
.synck-dropdown__promo-text {
  font-size: 13.5px;
  line-height: 1.55;
  color: rgba(255, 255, 255, .82);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.synck-dropdown__promo-text p { margin: 0; }
.synck-dropdown__promo-text a { color: #fff; }
.synck-dropdown__promo-btn {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  color: var(--synck-gray-900);
  font-size: 13px;
  font-weight: 700;
  padding: 9px 18px;
  border-radius: 999px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .3);
  transition: transform .2s ease, box-shadow .2s ease;
}
.synck-dropdown__promo:hover .synck-dropdown__promo-btn {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, .35);
}
.synck-dropdown__promo-btn::after {
  content: "→";
  font-weight: 700;
}
.has-dropdown.is-open .synck-dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.synck-dropdown__item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 32px 10px 8px;
  border-radius: var(--synck-radius-s);
  text-decoration: none;
  color: inherit;
  transition: background-color .15s ease;
}
.synck-dropdown__item:hover { background: #f7f7f3; }

.synck-dropdown__icon {
  width: 48px;
  height: 48px;
  min-width: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--synck-gray-300);
  border-radius: 12px;
  color: var(--synck-gray-900);
  background: #fff;
  transition: background-color .15s ease, color .15s ease;
}
.synck-dropdown__item:hover .synck-dropdown__icon {
  background: var(--synck-core);
  border-color: var(--synck-core);
  color: #fff;
}

/* Remix Icons dentro de las cajas de icono del dropdown */
.synck-dropdown__icon > i[class^="ri-"],
.synck-dropdown__icon > i[class*=" ri-"] {
  font-size: 24px;
  line-height: 1;
}

.synck-dropdown__text { display: grid; gap: 2px; }
.synck-dropdown__text strong { font-size: 15px; font-weight: 600; }
.synck-dropdown__text small { font-size: 13.5px; color: var(--synck-gray-600); }

/* Teclado: mantener abierto con foco dentro (desktop) */
@media (hover: hover) and (min-width: 1024px) {
  .has-dropdown:focus-within .synck-dropdown {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
  }
  .has-dropdown:focus-within .synck-dropdown--mega {
    transform: translateX(-50%) translateY(0);
  }
}

/* Burger móvil: currentColor lo hace dinámico —
   blanco sobre el hero, negro con header en fondo blanco */
.synck-header__burger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  padding: 10px;
  position: relative;
  z-index: 102;
}
.synck-header__burger span {
  width: 26px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform .25s ease, opacity .25s ease, background-color .3s ease;
}
.synck-header.is-scrolled .synck-header__burger span {
  background: var(--synck-gray-900);
}
.synck-header__inner:has(.synck-nav.is-open) .synck-header__burger { color: var(--synck-gray-900); }
.synck-header__inner:has(.synck-nav.is-open) .synck-header__burger span { background: var(--synck-gray-900); }
.synck-header__inner:has(.synck-nav.is-open) .synck-header__burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.synck-header__inner:has(.synck-nav.is-open) .synck-header__burger span:nth-child(2) { opacity: 0; }
.synck-header__inner:has(.synck-nav.is-open) .synck-header__burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Backdrop del sidepanel móvil */
.synck-nav__backdrop {
  display: none;
}
@media (max-width: 1023px) {
  .synck-nav__backdrop.is-open {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 98;
    background: rgba(6, 7, 13, .5);
  }
}

/* Responsive */
@media (max-width: 1023px) {
  .has-dropdown::after { display: none !important; }
  .synck-header__actions { display: inline-flex; }
  .synck-header__burger { display: inline-flex; }
  .synck-nav .has-lang { display: none; }

  /* Sidepanel lateral derecho */
  .synck-nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(360px, 90vw);
    z-index: 99;
    background: #fff;
    color: var(--synck-gray-900);
    padding-top: var(--synck-header-h);
    transform: translateX(105%);
    transition: transform .3s ease;
    box-shadow: -20px 0 40px rgba(0, 0, 0, .18);
    overflow-y: auto;
  }
  .synck-nav.is-open { transform: translateX(0); }

  .synck-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 20px 24px;
  }
  .synck-nav__item--divider { display: none; }
  .synck-nav__link { width: 100%; justify-content: space-between; padding: 14px 4px; border-bottom: 1px solid var(--synck-gray-300); }

  .synck-dropdown {
    position: static;
    transform: none;
    min-width: 0;
    border: 0;
    box-shadow: none;
    padding: 0;
    display: none;
  }
  .has-dropdown.is-open .synck-dropdown { display: grid; opacity: 1; visibility: visible; transform: none; }
  .synck-dropdown--mega { position: static; grid-template-columns: 1fr; min-width: 0; left: auto; }
  .synck-dropdown__cols { grid-template-columns: 1fr; }
  .synck-dropdown__promo { display: none; }
  .synck-dropdown__item { padding-right: 8px; }
  .synck-nav__item--cta { padding-top: 16px; }
  .synck-btn { width: 100%; }
}
