:root {
    --primary: #0056b3;
    --primary-dark: #003d82;
    --text-dark: #222;
    --text-light: #666;
    --bg-light: #f9f9f9;
    --white: #fff;
    --transition: all 0.3s ease;
    --font-main: 'Roboto', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-main); color: var(--text-dark); line-height: 1.6; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.section-padding { padding: 80px 0; }
.text-center { text-align: center; }
.bg-light { background-color: var(--bg-light); }
.divider { height: 3px; width: 60px; background: var(--primary); margin: 15px auto 20px; }
.divider-left { height: 3px; width: 60px; background: var(--primary); margin: 10px 0 20px 0; }
.full-width { width: 100%; border-radius: 5px; }

.btn { display: inline-block; padding: 14px 35px; border-radius: 50px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; font-size: 0.9rem; transition: var(--transition); border: 2px solid transparent; cursor: pointer; }
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-3px); box-shadow: 0 10px 20px rgba(0,86,179,0.3); }
.btn-outline { border-color: var(--white); color: var(--white); }
.btn-outline:hover { background: var(--white); color: var(--primary); }

/* --- HEADER INTELIGENTE --- */
.site-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    height: 90px;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: transform 0.4s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 15px rgba(0,0,0,0.05);
}

.site-header.header-hidden {
    transform: translateY(-100%);
    box-shadow: none;
}

.header-wrap { display: flex; justify-content: space-between; align-items: center; height: 100%; }
.logo img { max-height: 75px; width: auto; } 

.main-nav ul { display: flex; gap: 30px; align-items: center; }
.main-nav a { font-weight: 500; font-size: 1rem; color: var(--text-dark); position: relative; transition: color 0.3s; }
.main-nav a:hover { color: var(--primary); }
.btn-nav { background: var(--primary); color: var(--white) !important; padding: 10px 25px; border-radius: 5px; }

.mobile-toggle { display: none; background: none; border: none; cursor: pointer; }
.mobile-toggle span { display: block; width: 25px; height: 3px; background: var(--text-dark); margin: 5px 0; transition: 0.3s; }
.mobile-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 6px); }
.mobile-toggle.active span:nth-child(2) { opacity: 0; }
.mobile-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -6px); }

/* --- HERO SLIDER --- */
.hero-slider { position: relative; width: 100%; height: 85vh; min-height: 600px; overflow: hidden; background: #000; }
.slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1s ease; z-index: 1; }
.slide.active { opacity: 1; z-index: 2; }
.slide-bg { position: absolute; inset: 0; background-size: cover; background-position: center; transform: scale(1); transition: transform 6s linear; }
.slide.active .slide-bg { transform: scale(1.1); }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(to right, rgba(0,0,0,0.8), rgba(0,0,0,0.2)); z-index: 1; }
.hero-content { position: relative; z-index: 2; height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; color: var(--white); padding-left: 50px; }
.hero-content h1 { font-size: 3.5rem; font-weight: 900; margin-bottom: 20px; line-height: 1.1; opacity: 0; transform: translateY(30px); }
.hero-content p { font-size: 1.25rem; margin-bottom: 30px; max-width: 600px; opacity: 0; transform: translateY(30px); }
.hero-content .subtitle { color: var(--primary); font-weight: 700; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 10px; display: block; opacity: 0; }
.hero-content .btn { opacity: 0; transform: translateY(20px); }

.slide.active .hero-content .subtitle { animation: fadeInUp 0.8s forwards 0.3s; }
.slide.active .hero-content h1 { animation: fadeInUp 0.8s forwards 0.5s; }
.slide.active .hero-content p { animation: fadeInUp 0.8s forwards 0.7s; }
.slide.active .hero-content .btn { animation: fadeInUp 0.8s forwards 0.9s; }
@keyframes fadeInUp { to { opacity: 1; transform: translateY(0); } }

.slider-controls button { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); color: white; padding: 15px; cursor: pointer; font-size: 20px; border-radius: 50%; z-index: 10; transition: 0.3s; width: 50px; height: 50px; display: flex; align-items: center; justify-content: center; }
.slider-controls button:hover { background: var(--primary); border-color: var(--primary); }
.slider-controls .prev { left: 30px; }
.slider-controls .next { right: 30px; }
.slider-dots { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); z-index: 10; display: flex; gap: 12px; }
.dot { width: 12px; height: 12px; border: 2px solid white; border-radius: 50%; cursor: pointer; transition: 0.3s; background: transparent; }
.dot.active { background: var(--primary); border-color: var(--primary); transform: scale(1.2); }

