/* ==========================================================================
   1. VARIABLES, FUENTES Y ESTILOS GENERALES
   ========================================================================== */
@font-face {
    font-family: 'RobotoVariable';
    src: url('../fonts/Roboto-VariableFont_wdth,wght.ttf') format('truetype');
    font-weight: 100 900;
    font-stretch: 75% 100%;
}

:root {
    --primary: #00a887;       
    --secondary: #05f311;     
    --dark-neutral: #091a44;  
    --bg-light: #f4fbf9;      
    --white: #ffffff;
    --text-main: #1c2d37;     
    --radius: 16px;
    --transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Control global absoluto contra la franja blanca lateral */
html, body {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden; 
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box;
    max-width: 100%; /* Evita que elementos internos empujen el ancho de la pantalla */
}

body {
    font-family: 'RobotoVariable', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-main);
    line-height: 1.6;
    scroll-behavior: smooth;
}

/* --- UTILERÍAS --- */
.text-primary { 
    color: var(--primary) !important;
}

.bg-primary { 
    background-color: var(--primary) !important;
}

.bg-top-banner {
    background-color: #00a887 !important;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 15px;
    color: var(--secondary);
    text-transform: uppercase;
    letter-spacing: -1px;
}

.title-line {
    width: 60px;
    height: 4px;
    background-color: var(--primary);
    margin: 20px auto 0;
    border-radius: 2px;
}

.overflow-hidden { 
    overflow: hidden;
}


/* ==========================================================================
   2. BOTONES PRINCIPALES
   ========================================================================== */
.btn-primary {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    color: var(--white) !important;
    transition: var(--transition);
}

.btn-primary:hover {
    background-color: #008a6e !important;
    border-color: #008a6e !important;
}

.btn-secondary {
    display: inline-block;
    background-color: #00a887;
    color: #ffffff;
    padding: 12px 32px;
    font-weight: 600;
    border-radius: 50px;
    border: 2px solid #00a887;
    transition: var(--transition);
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(0, 168, 135, 0.2);
}

.btn-secondary:hover {
    background-color: #ffffff;
    color: #00a887;
    border-color: #00a887;
    transform: translateY(-4px);
    box-shadow: 0 12px 25px rgba(0, 168, 135, 0.3);
}


/* ==========================================================================
   3. NAVEGACIÓN (NAVBAR)
   ========================================================================== */
.nav-link {
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 5px;
    left: 50%;
    background-color: var(--primary);
    transition: all 0.3s ease-in-out;
    transform: translateX(-50%);
}

.nav-link:hover { 
    color: var(--primary) !important;
}

.nav-link:hover::after { 
    width: 80%;
}


/* ==========================================================================
   4. HERO SECTION (BANNER PRINCIPAL RESPONSIVO)
   ========================================================================== */
.hero {
    position: relative;
    width: 100%;
    min-height: 75vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(
        135deg, 
        rgba(9, 26, 68, 0.45),   
        rgba(0, 168, 135, 0.15)   
    ), url('../img/banner1.png') no-repeat center center / cover;
    color: #ffffff;
    padding: 80px 0;
    text-align: center;
    overflow: hidden; 
}

.hero-content { 
    position: relative;
    z-index: 2; 
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px; 
}

.hero h1 {
    font-size: clamp(2rem, 5vw + 1rem, 3.5rem); 
    font-weight: 800;
    margin-bottom: 20px;
    word-wrap: break-word; 
    overflow-wrap: break-word;
}

.text-hero-lead {
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(9, 26, 68, 0.4);
}

.hero-description {
    font-size: clamp(1.1rem, 2vw + 0.5rem, 1.3rem);
    font-weight: 600;
    color: #ffffff !important;
    margin: 0 auto 30px auto;
    max-width: 600px;
    text-shadow: 
        0px 2px 4px rgba(9, 26, 68, 0.9),
        0px 0px 10px rgba(9, 26, 68, 0.9),
        0px 0px 20px rgba(0, 168, 135, 0.6); 
}

.highlight-box {
    background-color: #f1f5f9;
    color: #00a887;
    padding: 2px 16px;
    border-radius: 8px;
    display: inline-block;
    transition: opacity 0.4s ease-in-out, transform 0.4s ease-in-out;
    transform: translateY(0);
    opacity: 1;
}

.text-hidden {
    opacity: 0;
    transform: translateY(10px);
}


/* ==========================================================================
   5. SECCIÓN SERVICIOS (AJUSTADA PARA PANTALLAS ANGOSTAS)
   ========================================================================== */
.services { 
    padding: 80px 0;
}

.services-grid {
    display: grid;
    /* Bajamos a 280px para que encaje perfectamente en pantallas pequeñas */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px; 
    max-width: 1200px;
    margin: 40px auto 50px;
    padding: 0 15px;
}

.services-grid .service-card {
    height: 300px;
    perspective: 1000px;
    cursor: pointer;
    opacity: 0;
    transform: translateY(40px);
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.services-grid .service-card.appear {
    opacity: 1 !important;
    transform: translateY(0) !important; 
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1) !important;
    transform-style: preserve-3d !important;
}

.service-card.is-flipped .card-inner {
    transform: rotateY(180deg) !important;
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden !important;
    backface-visibility: hidden !important;
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 24px;
    box-shadow: 0 6px 15px rgba(0,0,0,0.05);
}

.card-front {
    background: var(--white);
    border: 1px solid #eef2f7;
}

.card-back {
    background: var(--dark-neutral);
    color: var(--white);
    transform: rotateY(180deg) !important;
    overflow: hidden;
}

