/* ==========================================================================
   NAVARMEDIA WIDGET — Hero Ecosistema (100% idéntico a index.html)
   Totalmente aislado frente a Hello Elementor / temas y editable desde Elementor
   ========================================================================== */

.nm-hero-widget {
  --nm-navy-950: #041424;
  --nm-navy-900: #082440;
  --nm-navy-800: #102C44;
  --nm-blue-600: #1860B8;
  --nm-blue-100: #E8F1FC;
  --nm-blue-50:  #F2F7FD;
  --nm-red-600:  #C82B24;
  --nm-red-500:  #E43830;
  --nm-red-100:  #FDECEC;
  --nm-red-200:  #F8CFCB;
  --nm-green-500: #10B981;
  --nm-slate-600: #475569;
  --nm-slate-300: #CBD5E1;
  --nm-slate-200: #E2E8F0;
  --nm-white:     #FFFFFF;
  --nm-hero-bg:   #EFF4F9;

  --nm-radius-md: 14px;
  --nm-radius-pill: 9999px;
  --nm-shadow-xs: 0 1px 2px rgba(8, 36, 64, 0.05);
  --nm-shadow-sm: 0 4px 14px rgba(8, 36, 64, 0.06), 0 1px 3px rgba(8, 36, 64, 0.04);
  --nm-shadow-md: 0 14px 32px rgba(8, 36, 64, 0.09), 0 3px 8px rgba(8, 36, 64, 0.04);

  --nm-font-sans: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --nm-container-max: 1200px;
  --nm-gutter: 32px;
  --nm-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --nm-transition: 0.28s var(--nm-ease);

  font-family: var(--nm-font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
  width: 100%;
}

.nm-hero-widget *,
.nm-hero-widget *::before,
.nm-hero-widget *::after {
  box-sizing: border-box;
}

.nm-hero-widget a {
  text-decoration: none;
}

.nm-hero-widget .nm-hero-section {
  position: relative;
  padding: 62px 0 82px;
  background-color: var(--nm-hero-bg);
  border-bottom: 1px solid var(--nm-slate-200);
  overflow: hidden;
  isolation: isolate;
  width: 100%;
}

.nm-hero-widget .nm-hero-container {
  width: 100%;
  max-width: var(--nm-container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--nm-gutter);
  padding-right: var(--nm-gutter);
}

/* Fondo fotográfico arquitectónico */
.nm-hero-widget .hero-photo-layer {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center right;
  opacity: 0.24;
  filter: saturate(0.45) contrast(1.02);
  z-index: -2;
  pointer-events: none;
}

/* Veladura luminosa */
.nm-hero-widget .hero-scrim {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 78% 36%, rgba(24, 96, 184, 0.10) 0%, transparent 48%),
    radial-gradient(circle at 12% 88%, rgba(228, 56, 48, 0.06) 0%, transparent 42%),
    linear-gradient(102deg, rgba(255, 255, 255, 0.96) 0%, rgba(248, 250, 253, 0.92) 48%, rgba(238, 244, 250, 0.72) 100%);
  z-index: -1;
  pointer-events: none;
}

.nm-hero-widget .hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 0.96fr) minmax(0, 1.04fr);
  align-items: center;
  gap: 48px;
}

.nm-hero-widget .hero-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

/* Cápsula superior (exactamente ajustada al contenido, nunca estirada) */
.nm-hero-widget .hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 16px;
  border-radius: var(--nm-radius-pill);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(203, 213, 225, 0.9);
  box-shadow: var(--nm-shadow-xs);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--nm-navy-900);
  margin: 0 0 22px 0;
  width: fit-content;
  max-width: 100%;
  line-height: 1.2;
}

.nm-hero-widget .hero-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--nm-green-500);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.22);
  flex-shrink: 0;
  animation: nmLivePulse 2.4s infinite ease-in-out;
}

@keyframes nmLivePulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.22); transform: scale(1); }
  50%      { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0.08); transform: scale(1.08); }
}

.nm-hero-widget .hero-title {
  font-family: var(--nm-font-sans);
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.034em;
  color: var(--nm-navy-900);
  margin: 0 0 22px 0;
  padding: 0;
}

