/* ================================================
    AMBIENTE LIBRE - ESTILOS CSS OPTIMIZADOS

    CAMBIOS REALIZADOS:
    1. Agrupadas todas las reglas por breakpoint (1200px, 768px, 480px)
    2. Eliminado código duplicado
    3. Optimizado el orden de las propiedades
    4. Implementado mobile-first donde es posible
   ================================================ */

/* Reset y configuración base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Modal de agradecimiento después de enviar el formulario */
.thank-you-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease-out;
}

.thank-you-content {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 90%;
    width: 400px;
    animation: slideIn 0.4s ease-out;
}

.thank-you-content h3 {
    color: #1a365d;
    margin-bottom: 1rem;
}

.thank-you-content p {
    margin-bottom: 1rem;
    line-height: 1.5;
    color: #333;
}

.thank-you-content .close-btn {
    background: #1a365d;
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 5px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease;
    margin-top: 0.5rem;
}

.thank-you-content .close-btn:hover {
    background: #2c5282;
}

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

@keyframes slideIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Variables CSS para las tarjetas de servicios */
:root {
    --card-d: 700ms;
    --card-e: cubic-bezier(0.19, 1, 0.22, 1);
    --card-font-sans: 'Arial', sans-serif;
    --card-font-serif: 'Georgia', serif;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    overflow-x: hidden;
}

/* ================================================
    ESTILOS GLOBALES
   ================================================ */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
}

.section {
    padding: 5rem 0;
}

.section-title {
    font-size: 2.2rem;
    text-align: center;
    margin-bottom: 3rem;
    color: #1a365d;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #ffa726, #ff8c42);
    margin: 0.8rem auto 0;
    border-radius: 2px;
}

.cta-button {
    display: inline-block;
    background: linear-gradient(135deg, #ffa726, #ff8c42);
    color: white;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 167, 38, 0.4);
    border: none;
    cursor: pointer;
    text-align: center;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 167, 38, 0.6);
    background: linear-gradient(135deg, #ffb74d, #ff9d50);
}

.cta-button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 10px rgba(255, 167, 38, 0.4);
}

/* Animaciones */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ================================================
    HEADER Y NAVEGACIÓN
   ================================================ */

.header {
    background: linear-gradient(135deg, #1a365d, #2c5282);
    padding: 0.8rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.logo-text {
    color: #ffa726;
    background: linear-gradient(45deg, #ffa726, #ff8c42, #ff6b35);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 1px 2px rgba(255, 167, 38, 0.5));
    transition: all 0.3s ease;
}

.logo-subtitle {
    font-size: 0.6rem;
    color: white;
    opacity: 0.9;
    font-weight: normal;
    margin-top: -2px;
    margin-left: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.logo-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.3s ease;
}

.logo-link:hover {
    transform: scale(1.05);
    filter: brightness(1.2) drop-shadow(0 2px 8px rgba(255, 140, 66, 0.7));
}

.logo-link:hover .logo-text {
    color: #ffb74d;
    filter: drop-shadow(0 0 8px rgba(255, 183, 77, 1.0)) brightness(1.5);
    text-shadow: 0 0 12px rgba(255, 167, 38, 0.9);
}

.logo-image {
    height: 80px;
    width: auto;
    max-width: 120px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    transition: color 0.3s;
    font-weight: 500;
    font-size: 0.9rem;
}

.nav-menu a:hover {
    color: #87ceeb;
}

.hamburger {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

/* ================================================
    SECCIÓN HERO
   ================================================ */

.hero {
    background: linear-gradient(135deg, rgba(26, 54, 93, 0.4), rgba(44, 82, 130, 0.4));
    min-height: 100vh;
    display: flex;
    align-items: center;
    text-align: center;
    color: white;
    position: relative;
    padding: 80px 0 0;
    overflow: hidden;
    width: 100%;
    margin: 0;
    border: none;
}

.hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(26, 54, 93, 0.3), rgba(44, 82, 130, 0.3));
    z-index: -1;
}

.hero-content {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    padding: 0 2rem;
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    margin-bottom: 1rem;
    margin-top: 2rem; /* ← Esta línea baja el título */
    animation: fadeInUp 1s ease-out;
    padding: 0 0.5rem;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
}

.hero-subtitle {
    font-size: clamp(1rem, 3vw, 1.3rem);
    margin-bottom: 2rem;
    opacity: 0.9;
    animation: fadeInUp 1s ease-out 0.3s both;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 0.5rem;
    text-shadow: 1px 1px 6px rgba(0, 0, 0, 0.6);
    line-height: 1.5;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1.5rem;
    margin: 3rem auto;
    animation: fadeInUp 1s ease-out 0.6s both;
    max-width: 600px;
    padding: 0 0.5rem;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: bold;
    color: #87ceeb;
    display: block;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.7);
}

.stat-label {
    font-size: clamp(0.8rem, 2vw, 0.9rem);
    opacity: 0.8;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.6);
}

.cta-button {
    background: linear-gradient(45deg, #ff6b35, #f7931e);
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    transition: transform 0.3s;
    text-decoration: none;
    display: inline-block;
    font-size: 1rem;
    margin: 0 0.5rem;
    /* Asegurar que el botón no se corte */
    position: relative;
    z-index: 10;
    white-space: nowrap;
    text-align: center;
    line-height: 1.2;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
    font-size: 1.5rem;
    z-index: 5; /* Menor que el botón CTA */
}

/* ================================================
   SECCIONES GENERALES
   ================================================ */

.section {
    padding: 4rem 0;
}

.benefits-section-wrapper {
    padding: 0.5rem 0 0.3rem 0;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

.section-title {
    text-align: center !important;
    font-size: clamp(2rem, 4vw, 2.5rem);
    margin-bottom: 2rem;
    color: #1a365d;
    padding: 0 0.5rem;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

/* ================================================
   SERVICIOS - DISEÑO JERÁRQUICO CORREGIDO
   ================================================ */

/* ================================================
   SECCIÓN SERVICIOS PRINCIPALES
   ================================================ */

.main-services-section {
    padding: 2.5rem 0 2rem 0;
    margin: 0;
    background: linear-gradient(45deg, #f8f9fa, #e9ecef);
    min-height: auto;
}

.main-services-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.services-title {
    text-align: center;
    font-size: clamp(2rem, 4vw, 2.5rem);
    margin-bottom: 2rem;
    color: #1a365d;
    font-weight: 600;
}

/* Servicios Principales */
.main-services {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 3rem;
    margin: 0 auto;
    max-width: 1400px;
    justify-items: stretch;
    place-items: stretch;
    align-items: center;
    height: 100%;
}



.main-service {
    background: white;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    text-align: center;
    overflow: hidden;
    position: relative;
    min-height: 550px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    width: 100%;
}

.main-service::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.7) 100%);
    z-index: 1;
    transition: background 0.3s ease;
}

.main-service:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0,0,0,0.2);
}

.main-service:hover::before {
    background: linear-gradient(180deg, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.8) 100%);
}

/* Efectos para dispositivos táctiles */
.main-service:active {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0,0,0,0.2);
}

.main-service:active::before {
    background: linear-gradient(180deg, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.8) 100%);
}

/* Estados de click para dispositivos móviles sin hover */
@media (hover: none) {
    .main-service.clicked {
        transform: translateY(-10px) scale(1.02);
        box-shadow: 0 25px 50px rgba(0,0,0,0.2);
    }

    .main-service.clicked::before {
        background: linear-gradient(180deg, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.8) 100%);
    }
}

.service-content {
    position: relative;
    z-index: 2;
    background: rgba(255, 255, 255, 0.95);
    padding: 1.5rem;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    margin: 0;
}

.main-service h3 {
    margin-bottom: 1rem;
    color: #1a365d;
    font-size: 1.5rem;
    font-weight: bold;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.main-service p {
    font-size: 1rem;
    line-height: 1.6;
    color: #444;
    text-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* ================================================
   BENEFICIOS SECTION - CORREGIDO
   ================================================ */

.benefits-section {
    margin: 0;
    padding: 3rem 2rem 1rem;
    background: transparent;
    border: none;
}

.benefits-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    justify-items: center;
}

.benefit-item {
    background: transparent;
    padding: 1.5rem 1rem;
    border-radius: 0;
    text-align: center;
    box-shadow: none;
    border: none;
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
    width: 100%;
    max-width: 350px;
    min-height: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.benefit-item:hover {
    transform: translateY(-5px);
    box-shadow: none;
    border-color: transparent;
}

/* Efectos para dispositivos táctiles */
.benefit-item:active {
    transform: translateY(-5px);
    box-shadow: none;
    border-color: transparent;
}

.benefit-icon {
    width: 80px;
    height: 80px;
    background: transparent;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: #333;
    box-shadow: none;
    transition: all 0.4s ease;
    position: relative;
    z-index: 1;
}

.benefit-item:hover .benefit-icon {
    transform: scale(1.1);
    box-shadow: none;
}

/* Efectos para dispositivos táctiles */
.benefit-item:active .benefit-icon {
    transform: scale(1.1);
    box-shadow: none;
}

.benefit-svg {
    width: 32px;
    height: 32px;
    fill: currentColor;
}

.benefit-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: none;
    transition: all 0.4s ease;
    opacity: 0.8;
}

.benefit-item:hover .benefit-image {
    filter: none;
    transform: scale(1.05);
    opacity: 1;
}

.benefit-item h4 {
    color: #1a365d;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
    transition: color 0.3s ease;
    text-align: center;
    line-height: 1.3;
}

.benefit-item:hover h4 {
    color: #2c5282;
}

/* Efectos para dispositivos táctiles */
.benefit-item:active h4 {
    color: #1a365d;
}

/* Estados de click para dispositivos móviles sin hover */
@media (hover: none) {
    .benefit-item.clicked {
        transform: translateY(-8px);
        box-shadow: 0 15px 40px rgba(0,0,0,0.12);
        border-color: rgba(255, 167, 38, 0.2);
    }

    .benefit-item.clicked .benefit-icon {
        transform: scale(1.1) rotate(5deg);
        box-shadow: 0 12px 35px rgba(102, 126, 234, 0.35);
    }

    .benefit-item.clicked h4 {
        color: #1a365d;
    }
}

.benefit-item p {
    color: #4a5568;
    font-size: 1rem;
    line-height: 1.6;
    position: relative;
    z-index: 1;
    max-width: 280px;
    margin: 0 auto;
    text-align: center;
}

.benefit-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* Título de beneficios - CORREGIDO */
.benefits-title {
    text-align: center !important;
    font-size: 1.5rem;
    color: #1a365d;
    margin: 1.5rem 0 1rem;
    opacity: 0.8;
    font-weight: 600;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

/* ================================================
   SECCIÓN SERVICIOS COMPLEMENTARIOS/SECUNDARIOS
   ================================================ */

.secondary-services-section {
    padding: 4rem 0;
    margin: 0;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    position: relative;
}

.secondary-services-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 1;
    border: none;
    outline: none;
}

.secondary-services-title {
    color: #1a365d !important;
    margin-bottom: 3rem !important;
    text-align: center !important;
    width: 100% !important;
    font-size: 2.5rem !important;
    font-weight: 700 !important;
    margin-left: auto !important;
    margin-right: auto !important;
    position: relative;
}

.secondary-services-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(45deg, #2c5282, #87ceeb);
    border-radius: 2px;
}



/* Servicios Secundarios */
.secondary-services {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
    margin: 0 auto;
    max-width: 1400px;
    justify-items: center;
    padding: 0 1rem;
}

.secondary-service {
    background: white;
    padding: 2.5rem 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    transition: all 0.4s ease;
    text-align: center;
    width: 100%;
    max-width: 320px;
    min-height: 220px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(44, 82, 130, 0.1);
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease forwards;
}

.secondary-service:nth-child(1) { animation-delay: 0.1s; }
.secondary-service:nth-child(2) { animation-delay: 0.2s; }
.secondary-service:nth-child(3) { animation-delay: 0.3s; }
.secondary-service:nth-child(4) { animation-delay: 0.4s; }
.secondary-service:nth-child(5) { animation-delay: 0.5s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.secondary-service::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(44, 82, 130, 0.02) 0%, rgba(135, 206, 235, 0.02) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.secondary-service:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    border-color: rgba(44, 82, 130, 0.2);
}

.secondary-service:hover::before {
    opacity: 1;
}

/* Efectos para dispositivos táctiles */
.secondary-service:active {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.12);
}

