/****************************************
 * PSYCOPYME · CSS OPTIMIZADO
 * NAV PREMIUM + MASTERSTUDY + EMBEDS
 * SIN CAMBIAR TAMAÑOS
 ****************************************/


/* ========================================
   1) MENÚ INFERIOR MÓVIL · TECH / TRUST
======================================== */
.menu-inferior-movil{
  position: fixed !important;
  inset: auto 0 0 0 !important;
  z-index: 2147483647 !important;

  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 4px;

  padding: 10px 6px calc(10px + env(safe-area-inset-bottom));
  overflow: hidden;

  background:
    linear-gradient(
      135deg,
      #020b3a 0%,
      #071a74 30%,
      #0b3fb8 62%,
      #1698ff 100%
    );
  background-size: 280% 280%;
  animation: ppGradientFlow 10s ease-in-out infinite;

  border-top: 1px solid rgba(255,255,255,.14);

  box-shadow:
    0 -16px 34px rgba(0,0,0,.38),
    0 -1px 0 rgba(255,255,255,.05) inset,
    0 0 22px rgba(34,139,255,.14);

  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  isolation: isolate;
}

/* glow / glass */
.menu-inferior-movil::before{
  content:"";
  position:absolute;
  inset:0;
  z-index:1 !important;
  pointer-events:none;
  mix-blend-mode:screen;

  background:
    radial-gradient(700px 180px at 8% 0%, rgba(255,255,255,.14), transparent 58%),
    radial-gradient(700px 180px at 100% 100%, rgba(56,189,248,.24), transparent 56%),
    radial-gradient(500px 140px at 50% 120%, rgba(59,130,246,.18), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(0,0,0,.10));
}

/* línea superior */
.menu-inferior-movil::after{
  content:"";
  position:absolute;
  left:10px;
  right:10px;
  top:0;
  height:1px;
  z-index:1 !important;
  pointer-events:none;

  background: linear-gradient(
    90deg,
    transparent,
    rgba(147,197,253,.80),
    rgba(56,189,248,.95),
    transparent
  );
}

/* enlaces */
.menu-inferior-movil a{
  position: relative;
  z-index: 2 !important;

  flex: 1 1 0;
  min-width: 60px;

  text-align: center;
  text-decoration: none !important;
  color: rgba(255,255,255,.95) !important;

  font-size: 11px;
  line-height: 1.2;
  font-weight: 600;
  opacity: .96;

  transition:
    transform .18s ease,
    opacity .18s ease,
    filter .18s ease,
    color .18s ease;
}

.menu-inferior-movil a span{
  display:block;
  position: relative;
  z-index: 2 !important;

  font-size:20px;
  margin-bottom:4px;

  transition: transform .2s ease, filter .2s ease;

  filter:
    drop-shadow(0 2px 8px rgba(0,0,0,.34))
    drop-shadow(0 0 8px rgba(59,130,246,.18));
}

.menu-inferior-movil i{
  position: relative;
  z-index: 2 !important;
}

.menu-inferior-movil a:hover,
.menu-inferior-movil a:focus{
  transform: translateY(-2px);
  opacity:1;
  color:#ffffff !important;
  filter:brightness(1.08);
}

.menu-inferior-movil a:hover span,
.menu-inferior-movil a:focus span{
  transform:scale(1.08);
}

.menu-inferior-movil a.active{
  opacity:1;
  color:#ffffff !important;
}

.menu-inferior-movil a.active span{
  filter:
    drop-shadow(0 2px 10px rgba(0,0,0,.40))
    drop-shadow(0 0 12px rgba(125,211,252,.40))
    drop-shadow(0 0 18px rgba(37,99,235,.20));
}