.card-back img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.card-icon { 
    font-size: 3rem;
    margin-bottom: 15px;
}


/* ==========================================================================
   6. SECCIÓN NOSOTROS
   ========================================================================== */
.about-section .col-lg-5 {
    opacity: 0;
    transform: translateX(-60px); 
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.about-section .col-lg-7 {
    opacity: 0;
    transform: translateX(60px); 
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.about-section .col-lg-5.animate-left {
    opacity: 1 !important;
    transform: translateX(0) !important; 
}

.about-section .col-lg-7.animate-right {
    opacity: 1 !important;
    transform: translateX(0) !important; 
}

.about-section .experience-badge {
    opacity: 0;
    transform: translateY(30px);
}

.experience-badge {
    position: absolute;
    bottom: 0;
    right: 0;
    background: var(--primary);
    color: var(--white);
    padding: 20px 30px;
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(13, 110, 253, 0.3);
    text-align: center;
    animation: fadeInUp 1s ease-out 0.5s forwards;
    opacity: 0;
}

.experience-badge .number {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}

.experience-badge .text {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.icon-box {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.feature-item { 
    transition: var(--transition);
}

.feature-item:hover { 
    transform: translateX(10px);
}


/* ==========================================================================
   7. SECCIÓN PROYECTOS
   ========================================================================== */
.projects-section {
    background-color: #ffffff;
}

.project-card {
    border: 1px solid #e2e8f0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.carousel-video-wrapper {
    position: relative;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: #091a44 !important;
}

.wrapper-video-large {
    padding: 15px;
}

.wrapper-video-small {
    padding: 40px; 
}

.carousel-video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.4); 
}

.carousel-video-wrapper video.video-horizontal-spec {
    object-fit: contain !important; 
    object-position: center !important;
}

.project-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 6px 14px;
    border-radius: 50px;
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    z-index: 10;
}

.carousel-indicators [data-bs-target] {
    background-color: #00a887 !important;
}

.carousel-control-prev-icon, .carousel-control-next-icon {
    background-color: rgba(9, 26, 68, 0.7) !important;
    background-size: 50%;
}

@media (min-width: 992px) {
    .carousel-video-wrapper {
        height: 580px !important; 
    }
    
    .wrapper-video-large {
        padding: 30px; 
    }

    .wrapper-video-small {
        padding: 80px; 
    }

    .carousel-item .row.align-items-stretch {
        min-height: 580px;
    }
}


/* ==========================================================================
   8. SECCIÓN CONTACTO Y FORMULARIOS
   ========================================================================== */
.contact-section {
    background-color: var(--bg-light);
}

.custom-input {
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.custom-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.25rem rgba(0, 168, 135, 0.15);
    background-color: var(--white);
    outline: none;
}

textarea.custom-input {
    border-radius: 12px;
    resize: none;
}


/* ==========================================================================
   9. ANIMACIONES GENERALES
   ========================================================================== */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-25px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-left { transform: translateX(0); }
.animate-right { transform: translateX(0); }


/* ==========================================================================
   10. MEDIA QUERIES RESPONSIVAS
   ========================================================================== */
@media (max-width: 991px) {
    .experience-badge { 
        padding: 15px 20px; 
        right: 20px; 
        bottom: 20px;
    }
}


/* ==========================================================================
   11. SECCIÓN VIDEO CORPORATIVO
   ========================================================================== */
.video-container {
    width: 100%;                  
    max-width: 600px;                 
    aspect-ratio: 16 / 9;             
    margin: 0 auto;                  
    border-radius: 12px;              
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(9, 26, 68, 0.15); 
}

video.video-presentacion {
    width: 100% !important;
    height: 100% !important;          
    object-fit: cover !important;     
}


/* ==========================================================================
   12. SECCIÓN LOGOS CLIENTES (ANIMACIÓN FLOTANTE)
   ========================================================================== */
.client-logo {
    max-height: 70px;
    width: auto;
    object-fit: contain;
    transition: all 0.3s ease-in-out;
}

.logo-client-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100px;
    animation: floatLogo 4s ease-in-out infinite; 
}

.logo-client-container:hover .client-logo {
    transform: scale(1.15); 
}

@keyframes floatLogo {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

.row > .col:nth-child(1) .logo-client-container { animation-delay: 0s; }
.row > .col:nth-child(2) .logo-client-container { animation-delay: 0.5s; }
.row > .col:nth-child(3) .logo-client-container { animation-delay: 1s; }
.row > .col:nth-child(4) .logo-client-container { animation-delay: 1.5s; }
.row > .col:nth-child(5) .logo-client-container { animation-delay: 2s; }

.tracking-wider {
    letter-spacing: 1.5px;
}


/* ==========================================================================
   13. FOOTER MULTICOLUMNA Y BOTÓN WHATSAPP
   ========================================================================== */
.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.70);
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.95rem;
    display: inline-block;
}

.footer-links a:hover {
    color: var(--primary);
    transform: translateX(6px);
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-radius: 50%;
    transition: var(--transition);
    text-decoration: none;
}

.social-icon:hover {
    background-color: var(--primary);
    color: #ffffff;
    transform: translateY(-4px);
    box-shadow: 0 5px 15px rgba(0, 168, 135, 0.4);
}

.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 30px;
    right: 30px;
    background-color: #25d366;
    color: #FFF;
    border-radius: 50px;
    text-align: center;
    font-size: 32px;
    box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.25);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    text-decoration: none;
}

.whatsapp-float:hover {
    background-color: #1ebe57;
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0px 6px 20px rgba(37, 211, 102, 0.5);
}