/* Estados de click para dispositivos móviles sin hover */
@media (hover: none) {
    .secondary-service.clicked {
        transform: translateY(-5px);
        box-shadow: 0 12px 25px rgba(0,0,0,0.12);
    }
}

.secondary-service .service-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #2c5282 0%, #4299e1 50%, #87ceeb 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: white;
    font-size: 1.8rem;
    box-shadow: 0 8px 25px rgba(44, 82, 130, 0.3);
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
}

.secondary-service .service-icon::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.3), transparent);
    transform: rotate(45deg);
    transition: all 0.6s ease;
    opacity: 0;
}

.secondary-service:hover .service-icon::before {
    opacity: 1;
    top: -100%;
    left: -100%;
}

.secondary-service .service-icon-img {
    width: 45px;
    height: 45px;
    object-fit: contain;
    filter: brightness(0) invert(1);
    transition: all 0.3s ease;
    z-index: 1;
    position: relative;
}

.secondary-service:hover .service-icon {
    transform: rotate(5deg) scale(1.1);
    box-shadow: 0 12px 35px rgba(44, 82, 130, 0.4);
}

.secondary-service h4 {
    margin-bottom: 1rem;
    color: #1a365d;
    font-size: 1.2rem;
    font-weight: 700;
    position: relative;
    z-index: 1;
    transition: color 0.3s ease;
}

.secondary-service:hover h4 {
    color: #2c5282;
}

.secondary-service p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #4a5568;
    position: relative;
    z-index: 1;
    transition: color 0.3s ease;
}

.secondary-service:hover p {
    color: #2d3748;
}

/* Responsive Design para Servicios Complementarios */
@media (max-width: 768px) {
    .secondary-services-section {
        padding: 3rem 0;
        background: #f8fafc;
    }
    
    .secondary-services-container {
        padding: 0 1rem;
    }
    
    .secondary-services-title {
        font-size: 2rem !important;
        margin-bottom: 2rem !important;
    }
    
    .secondary-services {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.5rem;
        padding: 0;
    }
    
    .secondary-service {
        padding: 2rem 1.5rem;
        min-height: 200px;
        max-width: none;
    }
    
    .secondary-service .service-icon {
        width: 70px;
        height: 70px;
        margin-bottom: 1.2rem;
    }
    
    .secondary-service .service-icon-img {
        width: 40px;
        height: 40px;
    }
    
    .secondary-service h4 {
        font-size: 1.1rem;
    }
    
    .secondary-service p {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .secondary-services-section {
        padding: 2.5rem 0;
        background: #f8fafc;
        margin: 0;
        border: none;
        overflow: hidden;
    }
    
    .secondary-services-section::before,
    .secondary-services-section::after {
        display: none;
    }
    
    .secondary-services-container {
        padding: 0 1rem;
        border: none;
        outline: none;
    }
    
    .secondary-services {
        grid-template-columns: 1fr;
        gap: 1.2rem;
        border: none;
        outline: none;
    }
    
    .secondary-service {
        padding: 1.8rem 1.2rem;
        min-height: 180px;
        border-radius: 16px;
        margin: 0 auto;
        max-width: 300px;
        border: 1px solid rgba(44, 82, 130, 0.08);
    }
    
    .secondary-service .service-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 1rem;
    }
    
    .secondary-service .service-icon-img {
        width: 35px;
        height: 35px;
    }
    
    .secondary-service h4 {
        font-size: 1rem;
        margin-bottom: 0.8rem;
    }
    
    .secondary-service p {
        font-size: 0.85rem;
        line-height: 1.5;
    }
}

/* Mantener compatibilidad con el grid original */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin: 2rem auto 0;
    max-width: 1400px;
    justify-items: stretch;
}

.service-card {
    background: white;
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    text-align: center;
    width: 100%;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

/* Efectos para dispositivos táctiles */
.service-card:active {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.service-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(45deg, #2c5282, #87ceeb);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: white;
    font-size: 1.5rem;
}

.service-card h3 {
    margin-bottom: 0.8rem;
    color: #1a365d;
    font-size: 1.2rem;
}

.service-card p {
    font-size: 0.95rem;
    line-height: 1.5;
}

/* ================================================
   MEJORAS PARA DISPOSITIVOS TÁCTILES
   ================================================ */

/* Agregar feedback visual para todos los elementos interactivos */
.main-service,
.secondary-service,
.benefit-item,
.service-card,
.mission-vision-card {
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Estados de toque para móviles */
@media (max-width: 768px) {
    /* Estilos base para elementos interactivos en móvil */
    .main-service,
    .secondary-service,
    .benefit-item,
    .service-card,
    .mission-vision-card,
    .value-item {
        -webkit-tap-highlight-color: transparent;
        cursor: pointer;
        transition: all 0.3s ease;
    }

    /* Estados de click/touch para reemplazar hover */
    .main-service.clicked,
    .main-service:focus {
        transform: translateY(-5px) scale(1.01);
        box-shadow: 0 15px 30px rgba(0,0,0,0.15);
    }

    .main-service.clicked::before,
    .main-service:focus::before {
        background: linear-gradient(180deg, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.8) 100%);
    }

    .secondary-service.clicked,
    .secondary-service:focus {
        transform: translateY(-3px);
        box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    }

    .benefit-item.clicked,
    .benefit-item:focus {
        transform: translateY(-5px);
        box-shadow: 0 12px 30px rgba(0,0,0,0.1);
        border-color: rgba(255, 167, 38, 0.15);
    }

    .benefit-item.clicked .benefit-icon,
    .benefit-item:focus .benefit-icon {
        transform: scale(1.05) rotate(3deg);
    }

    .service-card.clicked,
    .service-card:focus {
        transform: translateY(-5px);
        box-shadow: 0 15px 30px rgba(0,0,0,0.12);
    }

    .value-item.clicked,
    .value-item:focus {
        transform: translateY(-5px);
        box-shadow: 0 10px 25px rgba(0,0,0,0.12);
    }

    /* Tarjetas de misión y visión con toggle */
    .mission-vision-card.clicked .mission-vision-content {
        justify-content: space-between !important;
        padding-top: 2rem !important;
        padding-bottom: 3rem !important;
    }
    
    .mission-vision-card.clicked .mission-vision-title {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        transform: none !important;
        margin-bottom: 2rem !important;
        text-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
        font-size: 1.8rem !important;
    }

    .mission-vision-card.clicked .mission-vision-content p {
        position: relative !important;
        bottom: auto !important;
        opacity: 1 !important;
        transform: translateY(0) !important;
        margin-top: auto !important;
    }

    .mission-vision-card.clicked::after {
        transform: translateY(-50%) !important;
        background-image: linear-gradient(
            to bottom,
            hsla(220, 55%, 20%, 0.2) 0%,
            hsla(220, 55%, 18%, 0.25) 11.7%,
            hsla(220, 55%, 16%, 0.3) 22.1%,
            hsla(220, 55%, 14%, 0.35) 31.2%,
            hsla(220, 55%, 12%, 0.4) 39.4%,
            hsla(220, 55%, 10%, 0.45) 46.6%,
            hsla(220, 55%, 8%, 0.5) 53.1%,
            hsla(220, 55%, 6%, 0.55) 58.9%,
            hsla(220, 55%, 4%, 0.6) 64.3%,
            hsla(200, 45%, 15%, 0.65) 69.3%,
            hsla(200, 45%, 12%, 0.7) 74.1%,
            hsla(200, 45%, 10%, 0.75) 78.8%,
            hsla(200, 45%, 8%, 0.8) 83.6%,
            hsla(200, 45%, 6%, 0.82) 88.7%,
            hsla(200, 45%, 4%, 0.85) 94.1%,
            hsla(200, 45%, 2%, 0.9) 100%
        ) !important;
    }
}

/* ================================================
   SECCIÓN SOBRE NOSOTROS - CORREGIDA
   ================================================ */

.about-section {
    background: linear-gradient(45deg, #f8f9fa, #e9ecef);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: start;
}

.about-text {
    font-size: 1rem;
    line-height: 1.8;
    text-align: justify;
}

.about-text p {
    margin-bottom: 1rem;
    text-align: justify;
}

/* Título "Nuestros Valores" - CORREGIDO */
.about-content > div:last-child h3,
.services-subtitle {
    color: #1a365d !important;
    margin-bottom: 1.5rem !important;
    text-align: center !important;
    width: 100% !important;
    font-size: 2rem !important;
    font-weight: 700 !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.values-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 1.5rem;
    text-align: center;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    justify-content: center;
    align-items: center;
}

.value-item {
    background: white;
    padding: 1.2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    width: 100%;
    max-width: 320px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.value-item h4 {
    color: #1a365d;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.value-item p {
    font-size: 0.9rem;
}

/* Efectos de hover para value-items */
.value-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.12);
}

/* Efectos para dispositivos táctiles */
.value-item:active {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.12);
}

/* Estados de click para dispositivos móviles sin hover */
@media (hover: none) {
    .value-item.clicked {
        transform: translateY(-5px);
        box-shadow: 0 10px 25px rgba(0,0,0,0.12);
    }
}

/* ================================================
   MISIÓN Y VISIÓN - TARJETAS MODERNAS (MISMO EFECTO QUE SERVICIOS PRINCIPALES)
   ================================================ */

.mission-vision-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2.5rem;
    margin-top: 2rem;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.mission-vision-card {
    position: relative;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    padding: 1rem;
    width: 100%;
    max-width: 450px;
    text-align: center;
    color: white;
    background-color: #f5f5f5;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    border-radius: 20px;
    transition: transform 0.4s ease;
    height: 500px;
}

.mission-vision-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 110%;
    background-size: cover;
    background-position: center;
    transition: transform calc(700ms * 1.5) cubic-bezier(0.19, 1, 0.22, 1);
    pointer-events: none;
    border-radius: 20px;
    z-index: 1;
}

.mission-vision-card:first-child::before {
    background-image: url('img/mision.webp');
}

.mission-vision-card:last-child::before {
    background-image: url('img/vision.webp');
}

