/* Variables */
:root {
    --primary:#c71212;
    --primary-dark:#a50808;
    --dark: #111111;
    --dark-grey: #333333;
    --light: #F5F5F5;
    --white: #FFFFFF;
    --text-body: #555555;
    --shadow-sm: 0 10px 30px rgba(0,0,0,0.12);
    --shadow-md: 0 14px 40px rgba(0,0,0,0.18);
    --radius: 14px;
    --navbar-grad-1: rgba(17, 17, 17, 0.92);
    --navbar-grad-2: rgba(17, 17, 17, 0.72);
    --glass-border: rgba(255,255,255,0.10);
}

/* Base */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Montserrat', sans-serif;
    color: var(--text-body);
    line-height: 1.7;
    font-weight: 400;
    background: var(--dark);
    padding-top: 80px;
}
h1, h2, h3, h4, h5, h6 {
    color: var(--dark);
    font-weight: 700;
    letter-spacing: -0.5px;
}
a { text-decoration: none; transition: all 0.3s ease; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* Utilidades */
.container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }
.text-primary { color: var(--primary) !important; }
.text-white { color: var(--white) !important; }
.bg-light { background-color: var(--light); }
.bg-dark { background-color: var(--dark); }
.section-padding { padding: 100px 0; }
.text-center { text-align: center; }
.mt-4 { margin-top: 1.5rem; }
.section-title {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
}
.section-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -10px;
    width: 60px;
    height: 4px;
    background: var(--primary);
}
.text-center .section-title::after { left: 50%; transform: translateX(-50%); }

/* Botones */
.btn-primary, .btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    border: 2px solid transparent;
    gap: 10px;
}
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(211, 47, 47, 0.3);
}
.btn-secondary { background: transparent; border-color: var(--white); color: var(--white); }
.btn-secondary:hover { background: var(--white); color: var(--dark); }
.btn-block { display: flex; width: 100%; text-align: center; }

/* Navbar */
.navbar {
    background: linear-gradient(180deg, var(--navbar-grad-1) 0%, var(--navbar-grad-2) 100%);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    padding: 0.8rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}
.navbar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.20), transparent);
}
.navbar-small {
    background: linear-gradient(180deg, rgba(17,17,17,0.98) 0%, rgba(17,17,17,0.85) 100%);
    border-bottom-color: rgba(255,255,255,0.14);
    padding: 0.2rem 0 !important;
}
.navbar-small .nav-links a {
    font-size: 0.8rem !important;
    padding: 2px 0 !important;
    transition: font-size 0.3s, padding 0.3s;
}
.nav-flex { display: flex; justify-content: space-between; align-items: center; }
.logo-container { text-align: center; flex: 0 1 auto; }
.nav-links { display: flex; gap: 2rem; flex: 1; }
.nav-links:last-child { justify-content: flex-end; }
.nav-links a {
    color: rgba(255,255,255,0.93);
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    position: relative;
    padding: 5px 0;
}
.nav-links a:hover { color: var(--white); }
.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    background-color: var(--primary);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}
.nav-links a:hover::after { width: 100%; }

/* Hero */
.hero {
    height: 90vh;
    background: url('../img/Home.png') no-repeat center center/cover;
    position: relative;
    display: flex;
    align-items: center;
    color: var(--white);
    margin-top: 0;
}

/* Animación de aparición hero */
.hero-overlay {
    background:
        radial-gradient(900px 520px at 30% 45%, rgba(0,0,0,0.25), rgba(0,0,0,0.72) 60%, rgba(0,0,0,0.86) 100%),
        linear-gradient(180deg, rgba(0,0,0,0.55), rgba(0,0,0,0.78));
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    opacity: 0;
    transform: scale(1.02);
    transition: opacity 650ms ease, transform 900ms ease;
    will-change: opacity, transform;
}
.hero-content {
    position: relative;
    z-index: 2;
    max-width: 880px;
}
.hero-content::before {
    content: '';
    position: absolute;
    inset: -18px;
    background: rgba(0,0,0,0.22);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 16px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: -1;
}
.hero h2 {
    font-size: 3.5rem;
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    color: var(--white);
    letter-spacing: -1px;
}
.hero .lead {
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
    opacity: 0.9;
    max-width: 62ch;
}
.hero-buttons { display: flex; gap: 20px; flex-wrap: wrap; }

