
/* =========================================================
   MCG Responsive Layer v1
   Capa de comportamiento: no sustituye el diseño de escritorio
   ========================================================= */

:root{
  --mcg-mobile-nav-h:62px;
}

/* ---------- Stability / performance ---------- */
img{
  max-width:100%;
}
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{
    scroll-behavior:auto!important;
    animation-duration:.01ms!important;
    animation-iteration-count:1!important;
    transition-duration:.01ms!important;
  }
}

/* Avoid horizontal overflow from long strings, tables and flex children */
body{overflow-x:hidden}
.container,.wrap,.nav,.hero-inner,.article-wrap,.next-inner,.insights-list,
.public-grid,.grid,.map-layout,.footer-main,.footer-links{min-width:0}
p,h1,h2,h3,h4,a,span,strong,small{overflow-wrap:break-word}
button,a,input,select,textarea{touch-action:manipulation}

/* ---------- HOME: mobile navigation ---------- */
.mcg-mobile-nav{
  display:none;
}
@media(max-width:900px){
  .mcg-mobile-nav{
    display:block;
    position:sticky;
    top:0;
    z-index:1400;
    color:#fff;
    background:rgba(4,21,40,.985);
    border-bottom:1px solid rgba(255,255,255,.08);
    backdrop-filter:blur(12px);
  }
  .mcg-mobile-nav-row{
    min-height:var(--mcg-mobile-nav-h);
    width:min(100% - 24px,1200px);
    margin:auto;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:14px;
  }
  .mcg-mobile-brand{
    color:#fff!important;
    text-decoration:none;
    display:block;
    min-width:0;
    font-size:1.34rem;
    line-height:1;
    font-weight:900;
    letter-spacing:-.055em;
  }
  .mcg-mobile-brand small{
    display:block;
    max-width:230px;
    margin-top:4px;
    color:#9fb9d0;
    font-size:.52rem;
    font-weight:600;
    letter-spacing:.05em;
    line-height:1.15;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }
  .mcg-menu-toggle{
    flex:0 0 44px;
    width:44px;
    height:44px;
    display:grid;
    place-items:center;
    padding:0;
    border:1px solid rgba(255,255,255,.15);
    border-radius:10px;
    background:rgba(255,255,255,.055);
    color:#fff;
    font-size:1.2rem;
    line-height:1;
  }
  .mcg-mobile-menu{
    display:none;
    position:absolute;
    top:calc(100% + 8px);
    left:12px;
    right:12px;
    padding:8px;
    border:1px solid rgba(255,255,255,.11);
    border-radius:14px;
    background:#071b30;
    box-shadow:0 20px 55px rgba(0,0,0,.32);
  }
  .mcg-mobile-menu.is-open{
    display:grid;
  }
  .mcg-mobile-menu a{
    min-height:44px;
    display:flex;
    align-items:center;
    padding:0 12px;
    color:#dce8f3!important;
    border-radius:9px;
    text-decoration:none;
    font-size:.82rem;
    font-weight:700;
  }
  .mcg-mobile-menu a:hover,
  .mcg-mobile-menu a:focus-visible{
    color:#fff!important;
    background:rgba(255,255,255,.07);
  }
  .mcg-mobile-menu .mobile-cta{
    margin-top:5px;
    justify-content:center;
    color:#fff!important;
    background:#1676f5;
  }
}

