/* =================== HOME (Base & HERO) =================== */
/* Toma tokens de layout si existen */
:root{
  --brand-600: var(--brand-600, #2f409a);
  --brand-700: var(--brand-700, #28378a);
  --ink-900:   var(--ink-900, #2f409a);
  --ink-700:   var(--ink-700, #374151);
  --bg-soft:   var(--bg-soft, #f6f7fb);
  --card-radius: var(--card-radius, 18px);
  --shadow-1: 0 6px 18px rgba(16,24,40,.10), 0 2px 6px rgba(16,24,40,.06);
  --shadow-2: 0 14px 30px rgba(16,24,40,.18), 0 6px 16px rgba(16,24,40,.10);
}

/* Botones primarios/secundarios coherentes con el layout */
.btn{ display:inline-flex; align-items:center; justify-content:center; gap:8px; text-decoration:none; }
.btn-primary{
  background:#c21922; color:#fff; padding:12px 18px; border-radius:12px;
  border:0px solid #0f172a; font-weight:800; line-height:1; transition:.2s ease;
}
.btn-primary:hover{ opacity:.92; }
.btn-secondary{
  background:#fff; color:#0f172a; padding:12px 18px; border-radius:12px;
  border:1px solid #cbd5e1; font-weight:800; line-height:1; transition:.2s ease;
}
.btn-secondary:hover{ border-color:#94a3b8; }

/* =============== HERO =============== */
.hero-section{
  max-width:1200px; margin: 0 auto; padding: 34px 24px 18px 24px;
  display:grid; grid-template-columns: 1.1fr .9fr; gap:28px; align-items:center;
  position:relative;
}
.hero-section::before{
  /* blob sutil al fondo */
  content:""; position:absolute; left:-220px; top: 58%;
  width:560px; height:460px; transform: translateY(-50%);
  /*background: radial-gradient(60% 60% at 50% 50%, #6d7dff 0%, #495ee6 55%, transparent 72%);*/
  opacity:.12; filter: blur(14px); border-radius:50%;
  z-index:-1; pointer-events:none;
}
/* ====== GALLO como fondo a la izquierda del hero ====== */
/*CODIGO NUEVO INCIO*/
html, body { overflow-x: clip; }              /* soportado moderno */
@supports not (overflow: clip) {
  html, body { overflow-x: hidden; }          /* fallback */
}

/* ====== GALLO decorativo sin romper el layout ====== */
:root { --overscan: 350px; }                  /* cuánto puede “salirse” a la derecha */

.hero-section{
  position: relative;                         /* ya lo tienes, lo reafirmo */
}

/* Reemplazo del ::after anterior */
.hero-section::after{
  content:"";
  position: absolute;

  /* lo pegamos al borde derecho y lo “sacamos” un poco */
  inset-block-start: 60%;                     /* equivalente a top:60% */
  inset-inline-end: calc(-1 * var(--overscan));  /* right: -overscan */
  transform: translateY(-38%);                /* misma altura que usabas */

  inline-size: clamp(620px, 58vw, 1000px);    /* tamaño del gallo */
  aspect-ratio: 1 / 1;                        /* mantiene proporción cuadrada */
  background: url("../img/Fondo home.svg") no-repeat center / contain;

  opacity:.95;
  pointer-events:none;
  z-index:-1;                                 /* detrás del contenido */
}

/* Responsivo: lo hacemos más chico y menos intrusivo en pantallas estrechas */
@media (max-width: 1024px){
  :root { --overscan: 160px; }
  .hero-section::after{
    inline-size: clamp(380px, 48vw, 520px);
    opacity:.18;
    transform: translateY(-32%);
  }
}
@media (max-width: 640px){
  :root { --overscan: 120px; }
  .hero-section::after{
    inline-size: 300px;
    opacity:.35;
    transform: translateY(-25%);
  }
}

/*CODIGO NUEVO FIN*/
.hero-content h1{
  font-size: clamp(28px, 4vw, 44px);
  line-height:1.12; font-weight:850; color:#2f409a; margin:0 0 10px 0;
  letter-spacing:.01em;
}
.hero-content p{
  color:var(--ink-700); font-size:1.06rem; line-height:1.65; margin:0 0 16px 0;
  max-width: 48ch;
}
.hero-buttons{ display:flex; gap:12px; margin: 6px 0 8px 0; }

.hero-highlights{
  margin:14px 0 0 0; padding:0; list-style:none; display:flex; gap:16px; flex-wrap:wrap;
}
.hero-highlights li{
  font-weight:700; font-size:.95rem; color:#0f172a;
  background:#fff; border:1px solid #e5e7eb; border-radius:999px; padding:8px 12px;
  box-shadow: 0 2px 6px rgba(16,24,40,.06);
}

/* Imagen del hero */
.hero-image{ position:relative; display:flex; align-items:center; justify-content:center; }
.hero-image img{
  width:100%; height:auto; max-width:520px; display:block; object-fit:contain;
  border-radius: 20px;
  box-shadow: var(--shadow-1);
}

/* Badges decorativos */
.hero-badge{
  position:absolute; top:8%; right:6%;
  background:#0f172a; color:#fff; font-weight:800; font-size:.85rem;
  padding:8px 12px; border-radius:12px; box-shadow: var(--shadow-2);
}
.hero-badge.alt{ top:auto; bottom:8%; right:auto; left:-8px; background:#fff; color:#0f172a; border:1px solid #e5e7eb; }

/* Separadores de sección (opcional) */
section + section{ margin-top: 8px; }

/* =============== FEATURES =============== */
.features-section{
  max-width:1200px; margin: 0 auto; padding: 22px 24px 42px 24px; position:relative;
}
.features-section h2{
  font-size: clamp(22px, 3vw, 32px);
  line-height:1.2; font-weight:850; color:var(--ink-900); margin: 8px 0 8px 0;
}
.features-lead{
  color:var(--ink-700); font-size:1.02rem; line-height:1.65; margin:0 0 18px 0;
  max-width: 70ch;
}

.features-grid{
  display:grid; grid-template-columns: repeat(2, minmax(280px, 1fr)); gap:18px;
}
.feature-item{
  display:flex; gap:14px; align-items:flex-start;
  background:#fff; border-radius:16px; padding:16px 16px;
  border:1px solid rgba(46,62,140,.10);
  box-shadow: var(--shadow-1); transition: transform .18s ease, box-shadow .18s ease;
  min-height: 116px;
}
.feature-item:hover{ transform: translateY(-4px); box-shadow: var(--shadow-2); }

.feature-item .icon{
  width:52px; height:52px; border-radius:50%; flex-shrink:0;
  background:#0b3bff; display:flex; align-items:center; justify-content:center;
  box-shadow: 0 10px 18px rgba(11,59,255,.22), 0 3px 8px rgba(11,59,255,.16);
}
.feature-item:nth-child(2) .icon{ background:#7c3aed; }
.feature-item:nth-child(3) .icon{ background:#e7b23a; }
.feature-item:nth-child(4) .icon{ background:#e11d2e; }

.feature-item .icon img{ width:28px; height:28px; object-fit:contain; display:block; filter:none; }
.feature-item .text h3{ margin:2px 0 4px 0; font-size:1.05rem; font-weight:850; color:var(--ink-900); }
.feature-item .text p{ margin:0; font-size:.97rem; color:#646a76; line-height:1.55; }

.features-cta{ margin-top: 18px; }
.features-cta .btn-primary{ padding:12px 18px; }

.home-description{
  max-width:1200px; margin: 58px auto 24px auto; padding: 0 24px;
  display:flex; grid-template-columns: 1.1fr .9fr; gap:18px; align-items:center;
}
.home-description .content h2{
  font-size: clamp(22px, 3vw, 30px);
  line-height:1.2; font-weight:850; color:#2f409a; margin: 0 0 8px 0;
}
.home-description .content p{
  color:var(--ink-700); font-size:1.02rem; line-height:1.65; margin:0;
}
.home-description .image img{
  width:100%; height:auto; max-width:520px; display:block; object-fit:contain;
  border-radius: 16px; box-shadow: var(--shadow-1);
} 

@media (max-width: 1024px){
  .hero-section{ grid-template-columns: 1fr; gap:22px; }
  .hero-content p{ max-width: 60ch; }
  .hero-image{ order: -1; }
  .features-grid{ grid-template-columns: 1fr; }
  .home-description{ grid-template-columns: 1fr; }

  /* El gallo se hace más pequeño y sube un poco */
  .hero-section::after{
    width:420px; height:420px;
    transform: translateY(-32%);
    opacity:.10;
  }
}
@media (max-width: 640px){
  .hero-section{ padding: 22px 16px 8px 16px; }
  .hero-buttons{ flex-wrap:wrap; }
  .hero-image img{ max-width: 420px; border-radius: 16px; }
  .hero-badge{ font-size:.8rem; padding:7px 10px; }
  .features-section{ padding: 8px 16px 28px 16px; }
  .feature-item{ padding:14px; gap:12px; }
  .feature-item .icon{ width:48px; height:48px; }
  .feature-item .icon img{ width:26px; height:26px; }
  .home-description{ padding: 0 16px; }

  /* En móvil el gallo aún más sutil para no estorbar */
  .hero-section::after{
    width:300px; height:300px;
    left:-20px;
    transform: translateY(-25%);
    opacity:.40;
  }
}

/* Pequeños refinamientos visuales */
.hero-section, .features-section, .home-description{
  background: transparent;
}

/* =================== SECCIONES (FUNCIONES) — grid 3 tarjetas =================== */
.sections{
  max-width: 1200px;
  margin: 8px auto 40px auto;
  padding: 0 24px;
  position: relative;
}
.sections::before{
  content:"";
  position:absolute; left:-220px; bottom:-60px; width:560px; height:420px;
  /*background: radial-gradient(60% 60% at 50% 50%, #6d7dff 0%, #495ee6 55%, transparent 72%);*/
  opacity:.08; filter: blur(16px); border-radius:50%; z-index:-1;
}

.sections-head h2{
  font-size: clamp(24px, 3.4vw, 36px);
  line-height:1.15; font-weight:850; color:#2f409a;
  margin: 0 0 6px 0;
}
.sections-head p{
  color:#374151; font-size:1.02rem; line-height:1.65; margin:0 0 18px 0;
  max-width:70ch;
}

/* ========== GRID de tarjetas (3 / 2 / 1) */
.sections-list{
  display: grid;
  grid-template-columns: repeat(3, minmax(280px, 1fr));
  gap: 18px;
  margin-top: 54px;
  align-items: stretch;
}

/* ========== Tarjeta con icono flotante por fuera (arriba-izquierda) */
.section-row{
  position: relative;
  display: block;
  background:#fff;
  border-radius: 18px;
  padding: 58px 22px 2px 42px;
  border:1px solid rgba(46,62,140,.10);
  box-shadow: 0 8px 20px rgba(16,24,40,.10), 0 2px 6px rgba(16,24,40,.06);
  transition: transform .18s ease, box-shadow .18s ease;
  min-height: 150px;
  overflow: visible;
}
.section-row:hover{
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(16,24,40,.16), 0 6px 16px rgba(16,24,40,.10);
}

/* Icono flotante */
.sr-icon{
  position: absolute;
  top: 0;
  left: 22px;
  transform: translateY(-50%);
  width: 66px; height: 66px;
  border-radius: 50%;
  display:flex; align-items:center; justify-content:center;
  z-index: 2;
  border: 6px solid #fff;
  box-shadow: 0 14px 28px rgba(0,0,0,.14), 0 6px 12px rgba(0,0,0,.10);
}
.sr-icon img{ width: 34px; height: 34px; object-fit: contain; display:block; }

.sr-icon.blue   { background:#2f409a; }
.sr-icon.purple { background:#2f409a; }
.sr-icon.gold   { background:#2f409a; }

/* Cuerpo */
.sr-body{ margin-top: 6px; }
.sr-body h3{
  margin: 0 0 8px 0;
  font-size: 1.22rem;
  font-weight: 820;
  color:#0b1020;
}
.sr-body p{
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.6;
  color:#555;
}

/* “reverse” normalizado */
.section-row.reverse{ text-align:left; }

/* CTA centrado */
.sections-cta{
  text-align: center;
  margin-top: 38px;
}
.sections-cta .btn-primary{ padding: 12px 18px; }

/* ========== Responsive */
@media (max-width: 1024px){
  .sections-list{ grid-template-columns: repeat(2, minmax(260px, 1fr)); }
}
@media (max-width: 640px){
  .sections-list{ grid-template-columns: 1fr; }
  .section-row{ min-height: 190px; }
}

.wa-float{
  position: fixed;
  right: 48px;
  bottom: 48px;
  width: clamp(56px, 7vw, 84px);
  z-index: 3000;
  animation: wa-pulse 1.4s infinite ease-in-out;
  transform-origin: center;
  cursor: pointer;
}
.wa-float:hover{ animation-play-state: paused; transform: scale(1.06); }
.wa-float img{ width: 100%; height: auto; display: block; filter: drop-shadow(0 10px 18px rgba(0,0,0,.25)); }

@keyframes wa-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.08); }
}

.central-content{
  flex:1 1 auto;
  max-width:100%;
  margin:auto;
  padding:48px 0 130px 0;
  /*background:#fff; /*var(--bg-soft)*/
  background-image: url('/static/img/Fondo pestañas - 2.svg') !important;
  background-position: top left !important;
  position:relative;
  min-height:65vh;
  z-index:0 !important;
  overflow:visible;
}

.main-footer{
  background: #06048e !important;
  color: #fff;
  padding: 38px 0;
  text-align: center;
  box-sizing: border-box;
}

/* HOTFIX para que Home no cambie los tokens globales */
:root{
  --brand-600:#06048e;   /* el mismo azul del header */
  --brand-700:#28378a;
  --ink-900:#111827;
  --ink-700:#374151;
}

/* WhatsApp floating button (común a todas las vistas) */
.wa-float{
  position: fixed;
  right: clamp(16px, 4vw, 48px);
  bottom: calc(clamp(16px, 4vw, 48px) + env(safe-area-inset-bottom));
  width: clamp(48px, 7vw, 84px);
  z-index: 3000;
  animation: wa-pulse 1.4s ease-in-out infinite;
  transform-origin: center;
  cursor: pointer;
}
.wa-float:hover{ animation-play-state: paused; transform: scale(1.06); }
.wa-float img{
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,.25));
}

/* Accesibilidad: respetar preferencia de movimiento reducido */
@media (prefers-reduced-motion: reduce){
  .wa-float{ animation: none; }
}

/* Breakpoints: evitar solaparse con UI móvil / toasts */
@media (max-width: 768px){
  .wa-float{
    right: clamp(12px, 4vw, 24px);
    bottom: calc(clamp(12px, 4vw, 24px) + env(safe-area-inset-bottom));
    width: clamp(44px, 12vw, 64px);
  }
}
@media (max-width: 420px){
  .wa-float{
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    width: 56px; /* tamaño cómodo para pulgar */
  }
}

@keyframes wa-pulse{
  0%,100%{ transform: scale(1) }
  50%{ transform: scale(1.08) }
}

:root{ --home-pad: clamp(16px, 3.2vw, 24px); }
.hero-section,
.features-section,
.sections,
.home-description{ padding-inline: var(--home-pad); }

/* 1) títulos con quiebre bonito */
.hero-content h1,
.sections-head h2,
.home-description .content h2{ text-wrap: balance; }

/* 2) HERO */
@media (max-width:1200px){
  .hero-section{ gap: clamp(18px, 3vw, 28px); }
}
@media (max-width:980px){
  .hero-section{ grid-template-columns:1fr; }
  .hero-content{ text-align:center; }
  .hero-content p{ margin-inline:auto; }
  .hero-buttons{ justify-content:center; flex-wrap:wrap; }
  .hero-highlights{ justify-content:center; }

  /* gallo decorativo más discreto y sin overflow */
  .hero-section::after{
    inline-size: clamp(320px, 52vw, 420px);
    inset-inline-end: -80px;
    opacity:.16;
    transform: translateY(-28%);
  }
}
@media (max-width:640px){
  .hero-image img{ max-width:420px; border-radius:16px; }
  .hero-badge{ font-size:.8rem; padding:7px 10px; }
}
@media (max-width:380px){
  .hero-buttons a{ padding:10px 14px; border-radius:10px; }
  .hero-highlights li{ padding:6px 10px; font-size:.88rem; }
}

/* 3) “Funciones” (tarjetas) — 3 → 2 → 1 */
@media (max-width:1100px){
  .sections-list{ grid-template-columns: repeat(2, minmax(260px,1fr)); }
}
@media (max-width:700px){
  .sections-list{ grid-template-columns:1fr; }
  .section-row{ padding:52px 18px 12px; min-height:auto; }
  .sr-icon{ left:18px; width:56px; height:56px; border-width:5px; }
  .sr-icon img{ width:28px; height:28px; }
  .sr-body h3{ font-size:clamp(1.02rem,3.6vw,1.14rem); }
  .sr-body p{ font-size:clamp(.94rem,3.4vw,1rem); }
}

/* 4) “Features” (lista de beneficios) */
@media (max-width:900px){
  .features-grid{ grid-template-columns:1fr; }
}
@media (max-width:560px){
  .feature-item{ padding:14px; min-height:auto; }
  .feature-item .icon{ width:44px; height:44px; }
  .feature-item .icon img{ width:24px; height:24px; }
}

/* 5) Bloque descriptivo */
@media (max-width:900px){
  .home-description{
    display:grid; grid-template-columns:1fr; gap:16px; text-align:center;
  }
  .home-description .content p{ margin-inline:auto; }
}
