/* ==========================================================================
   Navbar global (views/layouts/navbar.php)
   Prefijo .ian- para no chocar con estilos existentes.
   ========================================================================== */

@property --ian-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

:root {
  --ian-h: 84px;
  --ian-h-scrolled: 68px;
  --ian-navy: #07184f;
  --ian-ink: #050a24;
  --ian-blue: #0c3dde;
  --ian-sky: #3fa9f5;
  --ian-violet: #7b2ff7;
  --ian-orange: #ff8654;
  --ian-pink: #db40b5;
  --ian-ring: conic-gradient(from var(--ian-angle), #3fa9f5, #0c3dde, #7b2ff7, #db40b5, #ff8654, #3fa9f5);
}

html {
  scroll-padding-top: calc(var(--ian-h-scrolled) + 16px);
}

/* ---------- BARRA ---------- */

.ian {
  position: sticky;
  top: 0;
  z-index: 1030;
  background-image: linear-gradient(91deg, #00021c, #082177, #0337db);
  background-color: #0c3dde;
  font-family: "Roboto-Regular", sans-serif;
  transition: box-shadow 0.3s ease, background-color 0.3s ease;
}

.ian.is-scrolled {
  box-shadow: 0 10px 30px rgba(0, 2, 28, 0.35);
}

.ian-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: var(--ian-h);
  transition: height 0.3s ease;
}

.ian.is-scrolled .ian-bar {
  height: var(--ian-h-scrolled);
}

.ian-brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.ian-logo {
  height: 46px;
  width: auto;
  transition: height 0.3s ease;
}

.ian.is-scrolled .ian-logo {
  height: 38px;
}

/* ---------- MENÚ DESKTOP ---------- */

.ian-nav {
  flex-grow: 1;
  justify-content: center;
}

.ian-menu {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.ian-item {
  position: relative;
}

.ian-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: "Roboto-Medium", sans-serif;
  font-size: 0.98rem;
  color: rgba(255, 255, 255, 0.82);
  background: transparent;
  border: 0;
  border-radius: 50px;
  padding: 10px 16px;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.25s ease, background-color 0.25s ease;
}

/* Línea degradada debajo del link */
.ian-link::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 4px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--ian-sky), var(--ian-pink));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.ian-link:hover,
.ian-link:focus-visible,
.ian-item.is-open > .ian-link {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.08);
}

.ian-link:hover::after,
.ian-link.is-active::after,
.ian-item.is-open > .ian-link::after {
  transform: scaleX(1);
}

.ian-link.is-active {
  color: #ffffff;
}

.ian-link:focus-visible {
  outline: 2px solid var(--ian-sky);
  outline-offset: 2px;
}

.ian-caret {
  font-size: 0.7rem;
  transition: transform 0.3s ease;
}

.ian-item.is-open .ian-caret,
.ian-mtoggle:not(.collapsed) .ian-caret {
  transform: rotate(180deg);
}

/* ---------- DROPDOWNS ---------- */

.ian-drop {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  min-width: 280px;
  padding: 10px;
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 2, 28, 0.28);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 10px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}

/* Puente invisible para que el hover no se corte entre el link y el panel */
.ian-drop::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -16px;
  height: 16px;
}

/* Flechita */
.ian-drop::after {
  content: "";
  position: absolute;
  top: -6px;
  left: 50%;
  width: 14px;
  height: 14px;
  background: #ffffff;
  border-radius: 3px;
  transform: translateX(-50%) rotate(45deg);
}

.ian-item.is-open > .ian-drop {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

@media (hover: hover) and (min-width: 992px) {
  .ian-item--drop:hover > .ian-drop {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
  }

  .ian-item--drop:hover .ian-caret {
    transform: rotate(180deg);
  }

  .ian-item--drop:hover > .ian-link {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.08);
  }

  .ian-item--drop:hover > .ian-link::after {
    transform: scaleX(1);
  }
}

.ian-drop--mega {
  width: 620px;
  padding: 14px;
}

.ian-mega-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
}

.ian-drop-link {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  text-decoration: none;
  color: #484848;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.ian-drop-link--compact {
  align-items: center;
  padding: 10px 12px;
}

.ian-drop-link:hover,
.ian-drop-link:focus-visible {
  background-color: #f2f5fc;
  color: #484848;
}

.ian-drop-link.is-current {
  background-color: #eef2ff;
}

.ian-drop-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  color: #ffffff;
  background: linear-gradient(135deg, var(--ian-blue), var(--ian-navy));
  transition: background 0.25s ease, transform 0.25s ease;
}

.ian-drop-link:hover .ian-drop-icon,
.ian-drop-link.is-current .ian-drop-icon {
  background: linear-gradient(135deg, var(--ian-orange), var(--ian-pink));
  transform: scale(1.05);
}

.ian-drop-title {
  display: block;
  font-family: "Roboto-Bold", sans-serif;
  font-size: 0.95rem;
  line-height: 1.3;
  color: var(--ian-navy);
}

.ian-drop-text {
  display: block;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #6b7280;
  margin-top: 2px;
}

.ian-drop-foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding: 14px 16px;
  border-radius: 12px;
  font-family: "Roboto-Medium", sans-serif;
  font-size: 0.92rem;
  color: #ffffff;
  text-decoration: none;
  background-image: linear-gradient(91deg, #00021c, #082177, #0337db);
  transition: filter 0.25s ease;
}

