/* =========================================================
   NAVBAR AISLADO SOPORTFIX (/css/navbar.css)
   Prefijo sf- para evitar conflictos con style.css o Bootstrap
========================================================= */
.sf-header,
.sf-header *,
.sf-header *::before,
.sf-header *::after {
  box-sizing: border-box;
}

.sf-header {
  position: relative;
  z-index: 1000;
  font-family: "Inter", sans-serif;
}

.sf-navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 80px;
  padding: 0;
  background: rgba(0, 40, 90, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: height 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  z-index: 1000;
}

.sf-navbar.scrolled {
  height: 70px;
  background: rgba(2, 24, 56, 0.96);
  border-bottom: 1px solid rgba(44, 195, 244, 0.24);
  box-shadow: 0 10px 30px rgba(0, 12, 32, 0.32);
}

.sf-navbar-inner {
  width: 100%;
  max-width: 1280px;
  height: 100%;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* --- LOGO --- */
.sf-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
  z-index: 1101;
}

.sf-logo-img {
  width: 175px;
  height: 64px;
  object-fit: contain;
  display: block;
  transition: transform 0.3s ease, height 0.3s ease;
}

.sf-navbar.scrolled .sf-logo-img {
  height: 56px;
}

.sf-logo:hover .sf-logo-img {
  transform: scale(1.02);
}

/* --- MENÚ DESKTOP --- */
.sf-nav-menu {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.sf-nav-menu > li {
  position: relative;
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
}

/* Oculto estrictamente en escritorio */
.sf-nav-menu > li.sf-mobile-socials {
  display: none;
}

.sf-nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  margin: 0;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.88);
  font-family: "Inter", sans-serif;
  font-size: 0.94rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  border-radius: 10px;
  transition: color 0.25s ease, background-color 0.25s ease;
}

.sf-nav-link::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 4px;
  height: 2px;
  background: linear-gradient(90deg, #2cc3f4, #4fa2ff);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.sf-nav-link:hover,
.sf-nav-link.active,
.sf-dropdown:hover > .sf-dropdown-toggle,
.sf-dropdown.active > .sf-dropdown-toggle {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.07);
}

.sf-nav-link:hover::after,
.sf-nav-link.active::after,
.sf-dropdown:hover > .sf-dropdown-toggle::after {
  transform: scaleX(1);
}

.sf-chevron {
  font-size: 0.68rem;
  opacity: 0.75;
  transition: transform 0.25s ease, color 0.25s ease;
}

.sf-dropdown:hover .sf-chevron,
.sf-dropdown.active .sf-chevron {
  transform: rotate(180deg);
  color: #2cc3f4;
  opacity: 1;
}

/* --- DROPDOWNS Y MEGA-MENÚ --- */
.sf-dropdown {
  position: relative;
}

/* Puente invisible para evitar que el submenú se cierre al bajar el cursor */
.sf-dropdown::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  height: 18px;
}

.sf-dropdown-menu {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  min-width: 250px;
  padding: 10px;
  margin: 0;
  list-style: none;
  background: rgba(5, 26, 58, 0.98);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 18px;
  box-shadow: 0 24px 50px rgba(0, 10, 28, 0.45);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
  z-index: 1020;
}

.sf-dropdown-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(245px, 1fr));
  gap: 8px;
  min-width: 560px;
  max-width: calc(100vw - 40px);
  padding: 12px;
}

.sf-dropdown:hover > .sf-dropdown-menu,
.sf-dropdown:focus-within > .sf-dropdown-menu,
.sf-dropdown.active > .sf-dropdown-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.sf-dropdown-menu li {
  margin: 0;
  padding: 0;
}

.sf-dropdown-menu li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin: 0;
  border-radius: 12px;
  text-decoration: none;
  color: #e2e8f0;
  transition: background-color 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.sf-dropdown-menu li a:hover,
.sf-dropdown-menu li a.active {
  background: rgba(44, 195, 244, 0.14);
  color: #ffffff;
  transform: translateX(3px);
}

.sf-dd-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(44, 195, 244, 0.12);
  border: 1px solid rgba(44, 195, 244, 0.24);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.sf-dd-icon i {
  color: #2cc3f4;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.sf-dropdown-menu li a:hover .sf-dd-icon,
.sf-dropdown-menu li a.active .sf-dd-icon {
  background: #2cc3f4;
  border-color: #2cc3f4;
  transform: scale(1.05);
}

.sf-dropdown-menu li a:hover .sf-dd-icon i,
.sf-dropdown-menu li a.active .sf-dd-icon i {
  color: #031a3d;
}

.sf-dd-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.sf-dd-text strong {
  font-size: 0.88rem;
  font-weight: 600;
  color: #ffffff;
}

.sf-dd-text small {
  font-size: 0.75rem;
  color: #94a3b8;
  margin-top: 2px;
}

.sf-dd-view-all a {
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed rgba(44, 195, 244, 0.3);
}

.sf-dd-arrow {
  margin-left: auto;
  font-size: 0.8rem;
  color: #2cc3f4;
  transition: transform 0.2s ease;
}

.sf-dd-view-all a:hover .sf-dd-arrow {
  transform: translateX(4px);
}

.sf-dot-online {
  width: 7px;
  height: 7px;
  background-color: #22c55e;
  border-radius: 50%;
  margin-left: auto;
  flex-shrink: 0;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.55);
  animation: sf-pulse-green 2s infinite;
}