.hero-content[data-hero-reveal] {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 650ms ease 260ms, transform 900ms cubic-bezier(.2,.9,.2,1) 260ms;
    will-change: opacity, transform;
}

.hero.is-ready .hero-overlay {
    opacity: 1;
    transform: scale(1);
}

.hero.is-ready .hero-content[data-hero-reveal] {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .hero-overlay,
    .hero-content[data-hero-reveal] {
        transition: none !important;
        transform: none !important;
        opacity: 1 !important;
    }
}

/* Sobre Nosotros */
.about { background: #0f0f0f; }
.about-flex {
    display: flex;
    align-items: center;
    gap: 60px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: calc(var(--radius) + 6px);
    padding: 34px;
    box-shadow: 0 18px 45px rgba(0,0,0,0.35);
}
.about-text { flex: 1; color: rgba(255,255,255,0.78); }
.about-text .section-title { color: var(--white); }
.about-text p { color: rgba(255,255,255,0.72); }
.about-lead {
    font-size: 1.12rem;
    font-weight: 600;
    color: rgba(255,255,255,0.82);
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--primary);
    padding-left: 20px;
}
.about-image { flex: 1; position: relative; }
.about-image::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(199,18,18,0.22), rgba(0,0,0,0.18) 55%, rgba(0,0,0,0.45));
    pointer-events: none;
}
.about-image img {
    border-radius: 10px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.55);
    border: 1px solid rgba(255,255,255,0.10);
    filter: saturate(0.95) contrast(1.05) brightness(0.92);
}

/* Servicios */
.services { background: linear-gradient(180deg, #0f0f0f 0%, #121212 100%) !important; }
.services .section-title, .services h3, .services h4 { color: var(--white); }
.services .section-header p { color: rgba(255,255,255,0.72); }
.section-header { margin-bottom: 4rem; max-width: 700px; margin-left: auto; margin-right: auto; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 40px; }
.service-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.10);
    box-shadow: 0 18px 50px rgba(0,0,0,0.45);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
    transform: translateY(0);
}
.service-card:hover {
    transform: translateY(-8px);
    border-color: rgba(199,18,18,0.22);
    box-shadow: 0 22px 60px rgba(0,0,0,0.60);
}
.card-image { position: relative; height: 220px; }
.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s ease;
}
.service-card:hover .card-image img { transform: scale(1.04); }
.card-content { padding: 2.5rem 2rem 2rem; }
.card-content h4 { color: rgba(255,255,255,0.92); }
.card-content p { color: rgba(255,255,255,0.72); }

/* Certificaciones */
.certifications { background: linear-gradient(180deg, #0f0f0f 0%, #121212 100%) !important; }
.certifications .section-title, .certifications h3, .certifications h4 { color: var(--white); }
.certifications .section-header p { color: rgba(255,255,255,0.72); }
.cert-carousel { position: relative; max-width: 1100px; margin: 0 auto; }
.cert-viewport {
    overflow-x: auto;
    overflow-y: visible;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 8px 10px 16px;
    scrollbar-width: none;
}
.cert-viewport::-webkit-scrollbar { display: none; }
.cert-track { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 320px); gap: 18px; align-items: stretch; }
.cert-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: var(--radius);
    padding: 18px;
    box-shadow: 0 18px 45px rgba(0,0,0,0.45);
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
    position: relative;
    overflow: hidden;
}
.cert-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 5px;
    width: 100%;
    background: linear-gradient(90deg, rgba(199,18,18,0.95), rgba(165,8,8,0.80));
}
.cert-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(700px 240px at 20% 0%, rgba(199,18,18,0.10), transparent 55%),
        radial-gradient(520px 220px at 90% 20%, rgba(255,255,255,0.04), transparent 60%);
    pointer-events: none;
}
.cert-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 22px 60px rgba(0,0,0,0.60);
    border-color: rgba(199,18,18,0.22);
}
.cert-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: rgba(199, 18, 18, 0.16);
    border: 1px solid rgba(199, 18, 18, 0.28);
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}
.cert-icon img { width: 30px; height: 30px; }
.cert-card h4 { font-size: 1.1rem; margin-bottom: 8px; position: relative; z-index: 1; color: rgba(255,255,255,0.92); }
.cert-card p { font-size: 0.98rem; color: rgba(255,255,255,0.72); position: relative; z-index: 1; }
.cert-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(17,17,17,0.78);
    box-shadow: 0 14px 30px rgba(0,0,0,0.55);
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 1.8rem;
    line-height: 1;
    color: rgba(255,255,255,0.86);
    z-index: 2;
}
.cert-nav:hover { color: rgba(255,255,255,0.95); transform: translateY(-50%) scale(1.03); }
.cert-prev { left: -10px; }
.cert-next { right: -10px; }