/* --- QUIENES SOMOS --- */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.about-image-wrapper { position: relative; }
.about-img { border-radius: 10px; box-shadow: 0 15px 40px rgba(0,0,0,0.1); width: 100%; }
.experience-badge { position: absolute; bottom: -20px; right: -20px; background: var(--primary); color: var(--white); padding: 20px; border-radius: 10px; text-align: center; box-shadow: 0 10px 20px rgba(0,86,179,0.3); }
.experience-badge .years { display: block; font-size: 2.5rem; font-weight: 900; line-height: 1; }
.experience-badge .text { font-size: 0.9rem; font-weight: 500; }
.section-subtitle { color: var(--primary); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; font-size: 0.9rem; margin-bottom: 10px; display: block; }
.features-list { margin-top: 30px; display: flex; flex-direction: column; gap: 30px; }
.feature-item { display: flex; gap: 20px; align-items: flex-start; }
.f-icon-clean { width: 40px; height: 40px; flex-shrink: 0; color: var(--primary); background: transparent; }
.f-icon-clean svg { width: 32px; height: 32px; fill: currentColor; }
.f-text { border-left: 2px solid rgba(0,0,0,0.1); padding-left: 20px; }
.feature-item h4 { margin-bottom: 5px; color: var(--text-dark); font-weight: 700; }
.feature-item p { font-size: 0.95rem; color: #666; margin: 0; }

/* --- SERVICIOS CON FONDO (FLIP CARDS 3D) --- */
.services-bg { 
    position: relative;
    background: url('../img/fondo_servicios.jpg') no-repeat center center;
    background-size: cover;
    background-attachment: fixed;
}

.services-overlay {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.3); /* Capa negra suave */
    z-index: 1;
}

.services-bg .section-header h2 { color: #ffffff !important; }
.services-bg .section-header p { color: #f0f0f0 !important; }
.services-bg .divider { background: var(--primary); }

.relative-content { position: relative; z-index: 2; }

.services-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); 
    gap: 30px; 
    margin-top: 50px; 
}

/* --- FLIP CARDS 3D CSS --- */
.flip-card {
    background-color: transparent;
    height: 320px; 
    perspective: 1000px; /* Profundidad 3D */
    cursor: pointer;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s;
    transform-style: preserve-3d;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden; /* Safari */
    backface-visibility: hidden;
    border-radius: 15px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    top: 0; left: 0;
}

/* Frente (Blanco) */
.flip-card-front {
    background-color: #fff;
    color: var(--text-dark);
    z-index: 2;
}

.flip-card-front h3 { margin-top: 20px; font-weight: 800; font-size: 1.3rem; }
.tap-hint { margin-top: 15px; font-size: 0.8rem; color: #999; text-transform: uppercase; letter-spacing: 1px; }

.flip-card-front .icon-box {
    width: 80px; height: 80px;
    background: rgba(0, 86, 179, 0.1);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--primary);
    margin-bottom: 10px;
}
.flip-card-front .icon-box svg { width: 40px; height: 40px; fill: currentColor; }

/* Reverso (Azul) */
.flip-card-back {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    transform: rotateY(180deg);
    padding: 20px;
    z-index: 1;
}

.flip-card-back h3 { margin-bottom: 15px; font-size: 1.2rem; border-bottom: 1px solid rgba(255,255,255,0.3); padding-bottom: 10px; width: 100%; }
.flip-card-back p { font-size: 0.95rem; line-height: 1.5; margin-bottom: 20px; }

.btn-small {
    display: inline-block;
    padding: 8px 20px;
    background: #fff;
    color: var(--primary);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    transition: 0.3s;
}
.btn-small:hover { background: #eee; transform: scale(1.05); }

/* --- INDUSTRIAS (Dahua Solutions) --- */
.industries-bg { background-color: #fff; } 

.industries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 40px;
}

.ind-card {
    position: relative;
    height: 300px;
    border-radius: 15px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.ind-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.9), rgba(0,0,0,0.1));
    display: flex;
    align-items: flex-end;
    padding: 30px;
    transition: all 0.4s ease;
    opacity: 0.9;
}

