body { font-family: 'Poppins', sans-serif; }

/* Header fijo: barra superior + menú */
#header { position: fixed; top: 0; left: 0; width: 100%; z-index: 50; }
#topbar { transition: margin-top .3s ease; }
#header.scrolled #topbar { margin-top: -40px; }
#header.scrolled #navbar { box-shadow: 0 10px 30px -12px rgba(0, 33, 54, .25); }

@keyframes fadeInMenu {
    from { opacity: 0; margin-top: -10px; }
    to { opacity: 1; margin-top: 0; }
}

.group:hover .group-hover\:block {
    display: block;
    animation: fadeInMenu 0.2s ease-out forwards;
}

.menu-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0.75rem; border-radius: 0.75rem; transition: background-color .2s; }
.menu-item:hover { background-color: #eef5fa; }
.menu-icon { background: #e1edf5; color: #064e7c; padding: 0.5rem; border-radius: 0.6rem; display: inline-flex; transition: all .2s; }
.menu-item:hover .menu-icon { background: #db353a; color: #fff; }
.mobile-sub { display: block; padding: 0.5rem 0.75rem; font-size: 0.875rem; color: #475569; border-radius: 0 0.5rem 0.5rem 0; }
.mobile-sub:hover { background: #eef5fa; color: #064e7c; }

/* Fondo de cuadrícula técnica */
.bg-grid {
    background-image:
        linear-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .06) 1px, transparent 1px);
    background-size: 48px 48px;
    -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 80%);
    mask-image: radial-gradient(ellipse at center, #000 30%, transparent 80%);
}

/* Etiqueta sobre los títulos */
.eyebrow { display: inline-flex; align-items: center; gap: .6rem; font-size: .75rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
.eyebrow::before { content: ''; width: 28px; height: 2px; background: currentColor; border-radius: 2px; }

/* Botones */
.btn:hover { transform: translateY(-2px); }

/* Tarjetas */
.card { transition: transform .35s ease, box-shadow .35s ease, background-color .35s ease; }
.card:hover { transform: translateY(-6px); box-shadow: 0 24px 48px -20px rgba(0, 33, 54, .35); }
.feature { position: relative; overflow: hidden; }
.feature::after { content: ''; position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: #db353a; transition: width .35s ease; }
.feature:hover::after { width: 100%; }

/* Cifras del inicio */
.stat { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); border-radius: 1.25rem; padding: 1.1rem 1.25rem; backdrop-filter: blur(8px); display: flex; flex-direction: column; }
.stat-num { font-size: 2rem; font-weight: 800; color: #fff; line-height: 1; }
.stat-label { margin-top: .4rem; font-size: .8rem; color: #cbd5e1; }
@media (max-width: 640px) { .stat-num { font-size: 1.5rem; } .stat-label { font-size: .7rem; } }

/* Chips (Radexa) */
.chip { display: flex; flex-direction: column; align-items: center; gap: .6rem; padding: 1.5rem 1rem; border-radius: 1.25rem; background: #eef5fa; color: #064e7c; font-size: .85rem; font-weight: 700; transition: all .3s ease; }
.chip:hover { background: #064e7c; color: #fff; transform: translateY(-4px); }
.chip-dark { display: flex; align-items: center; gap: .75rem; padding: .85rem 1rem; border-radius: .9rem; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .1); color: #cbd5e1; font-size: .875rem; }

/* Contacto */
.contact-item { display: flex; align-items: center; gap: 1rem; padding: .85rem 1rem; border-radius: 1rem; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .04); transition: all .25s ease; }
a.contact-item:hover { transform: translateX(4px); box-shadow: 0 10px 24px -14px rgba(0, 33, 54, .35); }
.contact-icon { width: 2.75rem; height: 2.75rem; border-radius: .8rem; background: #eef5fa; color: #064e7c; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* Imagen flotante del hero */
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
.float-slow { animation: float 7s ease-in-out infinite; }

/* Aparición al hacer scroll (main.js agrega .reveal) */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s ease, transform .8s ease; }
.reveal.visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
    .float-slow, .marquee-track { animation: none; }
}

/* Carrusel de logos */
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.marquee { -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.marquee-track { display: flex; width: max-content; animation: marquee 30s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.client-logo { filter: grayscale(1); opacity: .7; transition: all .3s ease; }
.client-logo:hover { filter: none; opacity: 1; }

/* Videos (carga al hacer clic) */
.video-grid { display: grid; gap: 2rem; }
@media (min-width: 768px) { .video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.video-grid-single { max-width: 56rem; margin: 0 auto; }
@media (min-width: 768px) { .video-grid-single { grid-template-columns: 1fr; } }
.video-card { margin: 0; }
.video-card figcaption { margin-top: .9rem; font-weight: 600; color: #002136; text-align: center; }
.video-facade, .video-card iframe { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 1.5rem; overflow: hidden; background: #002136; box-shadow: 0 24px 48px -20px rgba(0, 33, 54, .35); cursor: pointer; padding: 0; }
.video-facade img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease, opacity .3s ease; }
.video-facade:hover img { transform: scale(1.05); opacity: .85; }
.video-play { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 4.5rem; height: 4.5rem; border-radius: 9999px; background: #db353a; color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 30px rgba(219, 53, 58, .45); transition: transform .3s ease; }
.video-play svg { margin-left: 4px; fill: currentColor; }
.video-facade:hover .video-play { transform: translate(-50%, -50%) scale(1.1); }

/* Comparativa MIBAT+ */
.mibat-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding-bottom: 1.1rem; border-bottom: 1px solid #e2e8f0; }
.mibat-row:last-child { border-bottom: 0; padding-bottom: 0; }
.mibat-row dt { color: #64748b; font-size: .9rem; }
.mibat-row dd { margin: 0; text-align: right; font-size: 1.35rem; font-weight: 700; color: #334155; }
.mibat-row dd span { display: block; font-size: .75rem; font-weight: 500; color: #94a3b8; }
.mibat-row-dark { border-color: rgba(255, 255, 255, .12); }
.mibat-row-dark dt { color: #cbd5e1; }
.mibat-row-dark dd { color: #fff; }
.mibat-row-dark dd span { color: #cbd5e1; }
.mibat-row dd .mibat-badge { display: inline-block; margin-top: .35rem; padding: .15rem .6rem; border-radius: 9999px; background: #db353a; color: #fff; font-weight: 700; }

/* Páginas legales */
.legal { color: #475569; line-height: 1.75; }
.legal h2 { margin: 2.5rem 0 .75rem; font-size: 1.35rem; font-weight: 700; color: #002136; }
.legal p { margin-bottom: 1rem; }
.legal ul { margin: 0 0 1rem 1.25rem; list-style: disc; }
.legal li { margin-bottom: .4rem; }
.legal a { color: #064e7c; text-decoration: underline; }
.legal a:hover { color: #db353a; }
.legal strong { color: #002136; }

/* Formulario de HubSpot */
.hbspt-form { width: 100%; }
.hbspt-form iframe { width: 100% !important; min-height: 500px; }