/* Contacto */
.contact { position: relative; overflow: hidden; }
.contact-header { margin-bottom: 2.5rem; }
.contact-subtitle {
    max-width: 720px;
    margin: 0.75rem auto 0 auto;
    color: rgba(255,255,255,0.78);
    font-size: 1.05rem;
}
.contact-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(240px, 1fr));
    gap: 22px;
    align-items: stretch;
    max-width: 920px;
    margin: 0 auto;
}
.contact-card {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.contact-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
    border-color: rgba(255,255,255,0.18);
}
.contact-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.contact-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
}
.contact-icon img { width: 26px; height: 26px; }
.contact-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: .3px;
    color: rgba(255,255,255,0.92);
    background: rgba(37, 211, 102, 0.18);
    border: 1px solid rgba(37, 211, 102, 0.28);
}
.contact-badge-mail {
    background: rgba(199, 18, 18, 0.18);
    border-color: rgba(199, 18, 18, 0.28);
}
.contact-card-title {
    color: var(--white);
    font-size: 1.15rem;
    margin-bottom: 6px;
}
.contact-card-text {
    color: rgba(255,255,255,0.82);
    font-weight: 700;
    font-size: 1.05rem;
    margin-bottom: 16px;
}

.btn-wsp, .btn-mail {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    border-radius: 12px;
    padding: 0.95rem 1.1rem;
    margin-top: 0;
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0,0,0,0.18);
    text-decoration: none;
}
.btn-wsp { background: #25d366; color: #fff; }
.btn-wsp:hover { background: #1ebe57; color: #fff; transform: translateY(-2px); }
.btn-mail { background: var(--primary); color: #fff; }
.btn-mail:hover { background: var(--primary-dark); color: #fff; transform: translateY(-2px); }
.btn-wsp .icon-btn, .btn-mail .icon-btn { width: 22px; height: 22px; }

/* Contacto */
.contact-footer-brand {
    display: flex;
    justify-content: center;
    margin-top: 56px;
    background: transparent;
    border: 0;
    box-shadow: none;
    filter: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 0;
    position: relative;
}

.contact-footer-brand::before,
.contact-footer-brand::after {
    content: none !important;
    display: none !important;
}

/* Logo grande sección contacto (tamaño controlado) */
.logo-contact {
    width: min(520px, 90vw);
    max-width: 100%;
    height: auto;
    max-height: 260px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
    filter: none;
}

@media (max-width: 600px) {
    .contact-footer-brand { margin-top: 40px; }
    .logo-contact {
        width: min(360px, 90vw);
        max-height: 210px;
    }
}

/* Navbar */
.logo {
    height: 130px;
    width: auto;
    display: block;
    filter: drop-shadow(0 10px 24px rgba(0,0,0,0.35));
}

/* Logo navbar (estado normal) */
.navbar .logo {
    height: 104px;
    width: auto;
    display: block;
    filter: drop-shadow(0 10px 24px rgba(0,0,0,0.35));
}

/* Logo navbar al hacer scroll */
.navbar-small .logo {
    height: 76px !important;
}

@media (max-width: 600px) {
    body { padding-top: 96px; }
    .nav-links { gap: 0.9rem 1.1rem; }
    .nav-links a { font-size: 0.82rem; letter-spacing: 0.6px; padding: 4px 0; }
    .logo { height: 92px !important; }
    .navbar-small .logo { height: 76px !important; }
    .hero { padding: 64px 0 54px; }
    .hero h2 { font-size: 1.9rem; }
    .hero-content { max-width: 100%; }
    .about-flex { padding: 18px; border-radius: var(--radius); }
    .about-image img, .about-image::after { border-radius: var(--radius); }
    .cert-nav { display: none; }
    .cert-track { grid-auto-columns: minmax(78%, 1fr); gap: 14px; }
    .cert-track .cert-card { min-height: 320px; }
    .wsp-float { right: 14px; bottom: 14px; width: 52px; height: 52px; }
}

/* Responsive */
@media (max-width: 992px) {
    .nav-flex { flex-wrap: wrap; justify-content: center; gap: 10px 18px; }
    .logo-container { order: 0; width: 100%; display: flex; justify-content: center; }
    .nav-links { order: 1; width: 100%; justify-content: center; gap: 1.2rem; flex-wrap: wrap; }
    .nav-links:last-child { justify-content: center; }
    .navbar { padding: 0.55rem 0; }
    .hero { height: auto; padding: 78px 0 64px; }
    .hero-content::before { inset: -14px; border-radius: 14px; }
    .hero h2 { font-size: 2.2rem; line-height: 1.15; }
    .hero .lead { font-size: 1.05rem; margin-bottom: 1.8rem; }
    .hero-buttons { gap: 12px; }
    .btn-primary, .btn-secondary { width: 100%; justify-content: center; }
    .about-flex { flex-direction: column; gap: 22px; padding: 22px; }
    .about-image { order: -1; width: 100%; }
    .about-text .section-title { font-size: 2rem; }
    .contact-cards { grid-template-columns: 1fr; max-width: 560px; }
    .cert-prev { left: -6px; }
    .cert-next { right: -6px; }
}

/* Botón flotante WhatsApp */
.wsp-float {
    position: fixed;
    right: 18px;
    bottom: 18px;
    width: 56px;
    height: 56px;
    border-radius: 999px;
    background: #25d366;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 14px 28px rgba(0,0,0,0.28);
    z-index: 1200;
}
.wsp-float:hover {
    transform: translateY(-2px);
    background: #1ebe57;
}
.wsp-icon {
    width: 26px;
    height: 26px;
    object-fit: contain;
}

/* Navbar móvil: evitar solapes y centrar correctamente */
@media (max-width: 600px) {
    .navbar { padding: 0.45rem 0; }

    .nav-flex {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 10px;
    }

    .logo-container {
        width: 100%;
        display: flex;
        justify-content: center;
        order: 0;
    }

    .nav-links {
        width: 100%;
        flex: 0 0 auto;
        order: 1;
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px 16px;
        margin: 0;
        padding: 0 0.5rem 0.15rem;
    }

    .nav-links:last-child { justify-content: center; }

    .nav-links a {
        font-size: 0.78rem;
        letter-spacing: 0.5px;
        padding: 4px 4px;
        line-height: 1.2;
        white-space: nowrap;
    }

    /* Asegura que el logo no empuje la navbar ni tape links */
    .navbar .logo { height: 72px !important; }
    .navbar-small .logo { height: 62px !important; }
}

/* Navbar móvil: al hacer scroll ocultar menú y dejar solo acceso a Inicio */
@media (max-width: 600px) {
    .navbar-small .nav-links { display: none !important; }

    .navbar-small .logo-container {
        width: auto;
        order: 1;
    }
}

/* Botón Inicio (solo móvil cuando navbar-small) */
.navbar .nav-top {
    display: none;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(17,17,17,0.68);
    color: rgba(255,255,255,0.92);
    font-weight: 800;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    font-size: 0.72rem;
    gap: 8px;
}
.navbar .nav-top::before {
    content: '↑';
    font-size: 0.95rem;
    line-height: 1;
}

@media (max-width: 600px) {
    .navbar-small .nav-top {
        display: inline-flex;
        order: 0;
        margin-top: 2px;
    }
}
