:root {
    --primary: #0056b3;
    --primary-dark: #003d82;
    --secondary: #00a896;
    --light: #f8f9fa;
    --dark: #212529;
    --gray: #6c757d;
    --light-gray: #e9ecef;
    --light-blue: #f0f8ff;
    --transition: all 0.3s ease;
    --shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans', sans-serif;
    line-height: 1.3;
    color: var(--dark);
    background-color: var(--light);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5 {
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

p {
    margin-bottom: 0rem;
    color: var(--dark);
}

a {
    text-decoration: none;
    color: var(--primary);
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.section {
    padding: 3.5rem 0;
}

.section-title {
    text-align: center;
    font-size: 2.3rem;
    margin-bottom: 2.5rem;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 100px;
    height: 4px;
    background: var(--secondary);
    margin: 1rem auto;
    border-radius: 2px;
}

.btn {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 0.8rem 2rem;
    border-radius: 30px;
    font-weight: 600;
    transition: var(--transition);
    border: 2px solid var(--primary);
    cursor: pointer;
    text-align: center;
}

.btn:hover {
    background: transparent;
    color: var(--primary);
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.btn-secondary {
    background: var(--secondary);
    border-color: var(--secondary);
}

.btn-secondary:hover {
    color: var(--secondary);
}

.btn-success {
    background: #25D366;
    border-color: #25D366;
}

.btn-success:hover {
    background: transparent;
    color: #25D366;
}

/* Header y navegación */
.navbar {
    background-color: #14222f;
    padding: 1.9rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-logo img {
    height: 70px;
    max-width: 100%;
    width: auto;
    display: block;
}

.navbar-links {
    display: flex;
    gap: 2rem;
}

.navbar-links a {
    color: white;
    font-weight: 500;
    padding: 0.5rem 0;
}

.navbar-links a:hover {
    color: var(--secondary);
}

.navbar-icons {
    display: flex;
    gap: 1rem;
}

.navbar-icons a {
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: var(--transition);
}

.navbar-icons a:hover {
    background: var(--secondary);
    transform: translateY(-3px);
}

.hamburger {
    display: none;
    cursor: pointer;
    background: transparent;
    border: none;
    padding: 0.5rem;
}

.hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    background: white;
    margin: 5px 0;
    transition: var(--transition);
}

/* Hero section */
.hero {
    height: 100vh;
    min-height: 600px;
    position: relative;
    display: flex;
    align-items: center;
    padding-top: 100px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
}

.hero-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0rem;
    align-items: center;
    position: relative;
    z-index: 2;
}

.hero-content {
    animation: fadeInLeft 1s ease-out forwards;
    opacity: 0;
    position: relative;
    z-index: 2;
    background: rgba(20, 34, 47, 0.65);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.12);
    max-width: 500px;
}

.hero-image {
    position: relative;
    animation: slideInFromRight 1.2s ease-out forwards;
    animation-delay: 0.3s;
    opacity: 0;
}

.hero-image img {
    width: 100%;
    height: auto;
    border-radius: 35px;
    box-shadow: var(--shadow-hover);
    transform: scaleX(1.2) rotateY(-5deg);
    border: 5px solid rgba(255, 255, 255, 0.1);
}

.hero h1 {
    font-size: 2.4rem;
    margin-bottom: 1.5rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2.2rem;
    color: rgba(255, 255, 255, 0.9);
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-content h1 {
    margin-top: 2.5rem;
}

/* Servicios */
.services {
    background-color: var(--light-blue);
}

.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.service-card {
    background: white;
    padding: 2.2rem 1.8rem;
    border-radius: 15px;
    text-align: center;
    transition: var(--transition);
    box-shadow: var(--shadow);
    border-top: 4px solid var(--primary);
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
}

.service-card i {
    font-size: 3.2rem;
    color: var(--primary);
    margin-bottom: 1.2rem;
    background: rgba(0, 86, 179, 0.1);
    width: 85px;
    height: 85px;
    line-height: 85px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.service-card h3 {
    font-size: 1.4rem;
    margin-bottom: 0.8rem;
    color: var(--primary-dark);
}

.services .service-card p {
    font-size: 1.15rem;
    line-height: 1.7;
}

/* Estilos para la sección ¿Cuándo Contratarnos? */
.when-section {
    padding: 60px 20px;
    text-align: center;
    background-color: #90c0ec;
}

.section-title {
    font-size: 28px;
    font-weight: 700;
    color: #005e72;
    margin-bottom: 40px;
}

.when-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px 40px;
    max-width: 1100px;
    margin: 0 auto;
}

.when-card {
    flex: 1 1 220px;
    max-width: 240px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.number {
    font-size: 32px;
    font-weight: 700;
    color: #007b8c;
    margin-bottom: 10px;
}

.when-card p {
    font-size: 18px;
    color: #444;
    line-height: 1.6;
}

/* Ajustes específicos para las tarjetas 5, 6 y 7 */
.when-card:nth-child(5) {
    margin-left: 40px;
}

.when-card:nth-child(6) {
    margin-left: 80px;
}

.when-card:nth-child(7) {
    margin-left: 120px;
}

@media (max-width: 768px) {
    .when-grid {
        flex-direction: column;
        align-items: center;
    }

    .when-card {
        margin-left: 0 !important;
        max-width: 90%;
    }
}

/* Trayectoria */
.about {
    background-color: var(--light-blue);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    align-items: center;
}

.about-image {
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow-hover);
    position: relative;
}

.about-image img {
    width: 100%;
    height: auto;
    transition: var(--transition);
}

.experience-badge {
    position: absolute;
    top: -20px;
    right: -20px;
    background: var(--secondary);
    color: white;
    width: 110px;
    height: 110px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: var(--shadow);
    z-index: 10;
}

.experience-badge span:first-child {
    font-size: 2.3rem;
    font-weight: 800;
    line-height: 1;
}

.experience-badge span:last-child {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Testimonios */
.testimonials {
    background-color: var(--light-blue);
}

/* Carrusel de testimonios */
.people5 {
    position: relative;
    padding: 3.5rem 0;
}

.user {
    background: white;
    padding: 2.2rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #0056b3;
    max-width: 700px;
    margin: 0 auto;
}

.user_text p {
    font-style: italic;
    color: #6c757d;
    margin-bottom: 1.2rem;
    font-size: 1.05rem;
    line-height: 1.6;
}

.user_name {
    color: #003d82;
    font-weight: 700;
    margin-bottom: 0.4rem;
    font-size: 1.15rem;
}

.user_desk {
    color: #00a896;
    font-weight: 500;
}

/* Contacto */
.contact {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: white;
}

.contact .section-title {
    color: white;
}

.contact .section-title::after {
    background: var(--secondary);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
}

.contact-info h3 {
    color: white;
    margin-bottom: 1.2rem;
    font-size: 1.7rem;
}

.contact-detail {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1.2rem;
}

.contact-detail i {
    font-size: 1.4rem;
    color: var(--secondary);
    margin-right: 1rem;
    min-width: 30px;
}

.contact-detail div h4 {
    color: white;
    margin-bottom: 0.3rem;
}

.contact-detail div p {
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 0;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 50%;
    font-size: 1.2rem;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--secondary);
    transform: translateY(-5px);
}

.contact-form {
    background: white;
    padding: 2.2rem;
    border-radius: 15px;
    box-shadow: var(--shadow-hover);
}

.contact-form h3 {
    color: var(--primary-dark);
    margin-bottom: 1.2rem;
    text-align: center;
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.4rem;
    color: var(--primary-dark);
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1px solid var(--light-gray);
    border-radius: 8px;
    font-family: 'Open Sans', sans-serif;
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.1);
}

textarea.form-control {
    min-height: 140px;
    resize: vertical;
}

/* Footer */
footer {
    background: var(--dark);
    color: white;
    padding: 3.5rem 0 0;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2.5rem;
}

.footer-section h3 {
    color: white;
    font-size: 1.4rem;
    margin-bottom: 1.2rem;
    position: relative;
    padding-bottom: 0.7rem;
}

.footer-section h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: var(--secondary);
}

.footer-section p {
    color: rgba(255, 255, 255, 0.7);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.7rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    transition: var(--transition);
    display: inline-block;
}

.footer-links a:hover {
    color: var(--secondary);
    transform: translateX(5px);
}

.footer-contact p {
    display: flex;
    align-items: flex-start;
    margin-bottom: 0.9rem;
}

.footer-contact i {
    margin-right: 1rem;
    color: var(--secondary);
}

.footer-bottom {
    text-align: center;
    padding: 1.8rem 0;
    margin-top: 2.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

/* Botón de WhatsApp flotante */
.whatsapp-button {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 55px;
    height: 55px;
    background: #25D366;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7rem;
    box-shadow: var(--shadow-hover);
    z-index: 1000;
    transition: var(--transition);
}

.whatsapp-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

/* Modal para confirmación de WhatsApp */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 1.8rem;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    text-align: center;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.2rem;
}

/* Animaciones */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Sección de diagnóstico */
.diagnostic {
    background: var(--primary);
    color: white;
    padding: 2.5rem 0;
}

.diagnostic .container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.diagnostic-content {
    flex: 1;
    min-width: 300px;
}

.diagnostic-content h3 {
    font-size: 1.7rem;
    margin-bottom: 0.9rem;
}

.diagnostic-button {
    flex: 0 0 auto;
}

.btn-light {
    background: white;
    color: var(--primary);
    border-color: white;
}

.btn-light:hover {
    background: transparent;
    color: white;
}

@media (max-width: 768px) {
    .diagnostic .container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .diagnostic-content h3 {
        text-align: center;
    }
}

/* Grid de clientes */
.clients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.2rem;
    margin-bottom: 3.5rem;
}