.mission-vision-card::after {
    content: '';
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 200%;
    pointer-events: none;
    background-image: linear-gradient(
        to bottom,
        hsla(220, 55%, 20%, 0.1) 0%,
        hsla(220, 55%, 18%, 0.15) 11.7%,
        hsla(220, 55%, 16%, 0.2) 22.1%,
        hsla(220, 55%, 14%, 0.25) 31.2%,
        hsla(220, 55%, 12%, 0.3) 39.4%,
        hsla(220, 55%, 10%, 0.35) 46.6%,
        hsla(220, 55%, 8%, 0.4) 53.1%,
        hsla(220, 55%, 6%, 0.45) 58.9%,
        hsla(220, 55%, 4%, 0.5) 64.3%,
        hsla(200, 45%, 15%, 0.55) 69.3%,
        hsla(200, 45%, 12%, 0.6) 74.1%,
        hsla(200, 45%, 10%, 0.65) 78.8%,
        hsla(200, 45%, 8%, 0.7) 83.6%,
        hsla(200, 45%, 6%, 0.72) 88.7%,
        hsla(200, 45%, 4%, 0.75) 94.1%,
        hsla(200, 45%, 2%, 0.8) 100%
    );
    transform: translateY(-50%);
    transition: transform calc(700ms * 2) cubic-bezier(0.19, 1, 0.22, 1);
    border-radius: 20px;
    z-index: 2;
}

.mission-vision-image {
    display: none;
}

.mission-vision-img {
    display: none;
}

.mission-vision-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 2rem;
    transition: all 700ms cubic-bezier(0.19, 1, 0.22, 1);
    z-index: 3;
    height: 100%;
}

.mission-vision-title {
    font-size: 2rem;
    font-weight: bold;
    line-height: 1.2;
    color: white !important;
    margin-bottom: 0;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.9);
    transition: all 0.4s ease;
    text-align: center;
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    width: 100%;
    z-index: 4;
}

.mission-vision-content p {
    font-size: 1rem;
    line-height: 1.6;
    color: white;
    text-align: center;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
    margin: 0;
    padding: 0 1rem;
    position: absolute;
    bottom: 2rem;
    left: 0;
    right: 0;
    opacity: 0;
    transform: translateY(2rem);
    transition:
        transform 700ms cubic-bezier(0.19, 1, 0.22, 1),
        opacity 700ms cubic-bezier(0.19, 1, 0.22, 1);
}

/* Efectos de hover para desktop y dispositivos táctiles */
@media (min-width: 600px) {
    .mission-vision-card::after {
        transform: translateY(0);
    }

    .mission-vision-content {
        transform: translateY(0);
        align-items: center;
        justify-content: center;
    }

    .mission-vision-title {
        margin-bottom: 0;
    }

    .mission-vision-content p {
        opacity: 0;
        transform: translateY(2rem);
        transition:
            transform 700ms cubic-bezier(0.19, 1, 0.22, 1),
            opacity 700ms cubic-bezier(0.19, 1, 0.22, 1);
        margin-top: 0;
    }

    /* Efectos para dispositivos con hover */
    @media (hover: hover) {
        .mission-vision-card:hover,
        .mission-vision-card:focus-within {
            align-items: center;
            transform: translateY(-8px) scale(1.02);
            box-shadow: 0 20px 40px rgba(0,0,0,0.15);
        }

        .mission-vision-card:hover::before,
        .mission-vision-card:focus-within::before { 
            transform: translateY(-4%);
        }

        .mission-vision-card:hover::after,
        .mission-vision-card:focus-within::after { 
            transform: translateY(-50%);
            background-image: linear-gradient(
                to bottom,
                hsla(220, 55%, 20%, 0.3) 0%,
                hsla(220, 55%, 18%, 0.35) 11.7%,
                hsla(220, 55%, 16%, 0.4) 22.1%,
                hsla(220, 55%, 14%, 0.45) 31.2%,
                hsla(220, 55%, 12%, 0.5) 39.4%,
                hsla(220, 55%, 10%, 0.55) 46.6%,
                hsla(220, 55%, 8%, 0.6) 53.1%,
                hsla(220, 55%, 6%, 0.65) 58.9%,
                hsla(220, 55%, 4%, 0.7) 64.3%,
                hsla(200, 45%, 15%, 0.75) 69.3%,
                hsla(200, 45%, 12%, 0.8) 74.1%,
                hsla(200, 45%, 10%, 0.85) 78.8%,
                hsla(200, 45%, 8%, 0.9) 83.6%,
                hsla(200, 45%, 6%, 0.92) 88.7%,
                hsla(200, 45%, 4%, 0.95) 94.1%,
                hsla(200, 45%, 2%, 0.98) 100%
            );
        }

        .mission-vision-card:hover .mission-vision-content,
        .mission-vision-card:focus-within .mission-vision-content {
            justify-content: space-between;
            padding-top: 2rem;
            padding-bottom: 3rem;
        }

        .mission-vision-card:hover .mission-vision-title,
        .mission-vision-card:focus-within .mission-vision-title {
            position: relative;
            top: auto;
            left: auto;
            right: auto;
            transform: none;
            margin-bottom: 2rem;
            font-size: 1.8rem;
        }

        .mission-vision-card:hover .mission-vision-content p,
        .mission-vision-card:focus-within .mission-vision-content p {
            position: relative;
            bottom: auto;
            opacity: 1;
            transform: translateY(0);
            transition-delay: calc(700ms / 8);
            margin-top: auto;
        }

        .mission-vision-card:hover .mission-vision-title {
            text-shadow: 0 0 15px rgba(255, 255, 255, 0.8);
            transform: scale(1.05);
        }

        .mission-vision-card:focus-within::before,
        .mission-vision-card:focus-within::after,
        .mission-vision-card:focus-within .mission-vision-content,
        .mission-vision-card:focus-within .mission-vision-content p {
            transition-duration: 0s;
        }
    }

    /* Efectos para dispositivos táctiles sin hover */
    @media (hover: none) {
        .mission-vision-card {
            -webkit-tap-highlight-color: transparent;
            cursor: pointer;
        }

        /* Estados de click/touch en lugar de hover */
        .mission-vision-card.clicked,
        .mission-vision-card:focus {
            align-items: center;
            transform: translateY(-8px) scale(1.02);
            box-shadow: 0 20px 40px rgba(0,0,0,0.15);
        }

        .mission-vision-card.clicked::before,
        .mission-vision-card:focus::before { 
            transform: translateY(-4%);
        }

        .mission-vision-card.clicked::after,
        .mission-vision-card:focus::after { 
            transform: translateY(-50%);
            background-image: linear-gradient(
                to bottom,
                hsla(220, 55%, 20%, 0.3) 0%,
                hsla(220, 55%, 18%, 0.35) 11.7%,
                hsla(220, 55%, 16%, 0.4) 22.1%,
                hsla(220, 55%, 14%, 0.45) 31.2%,
                hsla(220, 55%, 12%, 0.5) 39.4%,
                hsla(220, 55%, 10%, 0.55) 46.6%,
                hsla(220, 55%, 8%, 0.6) 53.1%,
                hsla(220, 55%, 6%, 0.65) 58.9%,
                hsla(220, 55%, 4%, 0.7) 64.3%,
                hsla(200, 45%, 15%, 0.75) 69.3%,
                hsla(200, 45%, 12%, 0.8) 74.1%,
                hsla(200, 45%, 10%, 0.85) 78.8%,
                hsla(200, 45%, 8%, 0.9) 83.6%,
                hsla(200, 45%, 6%, 0.92) 88.7%,
                hsla(200, 45%, 4%, 0.95) 94.1%,
                hsla(200, 45%, 2%, 0.98) 100%
            );
        }

        .mission-vision-card.clicked .mission-vision-content,
        .mission-vision-card:focus .mission-vision-content {
            justify-content: space-between;
            padding-top: 2rem;
            padding-bottom: 3rem;
        }

        .mission-vision-card.clicked .mission-vision-title,
        .mission-vision-card:focus .mission-vision-title {
            position: relative;
            top: auto;
            left: auto;
            right: auto;
            transform: none;
            margin-bottom: 2rem;
            font-size: 1.8rem;
        }

        .mission-vision-card.clicked .mission-vision-content p,
        .mission-vision-card:focus .mission-vision-content p {
            position: relative;
            bottom: auto;
            opacity: 1;
            transform: translateY(0);
            transition-delay: calc(700ms / 8);
            margin-top: auto;
        }

        .mission-vision-card.clicked .mission-vision-title {
            text-shadow: 0 0 15px rgba(255, 255, 255, 0.8);
            transform: scale(1.05);
        }
    }
}

/* ================================================
   GALLERY MODAL
   ================================================ */

:root {
    --gallery-width: min(1400px, 90vw);
}

.gallery-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
}

.gallery-modal-content {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
}

.gallery-header {
    background: linear-gradient(135deg, rgba(26, 54, 93, 0.9), rgba(44, 82, 130, 0.9));
    color: white;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(10px);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1001;
}

.gallery-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.gallery-close {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.gallery-close:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

#gallery-app {
    height: 100vh;
    display: grid;
    place-items: center;
    background: transparent;
    padding: 6rem 2rem 2rem;
    position: relative;
}

.gallery {
    width: var(--gallery-width);
    list-style-type: none;
    display: grid;
    margin: 0;
    padding: 0;
}

.gallery li {
    position: relative;
    grid-column: 1;
    grid-row: 1;
    width: calc(var(--gallery-width) / 5);
    aspect-ratio: 1;
    cursor: pointer;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: translate 0.8s ease, scale 0.8s ease;
    will-change: transform;
    border-radius: 10px;
    overflow: hidden;
}

.gallery li::after {
    content: '';
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
    transition: background-color 0.3s ease;
}

.gallery li[data-pos='0'] { 
    scale: 1; 
    z-index: 1; 
}

.gallery li[data-pos='1'] { 
    scale: 1.4; 
    z-index: 5; 
}

.gallery li[data-pos='2'] { 
    scale: 1.8; 
    z-index: 10; 
}

.gallery li[data-pos='3'] { 
    scale: 1.4;  
    z-index: 5; 
}

.gallery li[data-pos='4'] { 
    scale: 1; 
    z-index: 1; 
}

.gallery li[data-pos='1']::after { 
    background-color: rgba(0, 0, 0, 0.4); 
}

.gallery li[data-pos='2']::after { 
    background-color: transparent; 
}

.gallery li[data-pos='3']::after { 
    background-color: rgba(0, 0, 0, 0.4); 
}

/* Mobile Gallery Styles */
.mobile-gallery {
    display: none;
    height: 100vh;
    position: relative;
    padding-top: 80px;
    background: black;
}