@keyframes ppGradientFlow{
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@media (prefers-reduced-motion: reduce){
  .menu-inferior-movil{
    animation:none;
    background-size:100% 100%;
  }
}

@media (min-width:1025px){
  .menu-inferior-movil{
    display:none;
  }
}

@media (max-width:1024px){
  body{
    padding-bottom: 92px !important;
  }
}


/* ========================================
   2) MASTERSTUDY · TOPBAR MODERN
======================================== */
body.single-stm-courses .masterstudy-single-course-modern__topbar:before{
  background: linear-gradient(
    135deg,
    #1a0f3d 0%,
    #3c0d75 50%,
    #e0b84c 100%
  ) !important;
}


/* ========================================
   3) MASTERSTUDY · BREADCRUMBS / HEADER SPACING
======================================== */

/* Ocultar breadcrumbs / pagetitle */
body.single-stm-courses #breadcrumb-section,
body.single-stm-courses .breadcrumb-area,
body.single-stm-courses .dt__pagetitle{
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  overflow: hidden !important;

  height: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;

  background: transparent !important;
  box-shadow: none !important;
}

/* Quitar contenido interno */
body.single-stm-courses #breadcrumb-section *,
body.single-stm-courses .breadcrumb-area *,
body.single-stm-courses .dt__pagetitle *{
  display: none !important;
}

/* Evita que el contenido quede debajo del header */
body.single-stm-courses .site-content,
body.single-stm-courses .stm-lms-wrapper{
  padding-top:150px !important;
}

/* Evita dobles espacios */
body.single-stm-courses .masterstudy-single-course,
body.single-stm-courses .masterstudy-single-course__main,
body.single-stm-courses .masterstudy-single-course-whole,
body.single-stm-courses .masterstudy-single-course-wrapper,
body.single-stm-courses main.site-main,
body.single-stm-courses .site-main{
  margin-top:0 !important;
}

@media (max-width:1024px){
  body.single-stm-courses .site-content,
  body.single-stm-courses .stm-lms-wrapper{
    padding-top:60px !important;
  }
}


/* ========================================
   4) EMBEDS GENERALES · MASTERSTUDY
======================================== */

/* Evitar scroll / recorte dentro del reproductor */
.masterstudy-course-player,
.masterstudy-course-player iframe,
.masterstudy-course-player .course-content,
.masterstudy-course-player .course-content__inner{
  overflow: visible !important;
  max-height: none !important;
  height: auto !important;
}


/* ========================================
   5) GOOGLE FORMS
======================================== */
iframe[src*="docs.google.com/forms"]{
  width:100% !important;
  max-width:100% !important;
  min-height:4000px !important;
  border:0 !important;
  display:block !important;
}

/* ========================================
   LOOKER STUDIO · PÁGINAS NORMALES
======================================== */
iframe[src*="lookerstudio.google.com"]{
  width:100% !important;
  max-width:100% !important;
  min-height:700px !important;
  height:700px !important;
  border:0 !important;
  display:block !important;
}

/* ========================================
   LOOKER STUDIO · MASTERSTUDY
======================================== */
.masterstudy-course-player iframe[src*="lookerstudio.google.com"],
body.single-stm-courses iframe[src*="lookerstudio.google.com"]{
  width:100% !important;
  max-width:100% !important;
  min-height:3000px !important;
  height:3000px !important;
  border:0 !important;
  display:block !important;
}

/* ========================================
   7) GOOGLE SHEETS
======================================== */
iframe[src*="docs.google.com/spreadsheets"]{
  width: 100% !important;
  max-width: 100% !important;
  min-height: 1200px !important;
  height: 1200px !important;
  border: 0 !important;
  display: block !important;
}

.masterstudy-course-player iframe[src*="docs.google.com/spreadsheets"],
.masterstudy-course-player iframe[src*="/spreadsheets/"]{
  width: 100% !important;
  min-height: 1200px !important;
  height: 1200px !important;
  max-height: none !important;
  display: block !important;
}


/* ========================================
   8) YOUTUBE EMBEDS · PÁGINAS NORMALES
======================================== */
iframe[src*="youtube.com"],
iframe[src*="youtu.be"]{
  width: 100% !important;
  height: auto !important;
  min-height: unset !important;
  max-height: none !important;
  aspect-ratio: 16 / 9 !important;
  display: block !important;
}

.wp-block-embed__wrapper,
.wp-block-embed-youtube,
.wp-video,
.video-wrapper,
.responsive-video,
.fluid-width-video-wrapper{
  height: auto !important;
  min-height: unset !important;
  max-height: none !important;
  overflow: visible !important;
}

.wp-block-embed__wrapper iframe,
.wp-block-embed-youtube iframe,
.video-wrapper iframe,
.responsive-video iframe,
.fluid-width-video-wrapper iframe{
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 16 / 9 !important;
  display: block !important;
}


/* ========================================
   9) COMPRA · TEXTOS DEL DROPDOWN
======================================== */

/* Ocultar texto original */
.masterstudy-buy-button-dropdown__head-title{
  font-size: 0 !important;
  line-height: 0 !important;
}

/* Primer item */
.masterstudy-buy-button-dropdown > div:first-child .masterstudy-buy-button-dropdown__head-title::after{
  content: "Compra individual";
  display: inline-block;
  font-size: 16px;
  line-height: 1.3;
  font-weight: 500;
  color: #0f172a;
}

/* Último item */
.masterstudy-buy-button-dropdown > div:last-child .masterstudy-buy-button-dropdown__head-title::after{
  content: "Compra grupal";
  display: inline-block;
  font-size: 16px;
  line-height: 1.3;
  font-weight: 500;
  color: #0f172a;
}


/* ========================================
   10) TOP HEADER BLANCO · SOLO DESKTOP
======================================== */
@media (min-width:1025px){
  .header-widget .av-column-6,
  .top-header .av-column-6,
  .header-top .av-column-6,
  .above-header .av-column-6{
    background:#ffffff !important;
  }

  .header-widget .nav-link,
  .header-widget .contact-info,
  .header-widget .contact-info .title,
  .header-widget .nav-link i,
  .header-widget .contact-icon i{
    color:#111827 !important;
  }
}


/* ========================================
   11) RATINGS
======================================== */

/* Ocultar rating cuando no hay estrellas llenas */
.masterstudy-single-course-rating:not(:has(.masterstudy-single-course-rating__star_filled)){
  display:none;
}

/* Ocultar texto "X valoraciones" */
.masterstudy-single-course-rating__quantity{
  display:none !important;
}


/* ========================================
   12) TOPBAR TIMELESS · TEXTO Y FONDO
======================================== */

/* Texto blanco + sombra */
body.single-stm-courses .masterstudy-single-course-timeless__topbar h1,
body.single-stm-courses .masterstudy-single-course-timeless__topbar h2,
body.single-stm-courses .masterstudy-single-course-timeless__topbar span,
body.single-stm-courses .masterstudy-single-course-timeless__topbar div,
body.single-stm-courses .masterstudy-single-course-timeless__topbar p,
body.single-stm-courses .masterstudy-single-course-timeless__topbar a{
  color: #ffffff !important;
  text-shadow: 0px 2px 5px rgba(0, 0, 0, 0.7) !important;
}

/* Hover dorado */
body.single-stm-courses .masterstudy-single-course-timeless__topbar a:hover{
  color: #D4AF37 !important;
}

/* Fondo elegante */
body.single-stm-courses .masterstudy-single-course-timeless__topbar:before{
  background:
    linear-gradient(105deg, transparent 25%, rgba(212, 175, 55, 0.4) 30%, rgba(255, 215, 0, 0.9) 35%, rgba(212, 175, 55, 0.4) 40%, transparent 45%),
    radial-gradient(circle at 90% 10%, rgba(255, 204, 0, 0.3) 0%, transparent 40%),
    linear-gradient(135deg, #002B5C 0%, #000B1A 100%) !important;
}

/* =========================================
   MEGA MENÚ - TEMA AZUL OSCURO PREMIUM 
   (100% ESCRITORIO + FIX ANTI-SALTOS MODERNO)
========================================= */

/* =========================================
   1. VARIABLES GLOBALES
========================================= */
:root {
  --mega-bg: #0b0f24; 
  --mega-card-bg: #12183b; 
  --mega-border: rgba(255, 255, 255, 0.08); 
  --mega-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
  --mega-card-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  --mega-text-main: #ffffff; 
  --mega-text-sec: #b0b8d1; 
  --mega-text-muted: #7d87a8; 
  --mega-hover-bg: #007bff; 
  --mega-hover-text: #ffffff; 
  --mega-hover-main: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  --mega-hover-soft: rgba(37, 99, 235, 0.16);
  --mega-hover-soft-2: rgba(255, 255, 255, 0.08);
  --mega-hover-border: rgba(96, 165, 250, 0.45);
  --mega-glow: 0 10px 24px rgba(37, 99, 235, 0.28);
}

/* =========================================
   2. REGLAS SOLO PARA ESCRITORIO (MÁS DE 992PX)
========================================= */
@media (min-width: 992px) {

  /* Reset básico */
  #menu-cta-menu .dropdown-menu,
  #menu-cta-menu .dropdown-menu li {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  #menu-cta-menu > li.menu-item-has-children {
    position: relative;
  }

  /* --- PANEL PRINCIPAL DEL DROPDOWN (ANIMADO Y CON RETRASO) --- */
  #menu-cta-menu > li.menu-item-has-children > .dropdown-menu {
    position: absolute !important;
    top: 100% !important; 
    margin-top: 5px !important; /* Separación natural del menú */
    display: grid !important;
    grid-template-columns: repeat(4, minmax(180px, 1fr));
    gap: 16px;
    width: 980px;
    max-width: calc(100vw - 40px);
    padding: 22px;
    background: var(--mega-bg) !important; 
    border-radius: 20px;
    border: 1px solid var(--mega-border) !important;
    box-shadow: var(--mega-shadow) !important;
    left: 50% !important;
    z-index: 99999 !important;
    
    /* FIX ANTI-SALTOS: Animación y Periodo de gracia */
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important; /* Evita clics accidentales cuando está oculto */
    transform: translateX(-50%) translateY(15px) !important; /* Animación desde abajo */
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease !important;
    transition-delay: 0.15s !important; /* El menú espera 150ms antes de desaparecer */
  }

  /* Estado Activo: Aparece inmediatamente */
  #menu-cta-menu > li.menu-item-has-children:hover > .dropdown-menu {
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: translateX(-50%) translateY(0) !important;
    transition-delay: 0s !important; 
    z-index: 999999 !important;
  }

  /* --- NIVEL 1: TARJETAS PRINCIPALES --- */
  #menu-cta-menu > li > .dropdown-menu > li {
    background: var(--mega-card-bg) !important; 
    border: 1px solid var(--mega-border) !important;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--mega-card-shadow) !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    backdrop-filter: blur(6px);
  }

  #menu-cta-menu > li > .dropdown-menu > li:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6) !important;
  }

  #menu-cta-menu > li.menu-item-has-children > .dropdown-menu > li > a.dropdown-item,
  #menu-cta-menu > li.menu-item-has-children > .dropdown-menu > li > a.dropdown-item:hover,
  #menu-cta-menu > li.menu-item-has-children > .dropdown-menu > li > a.dropdown-item:focus,
  #menu-cta-menu > li.menu-item-has-children > .dropdown-menu > li:hover > a.dropdown-item,
  #menu-cta-menu > li.menu-item-has-children > .dropdown-menu > li:focus-within > a.dropdown-item {
    display: block;
    padding: 16px 16px 12px 16px;
    font-weight: 700 !important;
    font-size: 16px !important;
    line-height: 1.3 !important;
    color: var(--mega-text-main) !important; 
    -webkit-text-fill-color: #ffffff !important;
    text-decoration: none;
    background: transparent !important;
    border-bottom: 1px solid var(--mega-border) !important;
    white-space: normal;
    transition: background-color 0.2s ease, color 0.2s ease;
    opacity: 1 !important;
    text-shadow: none !important;
    position: relative;
    overflow: hidden;
  }

  #menu-cta-menu > li.menu-item-has-children > .dropdown-menu > li > a.dropdown-item:hover,
  #menu-cta-menu > li.menu-item-has-children > .dropdown-menu > li:hover > a.dropdown-item {
    background: var(--mega-hover-main) !important;
    border-radius: 12px 12px 0 0 !important; 
    box-shadow: var(--mega-glow) !important;
  }

  #menu-cta-menu > li.menu-item-has-children > .dropdown-menu > li > a.dropdown-item *,
  #menu-cta-menu > li.menu-item-has-children > .dropdown-menu > li > a.dropdown-item:hover *,
  #menu-cta-menu > li.menu-item-has-children > .dropdown-menu > li:hover > a.dropdown-item * {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    opacity: 1 !important;
  }

  #menu-cta-menu > li > .dropdown-menu > li > a.dropdown-item::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(255,255,255,0.12), transparent 40%, transparent 60%, rgba(255,255,255,0.08));
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
  }

  #menu-cta-menu > li > .dropdown-menu > li > a.dropdown-item:hover::after,
  #menu-cta-menu > li > .dropdown-menu > li > a.dropdown-item:focus::after {
    opacity: 1;
  }

  /* --- NIVEL 2: OPCIONES DENTRO DE LA TARJETA --- */
  #menu-cta-menu > li > .dropdown-menu > li > .dropdown-menu {
    position: static !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100%;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    border-radius: 0;
    padding: 10px 10px 12px 10px;
    transform: none !important;
  }

  #menu-cta-menu > li > .dropdown-menu > li > .dropdown-menu > li {
    margin-bottom: 6px;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    transform: none !important;
  }

  #menu-cta-menu > li > .dropdown-menu > li > .dropdown-menu > li > a.dropdown-item {
    display: block;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.35;
    color: var(--mega-text-sec) !important; 
    text-decoration: none;
    white-space: normal;
    transition: background-color 0.2s ease, color 0.2s ease;
    border: 1px solid transparent;
    background-clip: padding-box !important;
  }

  #menu-cta-menu > li > .dropdown-menu > li > .dropdown-menu > li > a.dropdown-item:hover,
  #menu-cta-menu > li > .dropdown-menu > li > .dropdown-menu > li > a.dropdown-item:focus {
    background: var(--mega-hover-soft) !important;
    color: #ffffff !important;
    border: 1px solid var(--mega-hover-border) !important;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
  }

  /* --- NIVEL 3: SUB-OPCIONES FINALES --- */
  #menu-cta-menu > li > .dropdown-menu .dropdown-menu .dropdown-menu {
    position: static !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 4px 0 0 10px;
    transform: none !important;
  }

  #menu-cta-menu > li > .dropdown-menu .dropdown-menu .dropdown-menu a.dropdown-item {
    display: block;
    padding: 7px 12px;
    font-size: 13px;
    color: var(--mega-text-muted) !important; 
    border-left: 2px solid rgba(255, 255, 255, 0.15) !important;
    margin-left: 6px;
    border-radius: 0;
    transition: color 0.2s ease, border-color 0.2s ease;
  }

  #menu-cta-menu > li > .dropdown-menu .dropdown-menu .dropdown-menu a.dropdown-item:hover,
  #menu-cta-menu > li > .dropdown-menu .dropdown-menu .dropdown-menu a.dropdown-item:focus {
    background: var(--mega-hover-soft-2) !important;
    color: #ffffff !important;
    border-left-color: #60a5fa !important;
  }

  /* --- FIX DE VISIBILIDAD DE TEXTOS Y SPANS --- */
  #menu-cta-menu .dropdown-menu .dropdown-menu a.dropdown-item,
  #menu-cta-menu .dropdown-menu .dropdown-menu a.dropdown-item:hover,
  #menu-cta-menu .dropdown-menu .dropdown-menu a.dropdown-item:focus,
  #menu-cta-menu .dropdown-menu .dropdown-menu li:hover > a.dropdown-item,
  #menu-cta-menu .dropdown-menu .dropdown-menu li:focus-within > a.dropdown-item {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    opacity: 1 !important;
    text-indent: 0 !important;
    text-shadow: none !important;
  }

  #menu-cta-menu .dropdown-menu .dropdown-menu a.dropdown-item *,
  #menu-cta-menu .dropdown-menu .dropdown-menu a.dropdown-item:hover *,
  #menu-cta-menu .dropdown-menu .dropdown-menu li:hover > a.dropdown-item * {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    opacity: 1 !important;
  }
}