/* ---------- HOME ---------- */
.hero-exact img{
  aspect-ratio:1041 / 468;
}
@media(max-width:900px){
  .section{padding:48px 0}
  .intro{padding:32px 0 24px}
  .intro-grid{gap:22px}
  .intro h2,.section-title h2,.insights-copy h2{font-size:clamp(1.62rem,5vw,2rem)}
  .service-grid{gap:14px}
  .service-body p{min-height:0}
  .method{padding:36px 0 44px}
  .method-grid{gap:25px}
  .steps{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:25px 18px;
  }
  .step{padding-right:0}
  .step::after{display:none!important}
  .step p{max-width:none}
  .simulator-intro{gap:12px}
  .featured-insight{
    min-height:0;
  }
  .featured-insight-img{
    min-height:0!important;
    aspect-ratio:16/9;
  }
  .featured-insight-copy h3{font-size:1.35rem}
  .article-img{aspect-ratio:16/8!important}
  .cta-grid{gap:20px}
  .chat-float{
    right:12px;
    bottom:12px;
    width:50px;
    height:50px;
  }
  .chat{
    left:10px;
    right:10px;
    bottom:72px;
    width:auto;
    max-width:none;
    height:min(520px,calc(100svh - 105px));
    border-radius:16px;
  }
}
@media(max-width:680px){
  .container{width:min(var(--max),calc(100% - 28px))}
  .hero-exact img{
    width:185%!important;
    max-width:none!important;
    transform:translateX(-1%)!important;
  }
  .service-grid{grid-template-columns:1fr!important}
  .service-img{height:155px}
  .steps{grid-template-columns:1fr!important}
  .kpis{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .kpi{padding:16px 8px}
  .kpi strong{font-size:1.85rem}
  .sim-actions{display:grid;grid-template-columns:1fr}
  .sim-actions button{min-height:44px;width:100%}
  .insights{padding:48px 0}
  .featured-insight-copy{padding:20px!important}
  .featured-insight-copy h3{font-size:1.22rem}
  .article-body{padding:16px}
  .cta{padding:32px 0!important}
  .cta-actions{display:grid!important;grid-template-columns:1fr;width:100%}
  .cta-actions .btn{width:100%!important;white-space:normal;text-align:center}
  .footer-main{gap:25px!important}
  .footer-links{grid-template-columns:1fr!important;gap:20px!important}
  .brand{align-items:flex-start}
  .brand-copy strong{font-size:.62rem}
  .footer-bottom{gap:7px!important}
}
@media(max-width:480px){
  .hero-exact img{
    width:205%!important;
    transform:translateX(-1%)!important;
  }
  .intro h2{font-size:1.55rem}
  .kpi strong{font-size:1.68rem}
  .kpi small{font-size:.68rem}
  .context-card{min-height:155px}
  .context-card strong{font-size:1.2rem}
}

/* ---------- Standard header used by Insights / Articles ---------- */
.mobile-nav-toggle{
  display:none;
}
@media(max-width:900px){
  .site-header .nav{
    position:relative;
    min-height:62px;
    width:min(100% - 24px,1180px);
  }
  .site-header .brand{
    min-width:0;
    font-size:1.25rem;
  }
  .site-header .brand small{
    max-width:235px;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }
  .mobile-nav-toggle{
    display:grid;
    place-items:center;
    flex:0 0 44px;
    width:44px;
    height:44px;
    border:1px solid rgba(255,255,255,.15);
    border-radius:10px;
    background:rgba(255,255,255,.055);
    color:#fff;
    font-size:1.18rem;
  }
  .site-header .nav-links{
    display:none!important;
    position:absolute;
    left:0;
    right:0;
    top:calc(100% + 8px);
    padding:8px;
    flex-direction:column;
    align-items:stretch;
    gap:2px!important;
    background:#071b30;
    border:1px solid rgba(255,255,255,.11);
    border-radius:14px;
    box-shadow:0 20px 55px rgba(0,0,0,.3);
  }
  .site-header .nav-links.is-open{
    display:flex!important;
  }
  .site-header .nav-links a{
    min-height:44px;
    display:flex;
    align-items:center;
    padding:0 12px!important;
    border:0!important;
    border-radius:9px!important;
    color:#dce8f3!important;
    font-size:.8rem;
  }
  .site-header .nav-links .cta{
    justify-content:center;
    margin-top:5px;
    background:#1676f5;
    color:#fff!important;
  }
}

/* ---------- Insights index + Articles ---------- */
@media(max-width:900px){
  .hero-inner{
    padding:42px 0 38px!important;
    gap:24px!important;
  }
  .hero h1{
    font-size:clamp(2rem,8vw,3.2rem)!important;
  }
  .hero-image{
    height:auto!important;
    min-height:0!important;
    aspect-ratio:16/9;
  }
  .article-wrap{
    width:min(100% - 28px,1040px)!important;
    padding:34px 0 55px!important;
    gap:28px!important;
  }
  .article p,.lead{
    font-size:1rem!important;
  }
  .article h2{font-size:1.45rem}
  .quote{padding:18px;font-size:.98rem}
  .keybox{padding:18px}
  .sidebar{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
  .side-card{margin:0}
  .references a{word-break:break-word}
  .insights-page{padding:38px 0 55px!important}
  .insights-list{width:min(100% - 28px,1120px)!important}
  .insights-list h1{font-size:2rem!important}
  .cards{gap:12px!important}
  .card-img{height:auto!important;aspect-ratio:16/9}
}
@media(max-width:620px){
  .hero-inner{width:min(100% - 28px,1120px)!important;padding:34px 0!important}
  .hero h1{font-size:2rem!important}
  .deck{font-size:.94rem!important}
  .meta{gap:7px!important}
  .article-wrap{width:min(100% - 24px,1040px)!important}
  .article h2{font-size:1.32rem}
  .article h3{font-size:1.02rem}
  .sidebar{grid-template-columns:1fr}
  .next-inner{width:min(100% - 24px,1040px)!important}
  .article-footer .inner{width:min(100% - 24px,1120px)!important}
  .references ol{padding-left:18px}
}

/* ---------- Public simulator ---------- */
@media(max-width:900px){
  .topnav{
    position:sticky;
    top:0;
    z-index:1300;
  }
  .topnav .navrow{
    position:relative;
    min-height:62px;
    padding:9px 0!important;
    display:flex!important;
    grid-template-columns:none!important;
  }
  .topnav .logo{
    min-width:0;
    font-size:1.35rem;
  }
  .topnav .logo small{
    max-width:235px;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }
  .topnav .menu{
    display:none!important;
    position:absolute;
    top:calc(100% + 8px);
    left:0;
    right:0;
    padding:8px;
    flex-direction:column;
    align-items:stretch;
    gap:2px!important;
    background:#071b30;
    border:1px solid rgba(255,255,255,.11);
    border-radius:14px;
    box-shadow:0 20px 55px rgba(0,0,0,.32);
  }
  .topnav .menu.is-open{
    display:flex!important;
  }
  .topnav .menu a{
    display:flex;
    align-items:center;
    min-height:44px;
    padding:0 12px!important;
    border:0!important;
    border-radius:9px!important;
  }
  .topnav .menu a.active{background:rgba(22,118,245,.18)}
  .hero{padding:48px 0!important}
  .hero-grid{gap:24px!important}
  .hero h1{
    margin:12px 0 16px!important;
    font-size:clamp(2.4rem,9vw,4rem)!important;
  }
  .hero-card{padding:20px}
  .section{padding:50px 0}
  .public-grid{gap:14px}
  #ejercicio-live .controls,#ejercicio-live .results{padding:20px!important}
  .live-strip{margin-bottom:14px}
  .canvas-box,
  #ejercicio-live .canvas-box{
    height:270px!important;
    min-height:270px!important;
  }
  .lock-info,.login{padding:24px!important}
}
@media(max-width:700px){
  .topnav .container,.section .container,footer .container{
    width:min(var(--max),calc(100% - 24px))!important;
  }
  .live-strip{
    align-items:flex-start!important;
    flex-direction:column;
    gap:7px!important;
  }
  .live-summary{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
  }
  .live-kpi{
    min-height:92px!important;
    padding:14px!important;
  }
  .live-kpi strong{font-size:1.4rem!important}
  .range-pair{grid-template-columns:1fr!important}
  .field-top{gap:8px;align-items:flex-start}
  .field-top label{line-height:1.3}
  input[type="range"]{
    min-height:30px;
    touch-action:pan-y;
  }
  select,input[type="text"],input[type="password"],input[type="number"]{
    font-size:16px!important; /* Prevent iOS input zoom */
  }
  .scenario-run-panel{padding:15px!important}
  .scenario-run-head{gap:10px!important}
  .scenario-options{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .scenario-option{min-height:44px!important}
  .live-run-btn{min-height:56px!important}
  #ejercicio-live .canvas-box{
    height:250px!important;
    min-height:250px!important;
  }
  #acceso-privado .lock-info,
  #acceso-privado .login{padding:22px!important}
  footer .container{align-items:flex-start}
}
@media(max-width:430px){
  .topnav .logo small{max-width:190px}
  .hero h1{font-size:2.25rem!important}
  .hero-card{padding:17px}
  .live-summary{grid-template-columns:1fr!important}
  .scenario-run-head{
    flex-direction:column;
    align-items:flex-start!important;
  }
  .scenario-current{text-align:left!important}
  #ejercicio-live .controls,#ejercicio-live .results{padding:16px!important}
  #ejercicio-live .canvas-box{
    height:235px!important;
    min-height:235px!important;
  }
}