@keyframes sf-pulse-green {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 8px rgba(34, 197, 94, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

/* --- BOTÓN PORTAL CLIENTES --- */
.sf-portal-item {
  margin-left: 14px;
}

.sf-btn-portal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 999px;
  background: rgba(26, 115, 232, 0.16);
  border: 1.5px solid rgba(44, 195, 244, 0.55);
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.2px;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.sf-btn-portal i {
  color: #2cc3f4;
  font-size: 0.9rem;
  transition: color 0.25s ease;
}

.sf-btn-portal:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #1a73e8 0%, #2cc3f4 100%);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 8px 22px rgba(44, 195, 244, 0.35);
}

.sf-btn-portal:hover i {
  color: #ffffff;
}

/* --- CONTROLES MÓVIL (OCULTOS EN DESKTOP) --- */
.sf-mobile-actions,
.sf-contact-mobile,
.sf-menu-toggle,
.sf-nav-overlay {
  display: none;
}

body.nav-open {
  overflow: hidden;
}

/* =========================================================
   RESPONSIVE MÓVIL Y TABLET (HASTA 992px)
========================================================= */
@media (max-width: 992px) {
  .sf-navbar {
    height: 76px;
  }

  .sf-navbar.scrolled {
    height: 68px;
  }

  .sf-navbar-inner {
    padding: 0 18px;
  }

  .sf-logo-img {
    width: 150px;
    height: 54px;
  }

  .sf-mobile-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1101;
  }

  .sf-contact-mobile {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .sf-contact-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #ffffff;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: background-color 0.2s ease, transform 0.2s ease;
  }

  .sf-contact-icon:active {
    transform: scale(0.92);
    background: rgba(44, 195, 244, 0.25);
  }

  .sf-menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    padding: 0;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 10px;
    cursor: pointer;
    z-index: 1101;
  }

  .sf-menu-toggle span {
    display: block;
    width: 22px;
    height: 2.5px;
    background-color: #ffffff;
    border-radius: 3px;
    transition: transform 0.3s ease, opacity 0.2s ease, background-color 0.3s ease;
  }

  .sf-menu-toggle.is-active span {
    background-color: #2cc3f4;
  }

  .sf-menu-toggle.is-active span:nth-child(1) {
    transform: translateY(7.5px) rotate(45deg);
  }

  .sf-menu-toggle.is-active span:nth-child(2) {
    opacity: 0;
  }

  .sf-menu-toggle.is-active span:nth-child(3) {
    transform: translateY(-7.5px) rotate(-45deg);
  }

  .sf-nav-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(2, 12, 30, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 998;
  }

  .sf-nav-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .sf-nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 86%;
    max-width: 360px;
    height: 100dvh;
    padding: 92px 18px 32px;
    background: linear-gradient(180deg, #061834 0%, #0b1324 100%);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: -15px 0 40px rgba(0, 0, 0, 0.45);
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 4px;
    overflow-y: auto;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1050;
  }

  .sf-nav-menu.active {
    right: 0;
  }

  .sf-nav-menu > li {
    width: 100%;
    display: block;
  }

  .sf-nav-link {
    width: 100%;
    justify-content: space-between;
    padding: 14px 16px;
    font-size: 1rem;
    border-radius: 12px;
  }

  .sf-nav-link::after,
  .sf-dropdown::after {
    display: none;
  }

  .sf-dropdown-menu,
  .sf-dropdown-grid {
    position: static;
    display: block;
    min-width: 0;
    max-width: 100%;
    width: 100%;
    max-height: 0;
    padding: 0;
    margin: 0;
    transform: none;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.04);
    border: none;
    border-left: 3px solid #2cc3f4;
    border-radius: 0 12px 12px 0;
    box-shadow: none;
    transition: max-height 0.35s ease, opacity 0.25s ease, padding 0.25s ease;
  }

  .sf-dropdown:hover > .sf-dropdown-menu,
  .sf-dropdown:focus-within > .sf-dropdown-menu {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: none;
  }

  .sf-dropdown.active > .sf-dropdown-menu {
    max-height: 800px;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    padding: 6px;
    margin: 4px 0 8px;
  }

  .sf-dropdown-menu li a:hover {
    transform: none;
  }

  .sf-portal-item {
    margin: 18px 0 0;
    width: 100%;
  }

  .sf-btn-portal {
    width: 100%;
    padding: 13px 18px;
    font-size: 0.96rem;
  }

  .sf-nav-menu > li.sf-mobile-socials {
    display: block;
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }

  .sf-mobile-socials p {
    color: #94a3b8;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    margin: 0 0 14px;
  }

  .sf-social-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
  }

  .sf-social-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.1rem;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease;
  }

  .sf-social-btn:active {
    transform: scale(0.92);
  }

  .sf-social-btn.fb {
    background: #1877f2;
  }

  .sf-social-btn.ig {
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  }

  .sf-social-btn.share {
    background: #1a73e8;
  }
}