.nm-hero-widget .hero-title .accent {
  background: linear-gradient(125deg, var(--nm-red-500) 0%, var(--nm-red-600) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.nm-hero-widget .hero-text {
  font-size: 1.08rem;
  line-height: 1.66;
  color: var(--nm-slate-600);
  max-width: 500px;
  margin: 0 0 30px 0;
  padding: 0;
}

/* Botones pill con brillo deslizante y flecha inline a la derecha */
.nm-hero-widget .hero-ctas {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin: 0 0 28px 0;
}

.nm-hero-widget .nm-btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 9px;
  padding: 14px 28px;
  border-radius: var(--nm-radius-pill);
  font-family: var(--nm-font-sans);
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
  transition: all var(--nm-transition);
  cursor: pointer;
}

.nm-hero-widget .nm-btn svg {
  transition: transform var(--nm-transition);
  flex-shrink: 0;
  display: block;
}

.nm-hero-widget .nm-btn:hover svg {
  transform: translateX(3px);
}

.nm-hero-widget .nm-btn--primary {
  background: linear-gradient(135deg, var(--nm-red-500) 0%, var(--nm-red-600) 100%);
  color: var(--nm-white);
  border: none;
  box-shadow: 0 8px 22px rgba(228, 56, 48, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.nm-hero-widget .nm-btn--primary::after {
  content: '';
  position: absolute;
  top: 0;
  left: -120%;
  width: 65%;
  height: 100%;
  background: linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, 0.28) 50%, transparent 100%);
  transition: left 0.6s var(--nm-ease);
  pointer-events: none;
}

.nm-hero-widget .nm-btn--primary:hover {
  color: var(--nm-white);
  filter: brightness(0.94);
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(228, 56, 48, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.nm-hero-widget .nm-btn--primary:hover::after {
  left: 140%;
}

.nm-hero-widget .nm-btn--secondary {
  background-color: rgba(255, 255, 255, 0.92);
  color: var(--nm-navy-900);
  border: 1.5px solid var(--nm-slate-300);
  box-shadow: var(--nm-shadow-xs);
}

.nm-hero-widget .nm-btn--secondary:hover {
  border-color: var(--nm-navy-900);
  color: var(--nm-navy-900);
  background-color: var(--nm-white);
  transform: translateY(-2px);
  box-shadow: var(--nm-shadow-sm);
}

.nm-hero-widget .hero-closeness {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 0.89rem;
  font-weight: 600;
  color: var(--nm-navy-900);
  padding-top: 16px;
  border-top: 1px solid rgba(8, 36, 64, 0.12);
}

.nm-hero-widget .hero-closeness svg {
  color: var(--nm-red-500);
  flex-shrink: 0;
  display: block;
}

/* ==========================================================================
   DIAGRAMA INTERACTIVO DE ECOSISTEMA (.ecosystem-board)
   ========================================================================== */
.nm-hero-widget .hero-diagram-wrap {
  width: 100%;
  max-width: 580px;
  margin-inline: auto;
}

.nm-hero-widget .ecosystem-board {
  position: relative;
  background: rgba(255, 255, 255, 0.80);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid rgba(255, 255, 255, 0.92);
  outline: 1.5px dashed rgba(24, 96, 184, 0.24);
  outline-offset: -8px;
  border-radius: 28px;
  padding: 26px 26px 22px;
  box-shadow:
    0 24px 56px rgba(8, 36, 64, 0.10),
    0 4px 12px rgba(8, 36, 64, 0.04);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  isolation: isolate;
}

.nm-hero-widget .diagram-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.nm-hero-widget .conn-line {
  transition: stroke 0.28s var(--nm-ease), stroke-opacity 0.28s var(--nm-ease), stroke-width 0.28s var(--nm-ease);
}

.nm-hero-widget .conn-line.is-active {
  stroke: var(--nm-red-500);
  stroke-opacity: 0.85;
  stroke-width: 2.4;
}

.nm-hero-widget .orbit-ring-spin {
  transform-origin: 280px 212px;
  animation: nmOrbitDash 44s linear infinite;
}

@keyframes nmOrbitDash {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.nm-hero-widget .concept-node {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: var(--nm-radius-pill);
  background: var(--nm-white);
  border: 1.5px solid var(--nm-red-200);
  box-shadow: var(--nm-shadow-sm);
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--nm-navy-900);
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.nm-hero-widget .concept-node-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--nm-red-100);
  color: var(--nm-red-500);
  flex-shrink: 0;
}

.nm-hero-widget .orbit-row {
  position: relative;
  z-index: 2;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.nm-hero-widget .orbit-card {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--nm-slate-200);
  border-radius: var(--nm-radius-md);
  padding: 13px 15px;
  box-shadow: var(--nm-shadow-sm);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  transition: transform var(--nm-transition), border-color var(--nm-transition), box-shadow var(--nm-transition), background-color var(--nm-transition);
}

.nm-hero-widget .orbit-card:hover {
  transform: translateY(-3px);
  border-color: var(--nm-blue-600);
  box-shadow: 0 14px 28px rgba(24, 96, 184, 0.15);
  background: var(--nm-white);
}

.nm-hero-widget .orbit-card:hover .orbit-card-icon {
  background: var(--nm-blue-600);
  color: var(--nm-white);
  border-color: var(--nm-blue-600);
}

.nm-hero-widget .orbit-card-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--nm-blue-50);
  color: var(--nm-blue-600);
  border: 1px solid var(--nm-blue-100);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--nm-transition);
}