.mobile-gallery-container {
    width: 100%;
    height: calc(100vh - 140px);
    overflow-x: auto;
    overflow-y: hidden;
    display: flex;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.mobile-gallery-container::-webkit-scrollbar {
    display: none;
}

.mobile-gallery-slide {
    min-width: 100%;
    width: 100%;
    height: 100%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mobile-gallery-indicators {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 1002;
    background: rgba(0, 0, 0, 0.5);
    padding: 10px 20px;
    border-radius: 25px;
    backdrop-filter: blur(10px);
}

.mobile-gallery-indicators .indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.mobile-gallery-indicators .indicator.active {
    background-color: white;
    transform: scale(1.2);
}

/* Desktop gallery default styles */
.desktop-gallery {
    height: 100vh;
    display: grid;
    place-items: center;
    background: transparent;
    padding: 6rem 2rem 2rem;
    position: relative;
}

/* Mobile gallery styles */
@media (max-width: 768px) {
    .desktop-gallery {
        display: none !important;
    }

    .mobile-gallery {
        display: block !important;
    }

    .gallery-header {
        padding: 1rem 1.5rem;
        background: rgba(26, 54, 93, 0.95);
        backdrop-filter: blur(15px);
    }

    .gallery-header h3 {
        font-size: 1.2rem;
    }

    .mobile-gallery {
        padding-top: 70px;
    }

    .mobile-gallery-container {
        height: calc(100vh - 130px);
    }
}

@media (max-width: 480px) {
    .gallery-header {
        padding: 0.8rem 1rem;
    }

    .gallery-header h3 {
        font-size: 1.1rem;
    }

    .mobile-gallery {
        padding-top: 65px;
    }

    .mobile-gallery-container {
        height: calc(100vh - 125px);
    }

    .mobile-gallery-indicators {
        bottom: 20px;
        gap: 10px;
        padding: 8px 16px;
    }

    .mobile-gallery-indicators .indicator {
        width: 8px;
        height: 8px;
    }
}

/* ================================================
   PROYECTOS
   ================================================ */

.projects-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    margin-top: 2rem;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.project-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    transition: transform 0.3s;
    width: 100%;
    max-width: 350px;
    flex: 0 1 350px;
    min-height: 450px;
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: scale(1.02);
}

.project-image {
    height: 250px;
    background: linear-gradient(45deg, #2c5282, #87ceeb);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2.5rem;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.project-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.project-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(26, 54, 93, 0.1), rgba(44, 82, 130, 0.1));
    transition: opacity 0.3s ease;
}

.project-card:hover .project-img {
    transform: scale(1.05);
}

.project-card:hover .project-image::after {
    opacity: 0.3;
}

.project-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.project-content h3 {
    margin-bottom: 1rem;
    color: #1a365d;
    font-size: 1.2rem;
    font-weight: 600;
}

.project-content p {
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* ================================================
   CALCULADORA - CORREGIDA
   ================================================ */

.calculator {
    background: linear-gradient(135deg, rgba(26, 54, 93, 0.8), rgba(44, 82, 130, 0.8));
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
    min-height: 90vh;
    padding: 6rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calculator-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
}

.calculator-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(26, 54, 93, 0.6), rgba(44, 82, 130, 0.6));
    z-index: -1;
}

.calculator .container {
    position: relative;
    z-index: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
    padding: 2rem;
}

.calculator-form {
    background: rgba(255,255,255,0.1);
    padding: 1.5rem;
    border-radius: 15px;
    max-width: 500px;
    margin: 1rem auto 0;
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 1;
}

.input-group {
    margin-bottom: 0.8rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    font-size: 0.95rem;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 0.7rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    box-sizing: border-box;
}

.tarifa-display {
    background: rgba(255,255,255,0.9);
    padding: 0.7rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: bold;
    color: #1a365d;
    text-align: center;
    border: 2px solid rgba(255, 167, 38, 0.3);
}

.logo-calculator-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    padding: 1rem 0;
}

.logo-calculator-image {
    height: 50px;
    width: auto;
    max-width: 80px;
    object-fit: contain;
}