.ian-drop-foot:hover {
  color: #ffffff;
  filter: brightness(1.15);
}

.ian-drop-foot i,
.ian-drop-foot svg {
  transition: transform 0.25s ease;
}

.ian-drop-foot:hover i,
.ian-drop-foot:hover svg {
  transform: translateX(4px);
}

/* ---------- CTA (botón glow) ---------- */

.ian-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.ian-cta {
  --ian-angle: 0deg;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-family: "Roboto-Medium", sans-serif;
  font-size: 0.92rem;
  line-height: 1.2;
  white-space: nowrap;
  color: #ffffff;
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: 50px;
  padding: 10px 22px;
  background:
    linear-gradient(var(--ian-ink), var(--ian-ink)) padding-box,
    var(--ian-ring) border-box;
  box-shadow: 0 6px 16px rgba(0, 2, 28, 0.3);
  transition: box-shadow 0.35s ease, transform 0.35s ease;
}

.ian-cta:hover,
.ian-cta:focus-visible {
  color: #ffffff;
  transform: translateY(-2px);
  background:
    linear-gradient(120deg, #0a1240, var(--ian-ink) 60%) padding-box,
    var(--ian-ring) border-box;
  box-shadow:
    -6px 0 18px rgba(63, 169, 245, 0.55),
    6px 0 18px rgba(219, 64, 181, 0.45),
    0 10px 28px rgba(123, 47, 247, 0.35);
  animation: ian-spin 2.4s linear infinite;
}

.ian-cta--block {
  display: flex;
  width: 100%;
  padding: 14px 22px;
  font-size: 1rem;
}

@keyframes ian-spin {
  to {
    --ian-angle: 360deg;
  }
}

/* ---------- HAMBURGUESA ---------- */

.ian-burger {
  width: 46px;
  height: 46px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: background-color 0.25s ease;
}

.ian-burger span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: #ffffff;
  transition: width 0.25s ease;
}

.ian-burger span:nth-child(2) {
  width: 14px;
  align-self: center;
  margin-left: 6px;
}

.ian-burger:hover {
  background: rgba(255, 255, 255, 0.16);
}

.ian-burger:hover span:nth-child(2) {
  width: 20px;
  margin-left: 0;
}

/* ---------- MENÚ MÓVIL (offcanvas) ---------- */

.ian-mobile.offcanvas {
  --bs-offcanvas-width: min(380px, 88vw);
  background-image: linear-gradient(165deg, #00021c 0%, #071a63 55%, #0a33c4 100%);
  color: #ffffff;
  border-left: 0;
  font-family: "Roboto-Regular", sans-serif;
}

.ian-mobile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ian-mobile-head .ian-logo {
  height: 40px;
}

.ian-close {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 1.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.ian-mobile-body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-grow: 1;
  overflow-y: auto;
  padding: 14px 16px 24px;
}

.ian-mlist {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ian-mlink {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  font-family: "Roboto-Medium", sans-serif;
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.88);
  background: transparent;
  border: 0;
  border-radius: 12px;
  padding: 14px 12px;
  text-decoration: none;
  text-align: left;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.ian-mlink:hover,
.ian-mlink:focus-visible,
.ian-mlink.is-active {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.08);
}

.ian-mlink.is-active {
  box-shadow: inset 3px 0 0 var(--ian-sky);
}

.ian-msub {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 0 10px 8px;
}

.ian-msub-link {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.98rem;
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  border-radius: 10px;
  padding: 9px 10px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.ian-msub-link .ian-drop-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 0.82rem;
  background: rgba(255, 255, 255, 0.12);
}

.ian-msub-link:hover,
.ian-msub-link.is-current {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.08);
}

.ian-msub-link:hover .ian-drop-icon,
.ian-msub-link.is-current .ian-drop-icon {
  background: linear-gradient(135deg, var(--ian-orange), var(--ian-pink));
}

.ian-mobile-foot {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.ian-mobile-contact {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ian-mobile-contact a {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
}

.ian-mobile-contact i,
.ian-mobile-contact svg {
  color: var(--ian-sky);
  width: 16px;
}

.ian-mobile-social {
  display: flex;
  gap: 10px;
}

.ian-mobile-social a {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  text-decoration: none;
  transition: background 0.25s ease;
}

.ian-mobile-social a:hover {
  background: linear-gradient(135deg, var(--ian-orange), var(--ian-pink));
}

.offcanvas-backdrop.show {
  opacity: 0.6;
}

/* ---------- RESPONSIVE ---------- */

@media (max-width: 1199.98px) {
  .ian-link {
    padding: 10px 11px;
    font-size: 0.93rem;
  }

  .ian-link::after {
    left: 11px;
    right: 11px;
  }

  .ian-cta {
    padding: 9px 16px;
    font-size: 0.86rem;
  }
}

@media (max-width: 991.98px) {
  :root {
    --ian-h: 72px;
    --ian-h-scrolled: 64px;
  }

  .ian-logo {
    height: 40px;
  }

  .ian.is-scrolled .ian-logo {
    height: 36px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ian,
  .ian-bar,
  .ian-logo,
  .ian-link,
  .ian-link::after,
  .ian-drop,
  .ian-cta,
  .ian-caret {
    transition: none;
  }

  .ian-cta:hover {
    animation: none;
    transform: none;
  }
}