/* ---------- Maracaibo local page + interactive map ---------- */
@media(max-width:900px){
  .wrap{width:min(100% - 28px,1120px)!important}
  header .nav{min-height:62px}
  .hero{padding:48px 0!important}
  .hero h1,h1{
    font-size:clamp(2rem,8vw,3rem)!important;
  }
  main{padding:38px 0 55px!important}
  .local{padding:20px!important}
  .map-section{padding:22px!important;border-radius:20px!important}
  .map-head{
    grid-template-columns:1fr!important;
    align-items:start!important;
  }
  .map-controls{
    justify-content:flex-start!important;
    width:100%;
  }
  .map-layout{grid-template-columns:1fr!important}
  .map-stage{
    min-height:470px!important;
    touch-action:pan-y; /* Preserve page scroll on touch devices */
  }
  .map-canvas{width:min(82%,420px)!important}
  .city-card{
    margin:16px 0 0!important;
    transform:none!important;
  }
  .city-card.active{transform:translateY(-4px)!important}
  .map-connector{display:none!important}
}
@media(max-width:620px){
  header .nav{
    align-items:flex-start;
    padding:12px 0;
  }
  header .brand{font-size:1.2rem!important}
  header .brand small{
    max-width:215px;
    line-height:1.2;
  }
  header .nav>a:last-child{
    min-height:40px;
    display:flex;
    align-items:center;
    text-align:right;
  }
  .hero{padding:40px 0!important}
  .hero p{font-size:.94rem!important}
  .grid{grid-template-columns:1fr!important}
  .card{padding:18px!important}
  .btn{width:100%;justify-content:center;min-height:46px}
  .map-section{padding:16px!important;margin:28px 0 0!important}
  .map-head h2{font-size:1.42rem!important}
  .map-controls{
    display:grid!important;
    grid-template-columns:44px 44px minmax(0,1fr);
    gap:7px!important;
  }
  .map-controls .map-btn.primary{
    grid-column:1/-1;
  }
  .map-stage{
    min-height:410px!important;
    border-radius:15px!important;
  }
  .map-canvas{width:min(96%,360px)!important}
  .map-hud{left:10px!important;right:10px!important}
  .hud-chip{font-size:.53rem!important}
  .map-hint{display:none!important}
  .city-card{padding:20px!important}
  .city-stat{grid-template-columns:1fr 1fr!important}
  .city-meta div{align-items:flex-start}
  .city-meta strong{max-width:58%}
}
@media(max-width:400px){
  header .brand small{display:none!important}
  .map-stage{min-height:370px!important}
  .map-canvas{width:min(100%,330px)!important}
  .city-stat{grid-template-columns:1fr!important}
}

/* Desktop hover effects only where hover exists */
@media(hover:none){
  .service-card:hover,.article-card:hover,.map-btn:hover,.city-link:hover{
    transform:none!important;
  }
}