.logo-calculator-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.logo-calculator-text {
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.logo-calculator-subtitle {
    font-size: 0.7rem;
    color: white;
    opacity: 0.9;
    font-weight: normal;
    margin-top: -2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.calculate-btn {
    background: linear-gradient(45deg, #ff6b35, #f7931e);
    color: white;
    padding: 0.9rem 2rem;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    margin-top: 0.8rem;
    transition: transform 0.3s;
    width: 100%;
}

.calculate-btn:hover {
    transform: scale(1.02);
}

.result {
    margin-top: 1rem;
    padding: 0.8rem;
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
    font-size: 1rem;
    display: none;
}

/* Radio buttons styles */
.radio-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 0.3rem;
    justify-content: center;
}

.radio-option {
    display: flex;
    align-items: center;
    position: relative;
}

.radio-option input[type="radio"] {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    margin-right: 0.6rem;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
}

.radio-option input[type="radio"]:checked {
    border-color: #ff6b35;
    background: rgba(255, 107, 53, 0.2);
}

.radio-option input[type="radio"]:checked::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff6b35;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
}

.radio-option input[type="radio"]:hover {
    border-color: #ff8c42;
    background: rgba(255, 140, 66, 0.1);
}

.radio-option label {
    color: white;
    font-weight: 500;
    cursor: pointer;
    font-size: 0.95rem;
    transition: color 0.3s ease;
    margin-bottom: 0;
}

.radio-option input[type="radio"]:checked + label {
    color: #ff8c42;
}

.radio-option:hover label {
    color: #ff8c42;
}

/* ================================================
   CONTACTO - CORREGIDO
   ================================================ */

.contact {
    background: #f8f9fa;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

.contact .container {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
    padding: 4rem 2rem;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: stretch;
    max-width: 1000px;
    margin: 2rem auto 0;
    height: auto;
}

.contact-info,
.contact-form-container {
    background: white;
    padding: 2.5rem 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    width: 100%;
    box-sizing: border-box;
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

.contact-info h3,
.contact-form-container h3 {
    color: #1a365d;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    text-align: center;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    padding: 0.5rem 0;
}

.contact-icon {
    width: 45px;
    height: 45px;
    background: linear-gradient(45deg, #2c5282, #87ceeb);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin-right: 1.2rem;
    flex-shrink: 0;
    font-size: 1.1rem;
}

.form-row {
    margin-bottom: 1.2rem;
}

.form-row input,
.form-row select,
.form-row textarea {
    width: 100%;
    padding: 0.9rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 0.95rem;
    box-sizing: border-box;
    max-width: 100%;
}

.form-row textarea {
    min-height: 100px;
    resize: vertical;
}

/* Estilos para el campo de archivo */
.file-label {
    display: block;
    width: 100%;
    padding: 0.9rem;
    border: 2px dashed #ddd;
    border-radius: 8px;
    background: #f8f9fa;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.file-label:hover {
    border-color: #2c5282;
    background: #e3f2fd;
}

.file-label-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: #2c5282;
    margin-bottom: 0.5rem;
}

.cfe-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
    filter: brightness(0.8);
}

.file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.file-selected {
    display: block;
    font-size: 0.85rem;
    color: #666;
    font-style: italic;
}

.file-label.has-file {
    border-color: #4caf50;
    background: #e8f5e8;
}

.file-label.has-file .file-label-text {
    color: #2e7d32;
}

.file-label.has-file .file-selected {
    color: #2e7d32;
    font-weight: 500;
}

/* Responsive para logo CFE */
@media (max-width: 768px) {
    .cfe-logo {
        width: 20px;
        height: 20px;
    }
    
    .file-label-text {
        gap: 0.3rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .cfe-logo {
        width: 18px;
        height: 18px;
    }
    
    .file-label-text {
        gap: 0.25rem;
        font-size: 0.85rem;
    }
}

/* ================================================
   FOOTER - MEJORADO
   ================================================ */

.footer {
    background: #1a365d;
    color: white;
    text-align: center;
    padding: 2rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 1.5rem;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.footer-section h3 {
    margin-bottom: 0.8rem;
    color: #87ceeb;
    font-size: 1.1rem;
}

.footer-section p,
.footer-section ul {
    font-size: 0.9rem;
    line-height: 1.6;
}

.footer-section ul {
    list-style: none;
    text-align: left;
}

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.2);
    padding-top: 1rem;
    font-size: 0.8rem;
    opacity: 0.8;
}

/* Redes Sociales en Footer */
.social-links {
    margin-top: 1.5rem;
}

.social-links h4 {
    color: #87ceeb;
    font-size: 1rem;
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.social-icons {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: center;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: all 0.3s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.social-icon:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.social-icon.facebook {
    background: linear-gradient(135deg, #4267B2, #365899);
    color: white;
}

.social-icon.facebook:hover {
    background: linear-gradient(135deg, #365899, #2d4373);
    box-shadow: 0 8px 20px rgba(66, 103, 178, 0.4);
}

.social-icon.instagram {
    background: linear-gradient(135deg, #833ab4, #fd1d1d, #fcb045);
    color: white;
}

.social-icon.instagram:hover {
    background: linear-gradient(135deg, #6a2c93, #e1306c, #f77737);
    box-shadow: 0 8px 20px rgba(131, 58, 180, 0.4);
}

.social-icon.linkedin {
    background: linear-gradient(135deg, #0077b5, #005885);
    color: white;
}

.social-icon.linkedin:hover {
    background: linear-gradient(135deg, #005885, #004466);
    box-shadow: 0 8px 20px rgba(0, 119, 181, 0.4);
}

.social-svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* WhatsApp Float Button */
.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #25d366, #128c7e);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    z-index: 1000;
    transition: all 0.3s ease;
    text-decoration: none;
    animation: whatsappPulse 2s infinite;
}

.whatsapp-float::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: linear-gradient(135deg, #25d366, #128c7e);
    border-radius: 50%;
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(37, 211, 102, 0.6);
}

.whatsapp-float:hover::before {
    opacity: 0.3;
    animation: ripple 0.6s linear;
}

.whatsapp-icon {
    width: 32px;
    height: 32px;
    fill: white;
}

@keyframes whatsappPulse {
    0% {
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    }
    50% {
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.6), 0 0 0 10px rgba(37, 211, 102, 0.1);
    }
    100% {
        box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
    }
}

@keyframes ripple {
    0% {
        transform: scale(1);
        opacity: 0.3;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* ================================================
   TABLET OPTIMIZATIONS - PANTALLAS INTERMEDIAS
   ================================================ */

/* Media query específica para tablets en orientación portrait */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    /* Servicios secundarios - optimizar para tablet portrait */
    .secondary-services {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.5rem !important;
        justify-items: center !important;
    }
    
    .secondary-service .service-icon {
        width: 60px !important;
        height: 60px !important;
        border-radius: 50% !important;
        aspect-ratio: 1 !important;
    }
    
    /* Misión y visión - stack vertical en tablet portrait */
    .mission-vision-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 2rem !important;
        align-items: center !important;
        padding: 0 2rem !important;
    }
    
    .mission-vision-card {
        max-width: 80% !important;
        width: 80% !important;
        min-width: auto !important;
        height: 400px !important;
    }
}

/* Media query específica para el rango problemático 769px-1338px */
@media (min-width: 769px) and (max-width: 1338px) {
    /* CORRECCIÓN HERO - Eliminar línea a la izquierda */
    .hero {
        width: 100vw !important;
        margin: 0 !important;
        padding: 80px 0 0 !important;
        position: relative !important;
        overflow: hidden !important;
        border: none !important;
        left: 0 !important;
        right: 0 !important;
    }
    
    .hero-video,
    .hero-overlay {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        border: none !important;
        margin: 0 !important;
    }
    
    .hero-content {
        position: relative !important;
        z-index: 2 !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto !important;
        padding: 0 2rem !important;
        box-sizing: border-box !important;
    }
    
    /* CORRECCIÓN SERVICIOS COMPLEMENTARIOS - Círculos de iconos */
    .secondary-service .service-icon {
        width: 60px !important;
        height: 60px !important;
        border-radius: 50% !important;
        background: linear-gradient(45deg, #2c5282, #87ceeb) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        margin: 0 auto 1rem auto !important;
        color: white !important;
        font-size: 1.5rem !important;
        box-shadow: 0 5px 15px rgba(44, 82, 130, 0.4) !important;
        flex-shrink: 0 !important;
        aspect-ratio: 1 !important;
    }
    
    .secondary-services {
        display: grid !important;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
        gap: 1.5rem !important;
        margin: 0.5rem auto 0 !important;
        max-width: 100% !important;
        justify-items: center !important;
        padding: 0 1rem !important;
    }
    
    .secondary-service {
        background: white !important;
        padding: 1.5rem !important;
        border-radius: 12px !important;
        box-shadow: 0 8px 20px rgba(0,0,0,0.08) !important;
        transition: transform 0.3s, box-shadow 0.3s !important;
        text-align: center !important;
        width: 100% !important;
        max-width: 280px !important;
        min-height: 180px !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: flex-start !important;
    }
    
    /* CORRECCIÓN MISIÓN Y VISIÓN - Diseño responsivo */
    .mission-vision-grid {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 2rem !important;
        margin-top: 2rem !important;
        max-width: 100% !important;
        margin-left: auto !important;
        margin-right: auto !important;
        padding: 0 1rem !important;
    }
    
    .mission-vision-card {
        position: relative !important;
        display: flex !important;
        align-items: flex-end !important;
        overflow: hidden !important;
        padding: 1rem !important;
        width: 100% !important;
        max-width: 400px !important;
        min-width: 300px !important;
        text-align: center !important;
        color: white !important;
        background-color: #f5f5f5 !important;
        box-shadow: 0 15px 35px rgba(0,0,0,0.1) !important;
        border-radius: 20px !important;
        transition: transform 0.4s ease !important;
        height: 450px !important;
        flex: 1 1 400px !important;
    }
    
    .mission-vision-content {
        position: relative !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
        padding: 2rem !important;
        transition: all 700ms cubic-bezier(0.19, 1, 0.22, 1) !important;
        z-index: 3 !important;
        height: 100% !important;
    }
    
    .mission-vision-title {
        font-size: 1.8rem !important;
        font-weight: bold !important;
        line-height: 1.2 !important;
        color: white !important;
        margin-bottom: 1rem !important;
        text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.9) !important;
        text-align: center !important;
        width: 100% !important;
        z-index: 4 !important;
    }
    
    .mission-vision-content p {
        font-size: 1rem !important;
        line-height: 1.6 !important;
        color: white !important;
        text-align: center !important;
        text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8) !important;
        margin: 0 !important;
        padding: 0 1rem !important;
        opacity: 1 !important;
        transform: translateY(0) !important;
    }
    
    /* Prevenir desbordamiento horizontal en pantallas medianas */
    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
        position: relative !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* Asegurar que todos los elementos incluyan padding en sus cálculos de ancho */
    * {
        box-sizing: border-box !important;
    }
    
    /* Contenedores principales - asegurar que no desborden */
    .container, 
    .nav-container,
    .main-services-container,
    .secondary-services-container,
    .benefits-container,
    .projects-grid,
    .values-grid,
    .footer-content,
    .main-services,
    .secondary-services,
    .page-content {
        max-width: 100% !important;
        width: 100% !important;
        margin-left: auto !important;
        margin-right: auto !important;
        overflow-x: hidden !important;
        padding-left: clamp(1rem, 2vw, 2rem) !important;
        padding-right: clamp(1rem, 2vw, 2rem) !important;
    }
    
    /* Ajustes específicos para mejorar el espaciado */
    .container {
        padding-left: 2rem !important;
        padding-right: 2rem !important;
    }
    
    .nav-container,
    .hero-content {
        padding-left: 2rem !important;
        padding-right: 2rem !important;
    }
    
    .main-services-section .page-content {
        padding-left: 0 !important;
        padding-right: 0 !important;
        max-width: 100% !important;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
        gap: 2rem !important;
    }
    
    /* Contenedor principal con overflow hidden para capturar todo */
    #inicio, #servicios, #nosotros, #proyectos, #calculadora, #contacto, .footer {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Asegurar que el contenido principal no desborde */
    main, section, header, footer, .section, .hero, .about-section, .benefits-section, .calculator, .contact {
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }
}

@media (min-width: 769px) and (max-width: 1399px) {
    /* Prevenir desbordamiento horizontal en pantallas medianas */
    body {
        overflow-x: hidden;
    }
    
    /* ANULAR TODOS LOS MAX-WIDTH LIMITANTES */
    .nav-container,
    .hero-content,
    .container,
    .main-services-container,
    .secondary-services-container,
    .benefits-container,
    .projects-grid,
    .values-grid,
    .mission-vision-grid,
    .footer-content,
    .main-services,
    .secondary-services {
        max-width: 100% !important;
    }

    /* Contenedores principales para tablets */
    .container {
        padding: 0 2rem;
        margin: 0 auto;
        width: 100%;
    }

    .nav-container {
        padding: 0 2rem;
        width: 100%;
    }

    .hero-content {
        padding: 0 2rem;
        width: 100%;
    }

    /* Hero section para tablets - CORREGIDA */
    .hero {
        min-height: 100vh;
        padding: 100px 0 0;
        width: 100vw !important;
        margin: 0 !important;
        position: relative !important;
        overflow: hidden !important;
        border: none !important;
        left: 0 !important;
        right: 0 !important;
    }

    .hero-stats {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.5rem;
        max-width: 600px;
        margin: 2.5rem auto;
    }

    /* Servicios principales en tablets */
    .main-services-section {
        padding: 3rem 0;
        width: 100%;
    }

    .main-services-container {
        padding: 0 2rem;
        width: 100%;
    }

    /* Page content para nuevas tarjetas */
    .main-services-section .page-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
        padding: 0;
        width: 100%;
        margin: 0;
    }

    .main-services-section .card {
        height: 420px;
        width: 100%;
    }

    /* Servicios secundarios en tablets - CORREGIDA */
    .secondary-services-section {
        padding: 3rem 0;
        width: 100%;
    }

    .secondary-services-container {
        padding: 0 2rem;
        width: 100%;
    }

    .secondary-services {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1.5rem;
        width: 100%;
        margin: 0;
        justify-items: center;
    }

    .secondary-service {
        width: 100%;
        max-width: 280px;
    }

    /* Asegurar iconos circulares */
    .secondary-service .service-icon {
        width: 60px !important;
        height: 60px !important;
        border-radius: 50% !important;
        aspect-ratio: 1 !important;
        flex-shrink: 0 !important;
    }

    /* Beneficios en tablets */
    .benefits-section {
        padding: 3rem 2rem 1rem;
        width: 100%;
    }

    .benefits-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
        width: 100%;
        margin: 0 auto;
    }

    .benefit-item {
        width: 100%;
        max-width: none;
        min-height: 300px;
    }

    /* Sobre nosotros en tablets */
    .about-content {
        gap: 3rem;
    }

    .values-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.5rem;
        width: 100%;
        margin: 0 auto;
    }

    .value-item {
        width: 100%;
        max-width: none;
    }

    /* Misión y visión - CORREGIDA */
    .mission-vision-grid {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 2rem;
        width: 100%;
        margin: 0 auto;
        padding: 0 1rem;
    }

    .mission-vision-card {
        max-width: 400px;
        min-width: 300px;
        width: 100%;
        height: 450px;
        flex: 1 1 400px;
    }

    /* Proyectos en tablets */
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
        width: 100%;
        margin: 0 auto;
    }

    .project-card {
        width: 100%;
        max-width: none;
    }

    /* Calculadora en tablets */
    .calculator .container {
        padding: 2rem;
        width: 100%;
    }

    .calculator-form {
        max-width: 500px;
        margin: 0 auto;
    }

    /* Contacto en tablets */
    .contact .container {
        padding: 4rem 2rem;
        width: 100%;
    }

    .contact-grid {
        gap: 2rem;
        width: 100%;
        margin: 0 auto;
    }

    .contact-info,
    .contact-form-container {
        width: 100%;
    }

    /* Footer en tablets */
    .footer-content {
        gap: 2rem;
        grid-template-columns: repeat(2, 1fr);
        width: 100%;
        margin: 0 auto;
    }
}

/* ================================================
   PANTALLAS MEDIANAS - OPTIMIZACIONES ADICIONALES
   ================================================ */

@media (min-width: 1024px) and (max-width: 1599px) {
    /* Asegurar que contenedores usen ancho completo */
    .nav-container,
    .hero-content,
    .container,
    .main-services-container,
    .secondary-services-container,
    .benefits-container,
    .projects-grid,
    .values-grid,
    .mission-vision-grid,
    .footer-content,
    .main-services,
    .secondary-services {
        max-width: 100% !important;
        width: 100% !important;
    }

    .container {
        padding: 0 3rem;
    }

    .nav-container {
        padding: 0 3rem;
    }

    .hero-content {
        padding: 0 3rem;
    }

    .main-services-container {
        padding: 0 3rem;
    }

    .secondary-services-container {
        padding: 0 3rem;
    }

    .main-services {
        grid-template-columns: repeat(3, 1fr);
        gap: 2.5rem;
        margin: 0;
    }

    .secondary-services {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 2rem;
        margin: 0;
        justify-items: center;
    }

    /* Asegurar iconos circulares */
    .secondary-service .service-icon {
        width: 60px !important;
        height: 60px !important;
        border-radius: 50% !important;
        aspect-ratio: 1 !important;
    }

    .benefits-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
        margin: 0 auto;
    }

    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
        margin: 0 auto;
    }

    .values-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 2rem;
        margin: 0 auto;
    }

    /* Misión y visión corregida */
    .mission-vision-grid {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 3rem;
        margin: 0 auto;
        padding: 0 2rem;
    }

    .mission-vision-card {
        max-width: 45%;
        min-width: 350px;
        flex: 1 1 400px;
    }

    .contact .container {
        padding: 4rem 3rem;
    }

    .calculator .container {
        padding: 2rem 3rem;
    }
}

/* ================================================
   MOBILE OPTIMIZATIONS - CORREGIDAS Y MEJORADAS
   ================================================ */

/* ================================================
   DESKTOP LARGE SCREEN OPTIMIZATIONS
   ================================================ */

@media (min-width: 1600px) {
    .container {
        max-width: 1600px;
        padding: 0 3rem;
    }

    .nav-container {
        max-width: 1600px;
        padding: 0 3rem;
    }

    .hero-content {
        max-width: 1600px;
        padding: 0 3rem;
    }

    .main-services-container {
        max-width: 1600px;
        padding: 0 3rem;
    }

    .main-services-section {
        padding: 2.5rem 0 2rem 0;
    }

    .secondary-services-section {
        padding: 4rem 0 0;
    }

    .about-section {
        padding: 4rem 0;
    }

    .secondary-services-container {
        max-width: 1600px;
        padding: 0 3rem;
    }

    .main-services {
        grid-template-columns: repeat(3, 1fr);
        max-width: 1600px;
        gap: 3rem;
        justify-items: center;
        place-items: center;
    }

    .secondary-services {
        grid-template-columns: repeat(5, 1fr);
        max-width: 1600px;
        gap: 2rem;
    }

    .projects-grid {
        max-width: 1600px;
        gap: 2.5rem;
    }

    .benefits-container {
        max-width: 1600px;
        gap: 1.5rem;
    }

    .values-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        max-width: 1600px;
        gap: 2rem;
    }

    .mission-vision-grid {
        max-width: 1600px;
        gap: 3rem;
    }

    .contact-grid {
        max-width: 1200px;
        gap: 3rem;
    }

    .contact-info,
    .contact-form-container {
        padding: 2.5rem 2rem;
        min-height: 450px;
    }

    .calculator-form {
        max-width: 600px;
        padding: 2.5rem;
        margin: 0 auto;
    }

    .footer-content {
        max-width: 1600px;
        gap: 3rem;
    }
}