.nm-hero-widget .orbit-card-meta {
  min-width: 0;
  flex: 1;
}

.nm-hero-widget .orbit-card-num {
  display: block;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--nm-blue-600);
  line-height: 1.1;
  margin-bottom: 2px;
}

.nm-hero-widget .orbit-card-title {
  display: block;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--nm-navy-900);
  line-height: 1.22;
  letter-spacing: -0.01em;
}

/* Círculo central Navarmedia */
.nm-hero-widget .hub-band {
  position: relative;
  z-index: 2;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 0;
}

.nm-hero-widget .hub-center {
  position: relative;
  width: 146px;
  height: 146px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 24%, #184A7C 0%, var(--nm-navy-900) 68%, #041527 100%);
  color: var(--nm-white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
  box-shadow:
    0 0 0 7px rgba(255, 255, 255, 0.96),
    0 0 0 9px rgba(24, 96, 184, 0.20),
    0 18px 38px rgba(8, 36, 64, 0.28);
  transition: transform var(--nm-transition), box-shadow var(--nm-transition);
}

.nm-hero-widget .hub-center::before {
  content: '';
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  border: 1.5px solid rgba(24, 96, 184, 0.22);
  animation: nmHubBreath 3.6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes nmHubBreath {
  0%, 100% { transform: scale(1); opacity: 0.65; }
  50%      { transform: scale(1.06); opacity: 0.2; }
}

.nm-hero-widget .hub-center.is-pulsing {
  transform: scale(1.04);
  box-shadow:
    0 0 0 7px rgba(255, 255, 255, 0.98),
    0 0 0 11px rgba(228, 56, 48, 0.24),
    0 20px 42px rgba(8, 36, 64, 0.34);
}

.nm-hero-widget .hub-center-brand {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 5px;
  color: var(--nm-white);
}

.nm-hero-widget .hub-center-brand span {
  color: #7DB8F5;
}

.nm-hero-widget .hub-center-sub {
  font-size: 0.61rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.3;
}

/* Barra inferior Seguridad integrada */
.nm-hero-widget .security-orbit-bar {
  position: relative;
  z-index: 2;
  width: 100%;
  margin-top: 2px;
  padding: 11px 16px;
  border-radius: var(--nm-radius-md);
  background: linear-gradient(95deg, #061D35 0%, #0D3157 50%, #061D35 100%);
  border: 1px solid rgba(125, 184, 245, 0.30);
  color: var(--nm-white);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: var(--nm-shadow-sm);
  transition: all var(--nm-transition);
}

.nm-hero-widget .security-orbit-bar svg {
  color: #6EE7B7;
  flex-shrink: 0;
  display: block;
}

.nm-hero-widget .security-orbit-bar:hover {
  color: var(--nm-white);
  border-color: #6EE7B7;
  transform: translateY(-1px);
  box-shadow: var(--nm-shadow-md);
}

/* ==========================================================================
   RESPONSIVE EXACTO DE INDEX.HTML
   ========================================================================== */
@media (max-width: 1100px) {
  .nm-hero-widget .hero-grid { gap: 36px; }
}

@media (max-width: 980px) {
  .nm-hero-widget { --nm-gutter: 24px; }
  .nm-hero-widget .nm-hero-section { padding: 46px 0 64px; }
  .nm-hero-widget .hero-grid {
    grid-template-columns: 1fr;
    gap: 44px;
  }
  .nm-hero-widget .hero-content { max-width: 660px; }
  .nm-hero-widget .hero-text { max-width: 600px; }
}

@media (max-width: 640px) {
  .nm-hero-widget { --nm-gutter: 20px; }
  .nm-hero-widget .nm-hero-section { padding: 36px 0 52px; }
  .nm-hero-widget .hero-ctas {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }
  .nm-hero-widget .hero-ctas .nm-btn { width: 100%; }
  .nm-hero-widget .ecosystem-board {
    padding: 18px 16px 16px;
    border-radius: 20px;
    gap: 14px;
    outline-offset: -6px;
  }
  .nm-hero-widget .orbit-row { gap: 12px; }
  .nm-hero-widget .orbit-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 13px;
  }
  .nm-hero-widget .orbit-card-icon { width: 34px; height: 34px; }
  .nm-hero-widget .orbit-card-title { font-size: 0.88rem; }
  .nm-hero-widget .hub-center { width: 128px; height: 128px; }
  .nm-hero-widget .hub-center-brand { font-size: 1.02rem; }
}

@media (max-width: 400px) {
  .nm-hero-widget { --nm-gutter: 16px; }
  .nm-hero-widget .orbit-row { grid-template-columns: 1fr; }
  .nm-hero-widget .orbit-card {
    flex-direction: row;
    align-items: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nm-hero-widget .hero-badge-dot,
  .nm-hero-widget .orbit-ring-spin,
  .nm-hero-widget .hub-center::before {
    animation: none !important;
  }
}