.ind-card:hover .ind-overlay {
    background: rgba(0, 56, 130, 0.9);
}

.ind-content {
    transform: translateY(20px);
    transition: all 0.4s ease;
}

.ind-card:hover .ind-content {
    transform: translateY(0);
}

.ind-content h3 {
    color: #fff;
    font-size: 1.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.ind-content p {
    color: #ddd;
    font-size: 0.95rem;
    line-height: 1.5;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.4s ease;
}

.ind-card:hover .ind-content p {
    max-height: 100px;
    opacity: 1;
    margin-top: 10px;
}

/* --- ESTILOS DEL MODAL --- */
.modal {
    display: none; 
    position: fixed; 
    z-index: 2000; 
    left: 0; top: 0;
    width: 100%; height: 100%; 
    overflow: auto; 
    background-color: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 40px;
    border: 1px solid #888;
    width: 90%; 
    max-width: 1000px;
    border-radius: 15px;
    position: relative;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
}

.close-btn {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}
.close-btn:hover { color: #000; }

.modal-header { text-align: center; margin-bottom: 40px; }
.modal-header h2 { color: var(--primary); font-size: 2rem; margin-bottom: 10px; }
.modal-header p { color: #666; }

.sub-solutions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 25px;
}

.sub-card {
    background: #f9f9f9;
    padding: 25px;
    border-radius: 10px;
    border-left: 4px solid var(--primary);
    transition: 0.3s;
}
.sub-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.1); }

.sub-card h4 { color: var(--text-dark); margin-bottom: 15px; font-size: 1.1rem; font-weight: 700; }
.sub-card ul { padding-left: 20px; }
.sub-card li { font-size: 0.9rem; color: #555; margin-bottom: 8px; list-style-type: disc; }
.sc-icon { font-size: 2rem; margin-bottom: 15px; }

.sub-card.pending { border-left-color: #ccc; opacity: 0.8; }
.badge-pending { display: inline-block; background: #eee; color: #777; font-size: 0.75rem; padding: 5px 10px; border-radius: 20px; margin-top: 10px; font-weight: 600; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* --- TIMELINE (PROCESO) --- */
.timeline-bg { 
    position: relative;
    background: url('../img/fondo_proceso.jpg') no-repeat center center;
    background-size: cover;
    background-attachment: fixed;
    color: var(--white); 
}

.proceso-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.8); z-index: 1; }

.timeline { position: relative; max-width: 800px; margin: 50px auto 0; padding: 20px 0; }
.timeline::before { content: ''; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; background: rgba(255, 255, 255, 0.15); transform: translateX(-50%); }

.timeline-item { position: relative; width: 50%; padding: 20px 40px; box-sizing: border-box; }
.timeline-item:nth-child(odd) { left: 0; text-align: right; }
.timeline-item:nth-child(even) { left: 50%; text-align: left; }

.timeline-item::after { content: ''; position: absolute; top: 30px; width: 16px; height: 16px; background: var(--primary); border: 3px solid rgba(0,0,0,0.5); border-radius: 50%; z-index: 1; box-shadow: 0 0 15px rgba(0, 86, 179, 0.8); }
.timeline-item:nth-child(odd)::after { right: -8px; }
.timeline-item:nth-child(even)::after { left: -8px; }

.timeline-content .t-num { font-size: 3rem; font-weight: 900; color: rgba(255, 255, 255, 0.1); line-height: 1; margin-bottom: -15px; position: relative; z-index: 0; }
.timeline-content h3 { color: var(--primary); margin-bottom: 10px; position: relative; z-index: 1; }
.timeline-content p { color: #ddd; font-size: 0.95rem; }

/* --- CONTACTO --- */
.contact-bg { position: relative; background: url('../img/fondo_contacto.jpg') no-repeat center center; background-size: cover; background-attachment: fixed; }
.contact-bg::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255, 255, 255, 0.6); z-index: 0; }
.contact-wrapper { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: start; }

.contact-list { display: flex; flex-direction: column; gap: 30px; margin-bottom: 30px; }
.contact-list li { font-size: 1.05rem; color: var(--text-dark); display: flex; flex-direction: column; }
.contact-list strong { color: var(--primary); font-weight: 700; margin-bottom: 8px; }
.contact-list p { margin: 0; line-height: 1.4; }