@media (min-width: 1920px) {
    .container {
        max-width: 1800px;
        padding: 0 4rem;
    }

    .nav-container {
        max-width: 1800px;
        padding: 0 4rem;
    }

    .hero-content {
        max-width: 1800px;
        padding: 0 4rem;
    }

    .section {
        padding: 0 0 5rem 0;
    }

    .main-services-container {
        max-width: 1800px;
        padding: 0 4rem;
    }

    .main-services-section {
        padding: 2.5rem 0 2rem 0;
    }

    .secondary-services-section {
        padding: 5rem 0 0;
    }

    .about-section {
        padding: 5rem 0;
    }

    .secondary-services-container {
        max-width: 1800px;
        padding: 0 4rem;
    }

    .main-services {
        max-width: 1800px;
        gap: 4rem;
        justify-items: center;
        place-items: center;
    }

    .secondary-services {
        max-width: 1800px;
        gap: 2.5rem;
    }

    .projects-grid {
        max-width: 1800px;
        gap: 3rem;
    }

    .benefits-container {
        max-width: 1800px;
        gap: 2rem;
    }

    .values-grid {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
        max-width: 1800px;
        gap: 2.5rem;
    }

    .mission-vision-grid {
        max-width: 1800px;
        gap: 4rem;
    }

    .contact-grid {
        max-width: 1400px;
        gap: 4rem;
    }

    .contact-info,
    .contact-form-container {
        padding: 3rem 2.5rem;
        min-height: 500px;
    }

    .calculator-form {
        max-width: 650px;
        padding: 3rem;
        margin: 0 auto;
    }

    .input-group {
        margin-bottom: 1.5rem;
    }

    .footer-content {
        max-width: 1800px;
        gap: 4rem;
    }
}

@media (max-width: 768px) {
    .hero h1 {
        margin-top: 1rem; /* Reducido espacio en tablets */
    }

    .header {
        padding: 0.6rem 0;
    }

    .nav-container {
        padding: 0 1rem;
    }

    .hamburger {
        display: block;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: linear-gradient(135deg, #1a365d, #2c5282);
        flex-direction: column;
        padding: 1rem;
        box-shadow: 0 4px 12px rgba(0,0,0,0.2);
        gap: 1rem;
        border-radius: 0 0 15px 15px;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu a {
        padding: 0.5rem 1rem;
        border-radius: 8px;
        transition: background-color 0.3s;
        text-align: center;
        font-size: 1rem;
    }

    .nav-menu a:hover {
        background-color: rgba(255,255,255,0.1);
    }

    /* HERO MÓVIL CORREGIDO - ALTURA OPTIMIZADA */
    .hero {
        padding: 90px 0 60px; /* Removed horizontal padding */
        min-height: 100vh; /* Vuelve a ocupar toda la pantalla */
        height: 100vh; /* Altura exacta de la pantalla */
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        margin: 0;
        border: none;
    }

    .hero-video {
        min-width: 100%;
        min-height: 100%;
        object-position: center center;
    }

    .hero-content {
        padding: 0;
        position: relative;
        z-index: 2;
        width: 100%;
        max-width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        height: calc(100vh - 150px); /* Altura específica descontando header y padding */
    }

    .hero h1 {
        padding: 0;
        margin-bottom: 1rem; /* Reducido espacio */
        margin-top: 0; /* Eliminado margen superior */
        font-size: 1.8rem;
        line-height: 1.2;
    }

    .hero-subtitle {
        padding: 0;
        margin-bottom: 1.5rem; /* Reducido espacio */
        font-size: 1rem;
        line-height: 1.4;
        max-width: 90%;
    }

    .hero-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem; /* Reducido gap */
        margin: 2rem auto; /* Margen normal restaurado */
        padding: 0;
        max-width: 300px;
    }

    .stat-item {
        padding: 0.3rem;
    }

    .stat-number {
        font-size: 1.8rem; /* Reducido tamaño */
    }

    .cta-button {
        margin: 1.5rem auto 0; /* Margen superior restaurado */
        width: auto;
        max-width: 280px;
        padding: 0.9rem 1.5rem;
    }

    /* FLECHA DE SCROLL - REPOSICIONADA */
    .scroll-indicator {
        bottom: 20px; /* Posición fija desde abajo */
        font-size: 1.2rem; /* Tamaño reducido */
    }

    /* SECCIONES GENERALES MÓVIL */
    .section {
        padding: 3rem 0;
    }

    .benefits-section-wrapper {
        padding: 0.5rem 0 0.3rem 0;
    }    .container {
        padding: 0 1rem;
    }

    .nav-container {
        padding: 0 1rem;
    }

    .hero-content {
        padding: 0 1rem;
    }

    .section-title {
        padding: 0 1rem;
        font-size: 1.8rem;
    }

    /* SERVICIOS MÓVIL - CENTRADO PERFECTO */
    .main-services-section {
        padding: 0 0 2rem 0;
        min-height: auto;
    }

    .main-services-container {
        padding: 0 1rem;
        height: auto;
        display: block;
    }

    .secondary-services-section {
        padding: 1rem 0 0;
    }

    .secondary-services-container {
        padding: 0 1rem;
    }

    .main-services {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        margin: 0 auto;
        padding: 0;
        justify-items: center;
        place-items: center;
        height: auto;
    }

    .main-service {
        width: 100%;
        max-width: 400px;
        margin: 0 auto;
        min-height: 420px;
    }

    .secondary-services {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin: 0.5rem auto 0;
        padding: 0;
        justify-items: center;
    }

    .services-subtitle {
        text-align: center !important;
        font-size: 1.6rem !important;
        padding: 0 1rem !important;
        font-weight: 700 !important;
        margin: 1.5rem auto 1.5rem auto !important;
    }

    .secondary-service {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }

    /* Asegurar iconos circulares en móvil */
    .secondary-service .service-icon {
        width: 60px !important;
        height: 60px !important;
        border-radius: 50% !important;
        aspect-ratio: 1 !important;
        flex-shrink: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        margin: 0 auto 1rem auto !important;
    }

    .services-grid {
        grid-template-columns: 1fr;
        gap: 1.2rem;
        margin: 2rem auto 0;
        padding: 0 1rem;
        justify-items: center;
    }

    .service-card {
        width: 100%;
        max-width: 320px;
        margin: 0 auto;
    }

    /* BENEFICIOS MÓVIL - ESTILO LISTA */
    .benefits-container {
        display: block;
        gap: 0;
        text-align: left;
        align-items: stretch;
        max-width: 600px;
        margin: 0 auto;
        padding: 0 1rem;
    }

    .benefit-item {
        padding: 2rem 0;
        background: transparent;
        border-radius: 0;
        width: 100%;
        max-width: 100%;
        margin: 0;
        text-align: left;
        box-shadow: none;
        border: none;
        border-bottom: 1px solid rgba(0,0,0,0.08);
        min-height: auto;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 1.5rem;
    }

    .benefit-item:last-child {
        border-bottom: none;
    }

    .benefit-icon {
        width: 60px;
        height: 60px;
        background: transparent;
        border-radius: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 0;
        color: #333;
        box-shadow: none;
        flex-shrink: 0;
    }

    .benefit-image {
        width: 50px;
        height: 50px;
        object-fit: contain;
        filter: none;
        opacity: 0.8;
    }

    .benefit-content {
        flex: 1;
    }

    .benefit-item h4,
    .benefit-item p {
        text-align: left;
        margin: 0;
    }

    .benefit-item h4 {
        font-size: 1.2rem;
        margin-bottom: 0.5rem;
        color: #1a365d;
        font-weight: 600;
    }

    .benefit-item p {
        font-size: 0.9rem;
        color: #4a5568;
        line-height: 1.4;
    }

    .benefits-container {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 1.8rem;
    }

    .benefit-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 1rem;
    }

    .benefit-svg {
        width: 28px;
        height: 28px;
    }

    .benefit-item h4 {
        font-size: 1.1rem;
    }

    .benefit-item p {
        font-size: 0.9rem;
        max-width: none;
    }

    .benefits-title {
        font-size: 1.3rem;
        margin: 1rem 0 0.8rem;
        text-align: center;
        padding: 0 1rem;
    }

    /* SOBRE NOSOTROS MÓVIL - TEXTO CORREGIDO */
    .about-text {
        text-align: left;
        line-height: 1.6;
    }

    .about-text p {
        text-align: left;
        margin-bottom: 1.2rem;
    }

    .about-content > div:last-child h3,
    .services-subtitle {
        text-align: center !important;
        font-size: 1.6rem !important;
        padding: 0 1rem !important;
        font-weight: 700 !important;
    }

    .values-grid {
        grid-template-columns: 1fr !important;
        gap: 1.2rem !important;
        margin-top: 1.5rem !important;
        text-align: center !important;
    }

    .value-item {
        width: 100% !important;
        max-width: 400px !important;
        margin: 0 auto !important;
        text-align: center !important;
    }

    .mission-vision-grid {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
        align-items: center;
        width: 100%;
        margin: 0 auto;
        padding: 0 1rem;
    }

    .mission-vision-card {
        max-width: 90%;
        width: 90%;
        padding: 2rem;
        height: auto;
        min-height: 400px;
        flex: none;
    }

    .mission-vision-content {
        transform: translateY(0) !important;
        opacity: 1 !important;
        padding: 2rem 1.5rem !important;
        position: relative !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: space-between !important;
        height: 100% !important;
    }

    .mission-vision-content p {
        opacity: 1 !important;
        transform: translateY(0) !important;
        position: relative !important;
        bottom: auto !important;
        margin-top: 1rem !important;
    }

    .mission-vision-card::after {
        transform: translateY(-50%) !important;
    }

    .mission-vision-title {
        font-size: 1.6rem;
        color: white !important;
        text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.9);
        margin-bottom: 1.5rem !important;
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        transform: none !important;
        text-align: center !important;
        width: 100% !important;
    }

    .mission-vision-content p {
        position: relative !important;
        bottom: auto !important;
        opacity: 1 !important;
        transform: none !important;
        margin-top: 0 !important;
    }

    .mission-vision-content p {
        font-size: 0.95rem;
        line-height: 1.4;
        color: white;
        text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
    }

    /* Mejorar interactividad en móviles para misión y visión */
    .mission-vision-card {
        -webkit-tap-highlight-color: transparent;
        cursor: pointer;
    }

    .mission-vision-card:active {
        transform: translateY(-5px) scale(1.01);
        box-shadow: 0 15px 30px rgba(0,0,0,0.12);
        transition: all 0.3s ease;
    }

    .mission-vision-card:active::after {
        background-image: linear-gradient(
            to bottom,
            hsla(220, 55%, 20%, 0.2) 0%,
            hsla(220, 55%, 18%, 0.25) 11.7%,
            hsla(220, 55%, 16%, 0.3) 22.1%,
            hsla(220, 55%, 14%, 0.35) 31.2%,
            hsla(220, 55%, 12%, 0.4) 39.4%,
            hsla(220, 55%, 10%, 0.45) 46.6%,
            hsla(220, 55%, 8%, 0.5) 53.1%,
            hsla(220, 55%, 6%, 0.55) 58.9%,
            hsla(220, 55%, 4%, 0.6) 64.3%,
            hsla(200, 45%, 15%, 0.65) 69.3%,
            hsla(200, 45%, 12%, 0.7) 74.1%,
            hsla(200, 45%, 10%, 0.75) 78.8%,
            hsla(200, 45%, 8%, 0.8) 83.6%,
            hsla(200, 45%, 6%, 0.82) 88.7%,
            hsla(200, 45%, 4%, 0.85) 94.1%,
            hsla(200, 45%, 2%, 0.9) 100%
        );
        transition: background-image 0.3s ease;
    }

    .mission-vision-card:active .mission-vision-title {
        text-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
        transform: scale(1.02);
        transition: all 0.3s ease;
    }

    /* PROYECTOS MÓVIL */
    .projects-grid {
        flex-direction: column;
        align-items: center;
        gap: 1.2rem;
    }

    /* CALCULADORA MÓVIL */
    .calculator {
        min-height: 85vh;
        padding: 4rem 0;
    }

    .calculator .container {
        padding: 1rem;
        min-height: 75vh;
        justify-content: center;
    }

    .calculator-form {
        margin: 0 auto;
        padding: 1.2rem;
        max-width: 100%;
    }

    .calculator-video {
        min-width: 100%;
        min-height: 100%;
        object-position: center center;
    }

    .input-group input,
    .input-group select {
        font-size: 16px; /* Evitar zoom en iOS */
    }

    /* Logo Calculator mobile styles */
    .logo-calculator-section {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.8rem 0;
    }

    .logo-calculator-image {
        height: 40px;
    }

    .logo-calculator-content {
        align-items: center;
    }

    .logo-calculator-text {
        font-size: 1rem;
    }

    .logo-calculator-subtitle {
        font-size: 0.65rem;
        margin-top: -1px;
    }

    /* Radio buttons mobile styles */
    .radio-group {
        justify-content: center;
        gap: 2rem;
    }

    .radio-option {
        flex: 0 0 auto;
    }

    .radio-option input[type="radio"] {
        width: 18px;
        height: 18px;
        margin-right: 0.6rem;
    }

    .radio-option input[type="radio"]:checked::before {
        width: 8px;
        height: 8px;
    }

    .radio-option label {
        font-size: 0.9rem;
    }

    /* CONTACTO MÓVIL - CORREGIDO */
    .contact {
        min-height: 100vh;
        padding: 0;
    }

    .contact .container {
        padding: 2rem 1rem;
        min-height: 100vh;
        justify-content: center;
    }

    .contact-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        max-width: 100%;
        margin: 0 auto;
    }

    .contact-info,
    .contact-form-container {
        width: 100%;
        margin: 0;
        padding: 2rem 1.5rem;
        box-sizing: border-box;
        min-height: auto;
    }

    .contact-icon {
        width: 35px;
        height: 35px;
        margin-right: 0.8rem;
        flex-shrink: 0;
    }

    .contact-item {
        align-items: flex-start;
        margin-bottom: 1rem;
    }

    /* FOOTER MÓVIL */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.2rem;
        text-align: center;
    }

    .footer-section {
        text-align: center;
    }

    .footer-section ul {
        text-align: center;
    }

    .social-icons {
        justify-content: center;
    }

    .social-icon {
        width: 35px;
        height: 35px;
    }

    .social-svg {
        width: 18px;
        height: 18px;
    }

    /* WHATSAPP MÓVIL */
    .whatsapp-float {
        width: 55px;
        height: 55px;
        bottom: 15px;
        right: 15px;
    }

    .whatsapp-icon {
        width: 28px;
        height: 28px;
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0 0.8rem;
    }

    /* HERO MÓVIL PEQUEÑO - OPTIMIZADO */
    .hero {
        padding: 80px 0.8rem 50px; /* Padding inferior para espacio de flecha */
        min-height: 100vh; /* Altura completa de la pantalla */
        height: 100vh; /* Altura exacta de la pantalla */
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .hero-video {
        object-position: center center;
    }

    .container {
        padding: 0 0.8rem;
    }

    .hero-content {
        padding: 0 0.8rem;
        position: relative;
        z-index: 2;
        width: 100%;
        max-width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        height: calc(100vh - 130px); /* Altura específica para pantallas pequeñas */
    }

    .hero h1 {
        font-size: 1.6rem; /* Ligeramente reducido */
        line-height: 1.2;
        margin-bottom: 1rem;
        margin-top: 0;
    }

    .hero-subtitle {
        font-size: 0.95rem;
        line-height: 1.4;
        margin-bottom: 1.3rem; /* Reducido */
        max-width: 95%;
    }

    .section-title {
        font-size: 1.8rem;
        padding: 0 0.5rem;
    }

    .about-content > div:last-child h3,
    .services-subtitle {
        font-size: 1.5rem !important;
        padding: 0 0.5rem !important;
        font-weight: 700 !important;
    }

    .hero-stats {
        grid-template-columns: repeat(2, 1fr); /* Mantener 2 columnas */
        gap: 0.8rem;
        margin: 1.8rem auto; /* Margen ligeramente restaurado */
        max-width: 280px;
    }

    .stat-number {
        font-size: 1.6rem; /* Reducido para pantallas pequeñas */
    }

    .stat-label {
        font-size: 0.8rem;
    }

    .service-card,
    .project-card {
        margin: 0;
    }

    .contact-item {
        flex-direction: row;
        align-items: flex-start;
    }

    .contact-icon {
        margin-right: 0.8rem;
    }

    .cta-button {
        max-width: 240px; /* Reducido */
        padding: 0.8rem 1.3rem; /* Padding reducido */
        font-size: 0.95rem;
        margin: 1.3rem auto 0; /* Margen superior ligeramente restaurado */
    }

    /* FLECHA DE SCROLL PEQUEÑA */
    .scroll-indicator {
        bottom: 15px; /* Posición fija desde abajo */
        font-size: 1rem; /* Más pequeña */
    }

    .benefits-section {
        margin: 0;
        padding: 1.5rem 0 0.2rem;
    }

    .services-subtitle {
        font-size: 1.5rem !important;
        padding: 0 0.8rem !important;
        font-weight: 700 !important;
        text-align: center !important;
        margin: 1rem auto 1.5rem auto !important;
    }

    .benefit-item {
        padding: 2rem 1.5rem !important;
        min-height: 240px;
    }

    .benefit-icon {
        width: 60px;
        height: 60px;
        margin-bottom: 1.2rem;
    }

    .benefit-svg {
        width: 28px;
        height: 28px;
    }

    .benefit-item h4 {
        font-size: 1.1rem;
    }

    .benefit-item p {
        font-size: 0.9rem;
    }

    .calculator-video {
        object-position: center center;
    }

    /* CALCULADORA PANTALLAS MUY PEQUEÑAS */
    .calculator .container {
        padding: 0.8rem;
        min-height: 70vh;
        justify-content: center;
    }

    .calculator-form {
        padding: 1rem;
        margin: 0 auto;
        border-radius: 12px;
    }

    .contact .container {
        padding: 1.5rem 0.8rem;
        min-height: 100vh;
        justify-content: center;
    }

    .contact-info,
    .contact-form-container {
        padding: 1.5rem 1rem;
        border-radius: 12px;
        min-height: auto;
    }

    .contact-info h3,
    .contact-form-container h3 {
        font-size: 1.3rem;
        margin-bottom: 1.2rem;
    }

    .contact-item {
        margin-bottom: 1.2rem;
    }

    .contact-icon {
        width: 40px;
        height: 40px;
        margin-right: 1rem;
        flex-shrink: 0;
        font-size: 1rem;
    }

    .contact-item {
        margin-bottom: 1rem;
    }

    .form-row input,
    .form-row select,
    .form-row textarea {
        font-size: 16px; /* Evitar zoom en iOS */
        padding: 0.7rem;
    }

    /* Radio buttons very small screens */
    .radio-group {
        gap: 1.5rem;
        justify-content: center;
    }

    .radio-option input[type="radio"] {
        width: 16px;
        height: 16px;
        margin-right: 0.5rem;
    }

    .radio-option input[type="radio"]:checked::before {
        width: 7px;
        height: 7px;
    }

    .radio-option label {
        font-size: 0.85rem;
    }
}