.clients-grid img {
    max-height: 75px;
    margin: auto;
    width: auto;
}

/* MEJORAS RESPONSIVE AVANZADAS PARA MÓVILES */
@media (max-width: 1200px) {
    .hero h1 {
        font-size: 2.1rem;
    }
}

@media (max-width: 992px) {
    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }
    .hero-content {
        margin-bottom: 1.5rem;
        max-width: 100%;
        padding: 1.5rem 0.5rem;
    }
    .hero-image {
        margin-top: 0;
        max-width: 95vw;
    }
    
    /* Distribución tipo ladrillos solo en escritorio */
    .when-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .when-card:nth-child(5),
    .when-card:nth-child(6),
    .when-card:nth-child(7) {
        grid-column: auto !important;
    }
}

@media (max-width: 768px) {
    .section {
        padding: 3rem 0;
    }
    
    .section-title {
        font-size: 1.9rem;
    }
    
    .hero {
        padding-top: 100px;
        min-height: 85vh;
        height: auto;
    }
    
    .hero h1 {
        font-size: 1.7rem;
    }
    
    .hero p {
        font-size: 1.05rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 1rem;
    }
    
    .hero-buttons .btn {
        width: 100%;
    }
    
    .navbar-links {
        position: fixed;
        top: 100px;
        right: -100%;
        flex-direction: column;
        background: var(--dark);
        width: 100%;
        height: calc(100vh - 100px);
        padding: 1.8rem;
        transition: var(--transition);
        gap: 1.5rem;
        align-items: center;
        justify-content: flex-start;
        overflow-y: auto;
    }
    
    .navbar-links.active {
        right: 0;
    }
    
    .hamburger {
        display: block;
    }
    
    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    .experience-badge {
        top: -15px;
        right: -15px;
        width: 85px;
        height: 85px;
    }
    
    .contact-grid {
        gap: 1.8rem;
    }

    .contact-grid {
    grid-template-columns: 1fr;
}

.contact-form {
    background-color: rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
}

.contact-form h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

.contact-form .form-group {
    margin-bottom: 1rem;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 1rem;
    border: none;
}

.contact-form textarea {
    min-height: 120px;
}

.contact-form .btn {
    width: 100%;
    padding: 0.8rem;
    font-size: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.contact-info {
    margin-bottom: 2rem;
}

    
    .clients-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.9rem;
    }
    
    .clients-grid img {
        max-height: 55px;
    }
    
    .diagnostic .container {
        flex-direction: column;
        text-align: center;
    }
    
    /* Trayectoria en móvil: imagen arriba */
    .about-content {
        grid-template-columns: 1fr;
    }
    
    .about-image {
        order: -1;
    }
}