.map-container { border-radius: 12px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.1); border: 3px solid rgba(255, 255, 255, 0.8); }

.contact-form { background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); padding: 40px; border-radius: 20px; box-shadow: 0 25px 50px rgba(0,0,0,0.15); border: 1px solid rgba(255, 255, 255, 0.3); }
.contact-form h3 { margin-bottom: 25px; color: var(--primary); font-size: 1.5rem; }
.input-group { margin-bottom: 20px; }
.input-group input, .input-group textarea { width: 100%; padding: 15px; border: 1px solid rgba(0,0,0,0.1); border-radius: 5px; font-family: inherit; font-size: 1rem; transition: 0.3s; background: rgba(255, 255, 255, 0.9); }
.input-group input:focus, .input-group textarea:focus { background: #fff; border-color: var(--primary); outline: none; box-shadow: 0 0 0 4px rgba(0, 86, 179, 0.1); }

/* --- FOOTER --- */
.site-footer { background: #1a1a1a; color: #aaa; padding: 70px 0 30px; font-size: 0.95rem; position: relative; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 50px; margin-bottom: 50px; }
.footer-col h3 { color: var(--white); margin-bottom: 20px; font-size: 1.4rem; }
.footer-col h4 { color: var(--white); margin-bottom: 20px; font-size: 1.1rem; text-transform: uppercase; letter-spacing: 1px; }
.footer-links li { margin-bottom: 12px; }
.footer-links a { transition: var(--transition); }
.footer-links a:hover { color: var(--primary); padding-left: 5px; }
.appstack-credit { margin-top: 15px; padding-top: 15px; border-top: 1px solid #333; font-size: 0.9rem; }
.appstack-credit strong { color: var(--primary); }
.appstack-credit a:hover { text-decoration: underline; color: var(--white); }
.footer-bottom { text-align: center; border-top: 1px solid #333; padding-top: 30px; font-size: 0.9rem; }

.back-to-top { position: fixed; bottom: 30px; right: 30px; width: 50px; height: 50px; background: var(--primary); color: var(--white); border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 24px; text-decoration: none; box-shadow: 0 5px 15px rgba(0,86,179,0.4); opacity: 0; pointer-events: none; transition: var(--transition); transform: translateY(20px); z-index: 999; }
.back-to-top.visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.back-to-top:hover { background: var(--primary-dark); transform: translateY(-5px); }

/* --- RESPONSIVE --- */
@media (max-width: 900px) {
    .hero-content h1 { font-size: 2.5rem; }
    .contact-wrapper, .about-grid { grid-template-columns: 1fr; } 
    .about-image-wrapper { order: -1; margin-bottom: 30px; }
}
@media (max-width: 768px) {
    .site-header { padding: 0 15px; height: 80px; }
    .logo img { max-height: 50px; }
    .mobile-toggle { display: block; z-index: 1001; }
    .main-nav { position: fixed; top: 0; right: 0; width: 80%; height: 100vh; background: var(--white); box-shadow: -5px 0 15px rgba(0,0,0,0.1); transform: translateX(100%); transition: transform 0.3s ease; display: flex; align-items: center; justify-content: center; z-index: 999; }
    .main-nav.active { transform: translateX(0); }
    .main-nav ul { flex-direction: column; gap: 20px; text-align: center; }
    .main-nav a { font-size: 1.5rem; }
    .hero-content { padding-left: 20px; align-items: center; text-align: center; }
    .hero-content h1 { font-size: 2rem; }
    .slider-controls { display: none; }
    .process-parallax, .contact-bg, .services-bg { background-attachment: scroll; }
    .footer-grid { gap: 30px; }
    .experience-badge { padding: 10px; right: 0; bottom: -10px; }
    .experience-badge .years { font-size: 1.8rem; }
    
    /* Timeline Movil */
    .timeline::before { left: 20px; }
    .timeline-item { width: 100%; padding-left: 50px; padding-right: 0; text-align: left; }
    .timeline-item:nth-child(even) { left: 0; }
    .timeline-item::after { left: 12px; }
    .timeline-item:nth-child(odd)::after { left: 12px; }
}