/* Landscape orientation fix for mobile */
@media (max-height: 500px) and (orientation: landscape) and (max-width: 900px) {
    .hero {
        min-height: 100vh;
        height: 100vh; /* Altura exacta de la pantalla */
        padding: 70px 1rem 40px; /* Padding compacto pero suficiente */
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .hero-video {
        object-fit: cover;
        width: 100%;
        height: 100%;
    }

    .hero-content {
        padding: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        max-width: 100%;
        width: 100%;
        height: calc(100vh - 110px); /* Altura disponible para contenido */
    }

    .hero h1 {
        font-size: 1.8rem;
        margin-bottom: 0.5rem; /* Margen muy reducido */
        margin-top: 0;
        line-height: 1.1;
    }

    .hero-subtitle {
        font-size: 0.9rem;
        margin-bottom: 1rem; /* Margen muy reducido */
        line-height: 1.3;
        max-width: 80%;
    }

    .hero-stats {
        margin: 1rem auto; /* Margen muy reducido */
        grid-template-columns: repeat(4, 1fr);
        gap: 0.5rem;
        max-width: 400px;
    }

    .stat-item {
        padding: 0.2rem;
    }

    .stat-number {
        font-size: 1.4rem; /* Más pequeño */
    }

    .stat-label {
        font-size: 0.7rem; /* Más pequeño */
    }

    .cta-button {
        margin: 0.8rem auto 0; /* Margen muy reducido */
        padding: 0.7rem 1.2rem;
        font-size: 0.9rem;
        max-width: 200px;
    }

    /* Flecha visible pero pequeña en landscape móvil */
    .scroll-indicator {
        bottom: 10px;
        font-size: 0.9rem;
        opacity: 0.8;
    }
}

/* ================================================
   CORRECCIONES ESPECÍFICAS Y PRECISAS PARA MÓVIL
   ================================================ */

/* CENTRADO SOLO DONDE ES NECESARIO */
@media (max-width: 768px) {

    /* SERVICIOS PRINCIPALES - Solo el contenedor grid */
    .main-services-section {
        padding: 0.5rem 0 3rem 0;
        min-height: 50vh;
    }

    .main-services-container {
        padding: 0 1rem;
        height: auto;
        display: block;
    }

    .main-services {
        display: grid !important;
        grid-template-columns: 1fr !important;
        justify-items: center !important;
        place-items: center !important;
        gap: 1.5rem !important;
        margin: 0 auto !important;
        width: 100% !important;
        height: auto !important;
    }

    .main-service {
        width: 100% !important;
        max-width: 400px !important;
        margin: 0 auto !important;
        text-align: center !important; /* Solo para las tarjetas de servicio */
        min-height: 350px !important;
    }

    /* SERVICIOS SECUNDARIOS - Solo el contenedor */
    .secondary-services-section {
        padding: 2rem 0 0;
    }

    .secondary-services-container {
        padding: 0 1rem;
    }

    .secondary-services {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 1rem !important;
        margin: 1.5rem auto !important;
        width: 100% !important;
    }

    .secondary-service {
        width: 100% !important;
        max-width: 300px !important;
        margin: 0 auto !important;
        text-align: center !important; /* Solo para las tarjetas de servicio */
    }

    /* PROJECTS GRID */
    .projects-grid {
        justify-content: center;
        gap: 1.2rem;
        margin-top: 2rem;
    }

    .project-card {
        width: 100% !important;
        max-width: 350px !important;
        margin: 0 auto !important;
    }

    /* BOTÓN CTA - Centrado específico */
    .cta-button {
        display: block !important;
        margin: 1.5rem auto !important;
        width: fit-content !important;
        text-align: center !important;
    }

    /* TÍTULOS - Solo centrar títulos principales */
    .section-title,
    .benefits-title {
        text-align: center !important;
        width: 100% !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    /* EXCLUIR CONTENIDO QUE NO DEBE CENTRARSE */
    .about-text,
    .form-row,
    .contact-item {
        text-align: left !important; /* Mantener alineación natural */
    }

    .contact-info h3,
    .contact-form-container h3 {
        text-align: left !important; /* Títulos de contacto a la izquierda */
    }

    .about-text p {
        text-align: left !important; /* Párrafos justificados */
    }

    .form-row label {
        text-align: left !important; /* Labels de formulario */
    }

    .footer-section {
        text-align: center !important; /* Footer sí debe estar centrado */
    }

    /* CONTAINER GENERAL - Sin centrado automático */
    .container {
        padding: 0 1rem !important;
        /* NO aplicar flex ni centrado aquí */
    }
}

/* ================================================
   SOLUCIÓN ADICIONAL PARA CUALQUIER CONTENEDOR
   ================================================ */

@media (max-width: 480px) {
    /* SERVICIOS EN PANTALLAS MUY PEQUEÑAS */
    .main-service {
        max-width: 350px;
        padding: 1.5rem;
        min-height: 380px;
    }

    .secondary-service {
        max-width: 280px;
        padding: 1rem;
    }

    .service-card {
        max-width: 280px;
        padding: 1.2rem;
    }

    .mission-vision-card {
        min-height: 350px;
        padding: 1.5rem;
    }

    .mission-vision-content {
        padding: 2rem 1.2rem !important;
        justify-content: space-between !important;
    }

    .mission-vision-title {
        font-size: 1.4rem;
        color: white !important;
        text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.9);
        margin-bottom: 1.5rem !important;
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        transform: none !important;
    }

    .mission-vision-content p {
        position: relative !important;
        bottom: auto !important;
        opacity: 1 !important;
        transform: none !important;
        margin-top: 0 !important;
        font-size: 0.9rem;
        color: white;
        text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
    }

    /* BOTÓN CTA MUY PEQUEÑO */
    .cta-button {
        max-width: 250px;
        padding: 0.9rem 1.5rem;
        font-size: 0.95rem;
    }

    /* Logo Calculator extra small screens */
    .logo-calculator-section {
        flex-direction: column;
        gap: 0.4rem;
        padding: 0.6rem 0;
    }

    .logo-calculator-image {
        height: 35px;
    }

    .logo-calculator-text {
        font-size: 0.9rem;
    }

    .logo-calculator-subtitle {
        font-size: 0.6rem;
        margin-top: -1px;
    }
}

/* ================================================
   NUEVOS ESTILOS PARA TARJETAS MODERNAS
   ================================================ */

/* Importar fuentes para las nuevas tarjetas */
@import url('https://fonts.googleapis.com/css?family=Cardo:400i|Rubik:400,700&display=swap');

/* Variables CSS para las nuevas tarjetas */
:root {
  --card-d: 700ms;
  --card-e: cubic-bezier(0.19, 1, 0.22, 1);
  --card-font-sans: 'Rubik', 'Arial', sans-serif;
  --card-font-serif: 'Cardo', 'Georgia', serif;
}

/* Estilos específicos para la nueva sección de servicios principales */
.main-services-section .page-content {
  display: grid;
  grid-gap: 2rem;
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  font-family: var(--card-font-sans);
}


@media (min-width: 769px) {
  .main-services-section .page-content {
    grid-template-columns: repeat(3, 1fr);
  }
}



.main-services-section .card {  
  position: relative;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  padding: 1rem;
  width: 100%;
  text-align: center;
  color: whitesmoke;
  background-color: whitesmoke;
  box-shadow: 0 1px 1px rgba(0,0,0,0.1), 
    0 2px 2px rgba(0,0,0,0.1), 
    0 4px 4px rgba(0,0,0,0.1), 
    0 8px 8px rgba(0,0,0,0.1),
    0 16px 16px rgba(0,0,0,0.1);
  border-radius: 15px;
  transition: transform 0.3s ease;
  height: 600px;
}


.main-services-section .card:before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 110%;
  background-size: cover;
  background-position: center;
  transition: transform calc(var(--card-d) * 1.5) var(--card-e);
  pointer-events: none;
  border-radius: 15px;
}