/* =========================================
   3. AJUSTES ESCRITORIO PEQUEÑO (Laptops)
========================================= */
@media (max-width: 1200px) and (min-width: 992px) {
  #menu-cta-menu > li.menu-item-has-children > .dropdown-menu {
    width: 860px;
    grid-template-columns: repeat(3, minmax(180px, 1fr)) !important;
  }
}

/* ========================================
   POWER BI · PÁGINAS NORMALES
======================================== */
iframe[src*="app.powerbi.com"],
iframe[src*="powerbi.com/reportEmbed"],
iframe[src*="powerbi.com/view"]{
  width: 100% !important;
  max-width: 100% !important;
  min-height: 700px !important;
  height: 700px !important;
  border: 0 !important;
  display: block !important;
}

/* ========================================
   POWER BI · MASTERSTUDY
======================================== */
.masterstudy-course-player iframe[src*="app.powerbi.com"],
.masterstudy-course-player iframe[src*="powerbi.com/reportEmbed"],
.masterstudy-course-player iframe[src*="powerbi.com/view"],
body.single-stm-courses iframe[src*="app.powerbi.com"],
body.single-stm-courses iframe[src*="powerbi.com/reportEmbed"],
body.single-stm-courses iframe[src*="powerbi.com/view"]{
  width: 100% !important;
  max-width: 100% !important;
  min-height: 900px !important;
  height: 900px !important;
  max-height: none !important;
  border: 0 !important;
  display: block !important;
}