@media (max-width: 576px) {
    .section {
        padding: 1rem 0;
    }
    
    .section-title {
        font-size: 1.5rem;
        margin-bottom: 2rem;
    }
    
    .hero {
        min-height: 85vh;
    }
    
    .hero-content {
        padding: 1.5rem 0;
    }
    
    .hero h1 {
        font-size: 2.6rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .service-grid,
    .when-grid {
        grid-template-columns: 1fr;
    }
    
    .service-card {
        padding: 1.5rem;
    }
    
    .when-card {
        padding: 1.5rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
    
    .contact-form {
        padding: 1.5rem;
    }
    
    .form-control {
        padding: 0.7rem;
        font-size: 16px;
    }
    
    .clients-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .clients-grid img {
        max-height: 45px;
    }
    
    .whatsapp-button {
        width: 48px;
        height: 48px;
        font-size: 1.4rem;
    }
    
    .modal-content {
        padding: 1.3rem;
    }
    
    .modal-buttons {
        flex-direction: column;
    }
    
    .modal-buttons .btn {
        width: 100%;
    }

    .user {
        padding: 1.3rem;
    }
}

@media (max-width: 400px) {
    .navbar-logo img {
        height: 55px;
        max-width: 90vw;
        margin: 0 auto;
    }
    
    .hero h1 {
        font-size: 1.5rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .contact-detail {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .clients-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: 100vh;
        height: auto;
        padding: 120px 0 50px;
    }
    
    .hero-content {
        padding: 1rem;
    }
    
    .hero h1 {
        font-size: 1.7rem;
        margin-bottom: 1rem;
    }
    
    .hero p {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
}

/* Mejoras de accesibilidad para botones */
button, .btn {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    min-height: 44px;
}

/* Mejora de rendimiento en animaciones */
.service-card, .when-card, .navbar-icons a, .social-links a {
    will-change: transform;
}

/* Optimización para touch en móviles */
input, textarea, button, select, .btn {
    font-size: 16px;
    touch-action: manipulation;
}