.main-services-section .card:after {
  content: '';
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 200%;
  pointer-events: none;
  background-image: linear-gradient(
    to bottom,
    hsla(220, 55%, 20%, 0.3) 0%,
    hsla(220, 55%, 18%, 0.35) 11.7%,
    hsla(220, 55%, 16%, 0.4) 22.1%,
    hsla(220, 55%, 14%, 0.45) 31.2%,
    hsla(220, 55%, 12%, 0.5) 39.4%,
    hsla(220, 55%, 10%, 0.55) 46.6%,
    hsla(220, 55%, 8%, 0.6) 53.1%,
    hsla(220, 55%, 6%, 0.65) 58.9%,
    hsla(220, 55%, 4%, 0.7) 64.3%,
    hsla(200, 45%, 15%, 0.75) 69.3%,
    hsla(200, 45%, 12%, 0.8) 74.1%,
    hsla(200, 45%, 10%, 0.85) 78.8%,
    hsla(200, 45%, 8%, 0.9) 83.6%,
    hsla(200, 45%, 6%, 0.92) 88.7%,
    hsla(200, 45%, 4%, 0.95) 94.1%,
    hsla(200, 45%, 2%, 0.98) 100%
  );
  /* Estado por defecto - overlay presente */
  transform: translateY(0);
  transition: transform calc(var(--card-d) * 2) var(--card-e);
  border-radius: 15px;
}

/* Imágenes de fondo para cada tarjeta */
.main-services-section .card:nth-child(1):before {
  background-image: url('img/domestico.webp');
}

.main-services-section .card:nth-child(2):before {
  background-image: url('img/comercial.webp');
}

.main-services-section .card:nth-child(3):before {
  background-image: url('img/industrial.webp');
}

.main-services-section .content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 2rem;
  transition: transform var(--card-d) var(--card-e);
  z-index: 1;
  /* Estilos por defecto - estado inicial similar al pre-hover */
  transform: translateY(calc(100% - 4.5rem));
}

.main-services-section .content > * + * {
  margin-top: 1.5rem;
}

.main-services-section .title {
  font-size: 1.3rem;
  font-weight: bold;
  line-height: 1.2;
  color: white;
  margin-bottom: 0.5rem;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
  /* Por defecto siempre visible */
  opacity: 1;
  transform: translateY(0);
}

.main-services-section .copy {
  font-family: var(--card-font-serif);
  font-size: 1rem;
  font-style: italic;
  line-height: 1.35;
  color: white;
  text-align: center;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
  /* Por defecto oculto */
  opacity: 0;
  transform: translateY(1rem);
  transition: opacity var(--card-d) var(--card-e), transform var(--card-d) var(--card-e);
}

/* Efectos de hover para desktop con capacidad hover */
@media (hover: hover) and (min-width: 769px) {
  /* Los valores por defecto ya están establecidos correctamente */

  .main-services-section .card:hover,
  .main-services-section .card:focus-within {
    align-items: center;
    transform: translateY(-8px) scale(1.02);
  }

  .main-services-section .card:hover:before,
  .main-services-section .card:focus-within:before { 
    transform: translateY(-4%); 
  }

  .main-services-section .card:hover:after,
  .main-services-section .card:focus-within:after { 
    transform: translateY(-50%); 
  }

  .main-services-section .card:hover .content,
  .main-services-section .card:focus-within .content {
    transform: translateY(0);
  }

  .main-services-section .card:hover .content > *:not(.title),
  .main-services-section .card:focus-within .content > *:not(.title) {
    opacity: 1;
    transform: translateY(0);
    transition-delay: calc(var(--card-d) / 8);
  }

  .main-services-section .card:focus-within:before,
  .main-services-section .card:focus-within:after,
  .main-services-section .card:focus-within .content,
  .main-services-section .card:focus-within .content > *:not(.title) {
    transition-duration: 0s;
  }
}

/* Efectos para dispositivos táctiles sin hover */
@media (hover: none) and (min-width: 769px) {
  .main-services-section .card {
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
  }

  /* Estados de click para reemplazar hover */
  .main-services-section .card.clicked,
  .main-services-section .card:focus {
    align-items: center;
    transform: translateY(-8px) scale(1.02);
  }

  .main-services-section .card.clicked:before,
  .main-services-section .card:focus:before { 
    transform: translateY(-4%); 
  }

  .main-services-section .card.clicked:after,
  .main-services-section .card:focus:after { 
    transform: translateY(-50%); 
  }

  .main-services-section .card.clicked .content,
  .main-services-section .card:focus .content {
    transform: translateY(0);
  }

  .main-services-section .card.clicked .content > *:not(.title),
  .main-services-section .card:focus .content > *:not(.title) {
    opacity: 1;
    transform: translateY(0);
    transition-delay: calc(var(--card-d) / 8);
  }
}

/* Estilos específicos para mobile - SCROLL HORIZONTAL */
@media (max-width: 1080px) {
  /* Prevenir desbordamiento horizontal en pantallas medianas */
  body {
    overflow-x: hidden;
  }
  .main-services-section .page-content {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    gap: 1.5rem;
    padding: 1.5rem;
    max-width: none;
    margin: 0;
    width: 100%;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(26, 54, 93, 0.3) transparent;
    padding-right: 2rem;
  }

  /* Estilos personalizados para la scrollbar en móviles */
  .main-services-section .page-content::-webkit-scrollbar {
    height: 6px;
  }

  .main-services-section .page-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
  }

  .main-services-section .page-content::-webkit-scrollbar-thumb {
    background: rgba(26, 54, 93, 0.4);
    border-radius: 3px;
  }

  .main-services-section .page-content::-webkit-scrollbar-thumb:hover {
    background: rgba(26, 54, 93, 0.6);
  }

  .main-services-section .card {
    height: auto;
    min-height: 350px;
    min-width: 280px;
    max-width: 280px;
    flex: 0 0 280px;
    padding: 2rem;
    cursor: pointer;
    scroll-snap-align: center;
    margin-right: 0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }

  .main-services-section .card:active {
    transform: scale(0.98);
  }

  .main-services-section .card:last-child {
    margin-right: 1.5rem;
  }

  .main-services-section .card:after {
    transform: translateY(0) !important;
  }

  .main-services-section .content {
    transform: translateY(calc(100% - 4.5rem)) !important;
    opacity: 1 !important;
    padding: 1.5rem;
    transition: transform 0.3s ease;
  }

  .main-services-section .content > *:not(.title) {
    opacity: 0 !important;
    transform: translateY(1rem) !important;
    transition: opacity 0.3s ease, transform 0.3s ease;
  }

  .main-services-section .title {
    font-size: 1.3rem;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    opacity: 1 !important;
    transform: translateY(0) !important;
  }

  .main-services-section .copy {
    font-size: 0.95rem;
    line-height: 1.4;
    color: white;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
    opacity: 0 !important;
    transform: translateY(1rem) !important;
  }

  /* Efecto al tocar en móvil */
  .main-services-section .card:active .content,
  .main-services-section .card.expanded .content {
    transform: translateY(0) !important;
  }

  .main-services-section .card:active .content > *:not(.title),
  .main-services-section .card.expanded .content > *:not(.title) {
    opacity: 1 !important;
    transform: translateY(0) !important;
  }

  .main-services-section .card:active:after,
  .main-services-section .card.expanded:after {
    transform: translateY(-50%) !important;
  }
}

/* Ajustes adicionales para pantallas muy pequeñas */
@media (max-width: 480px) {
  .main-services-section .page-content {
    gap: 1rem;
    padding: 1rem;
  }

  .main-services-section .card {
    min-width: 260px;
    max-width: 260px;
    flex: 0 0 260px;
    min-height: 320px;
  }
}
