/* ========================================
   RESET Y VARIABLES CSS
======================================== */

:root {
    /* Colores principales */
    --primary-color: #49B1C6;
    --secondary-color: #657c9a;
    --accent-color: #7abed0;
    --text-dark: #333333;
    --text-light: #666666;
    --text-white: #ffffff;
    --bg-light: #f9f9f9;
    --bg-dark: #333333;
    --border-color: #dddddd;

    /* Tipografía */
    --font-family: 'Montserrat', sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;
    --font-size-5xl: 3rem;

    /* Espaciado */
    --spacing-xs: 0.5rem;
    --spacing-sm: 0.75rem;
    --spacing-base: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;

    /* Breakpoints */
    --mobile: 480px;
    --tablet: 768px;
    --desktop: 1024px;
    --large: 1200px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--accent-color);
    overflow-x: hidden;
    padding-top: 100px;
}

/* ========================================
   UTILIDADES
======================================== */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-base);
}

.section-title {
    font-size: var(--font-size-4xl);
    font-weight: 600;
    color: var(--secondary-color);
    text-align: center;
    margin-bottom: var(--spacing-2xl);
}

.clients-section .section-title {
    font-size: var(--font-size-5xl);
    margin-bottom: var(--spacing-xl);
    color: var(--secondary-color);
}

/* ========================================
   NAVBAR RESPONSIVO
======================================== */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 100px;
    background-color: var(--text-white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: all 0.3s ease;
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    padding: 0 var(--spacing-base);
    max-width: 1200px;
    margin: 0 auto;
}

.navbar-logo .logo {
    height: 100px;
    width: auto;
    transition: all 0.3s ease;
}

/* Botón hamburguesa */
.navbar-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--spacing-xs);
    z-index: 1001;
}

.hamburger-line {
    width: 25px;
    height: 3px;
    background-color: var(--primary-color);
    margin: 3px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.navbar-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.navbar-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.navbar-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Menú de navegación */
.navbar-menu {
    display: flex;
    gap: var(--spacing-lg);
}

.nav-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    padding: var(--spacing-sm) var(--spacing-base);
    border-radius: 25px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover {
    background-color: var(--primary-color);
    color: var(--text-white);
    transform: translateY(-2px);
}

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

.hero-section {
    background: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)),
    url('../assets/download.jpeg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--spacing-2xl) var(--spacing-base);
}

.hero-content {
    max-width: 800px;
    color: var(--text-white);
}

.hero-title {
    font-size: var(--font-size-4xl);
    font-weight: 700;
    margin-bottom: var(--spacing-base);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-subtitle {
    font-size: var(--font-size-lg);
    margin-bottom: var(--spacing-xl);
    opacity: 0.9;
    line-height: 1.6;
}

.hero-btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--text-white);
    padding: var(--spacing-lg) var(--spacing-2xl);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: var(--font-size-lg);
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(73, 177, 198, 0.3);
}

.hero-btn:hover {
    background-color: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(101, 124, 154, 0.4);
}

/* ========================================
   SECCIÓN DE SERVICIOS
======================================== */

.services-section {
    padding: var(--spacing-3xl) 0;
    background-color: var(--bg-light);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-xl);
    margin-top: var(--spacing-2xl);
}

.service-card {
    background-color: var(--text-white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

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

.service-image-container {
    position: relative;
    overflow: hidden;
    height: 200px;
}

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

.service-card:hover .service-image {
    transform: scale(1.05);
}

.service-content {
    padding: var(--spacing-xl);
}

.service-title {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: var(--spacing-base);
    text-align: center;
}

.service-description {
    color: var(--text-light);
    line-height: 1.7;
    text-align: center;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.service-card.expanded .service-description {
    opacity: 1;
    max-height: 200px;
    margin-top: var(--spacing-base);
}

/* ========================================
   SECCIÓN DE ESTADÍSTICAS
======================================== */

.stats-section {
    padding: var(--spacing-3xl) 0;
    background-color: var(--text-white);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-xl);
}

.stat-item {
    text-align: center;
    padding: var(--spacing-xl);
    border-radius: 15px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-white);
    transition: transform 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-5px);
}

.stat-label {
    font-size: var(--font-size-sm);
    opacity: 0.9;
    margin-bottom: var(--spacing-xs);
}

.stat-number {
    font-size: var(--font-size-4xl);
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
}

.stat-description {
    font-size: var(--font-size-base);
    opacity: 0.9;
}

/* ========================================
   SECCIÓN DE CLIENTES
======================================== */

.clients-section {
    padding: var(--spacing-3xl) 0;
    background-color: #f0f0f0;
}

.clients-carousel {
    overflow: hidden;
    width: 100%;
}

.clients-track {
    display: flex;
    gap: var(--spacing-2xl);
    animation: scroll 30s linear infinite;
    width: max-content;
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.client-logo img {
    max-width: 100%;
    height: auto;
    display: block;
}


.client-logo {
    flex-shrink: 0;
    width: 320px;
    height: 240px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
}

.client-logo:hover {
    transform: scale(1.08);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
}

.client-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* ========================================
   FOOTER
======================================== */

.footer {
    background-color: var(--bg-dark);
    color: var(--text-white);
    padding: var(--spacing-3xl) 0 var(--spacing-base);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-2xl);
    margin-bottom: var(--spacing-2xl);
}

.footer-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin-bottom: var(--spacing-lg);
    color: var(--primary-color);
}

.contact-item {
    margin-bottom: var(--spacing-base);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.contact-item strong {
    color: var(--primary-color);
    font-weight: 600;
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.contact-link {
    color: var(--text-white);
    text-decoration: none;
    transition: color 0.3s ease;
    word-break: break-all;
    font-size: var(--font-size-sm);
    line-height: 1.4;
}

.contact-link:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: var(--spacing-lg);
    border-top: 1px solid #444;
    color: #999;
}

/* ========================================
   MEDIA QUERIES - MÓVILES
======================================== */

@media (max-width: 768px) {
    /* Variables ajustadas para móviles */
    :root {
        --spacing-base: 0.75rem;
        --spacing-lg: 1rem;
        --spacing-xl: 1.5rem;
        --spacing-2xl: 2rem;
        --spacing-3xl: 2.5rem;
    }

    /* Navbar móvil */
    .navbar-toggle {
        display: flex;
    }

    .navbar-menu {
        position: fixed;
        top: 100px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 100px);
        background-color: var(--text-white);
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding-top: var(--spacing-2xl);
        transition: left 0.3s ease;
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    }

    .navbar-menu.active {
        left: 0;
    }

    .nav-link {
        font-size: var(--font-size-lg);
        padding: var(--spacing-lg);
        margin: var(--spacing-sm) 0;
        width: 80%;
        text-align: center;
        border-radius: 10px;
    }

    .navbar-logo .logo {
        height: 75px;
    }

    /* Hero section móvil */
    .hero-title {
        font-size: var(--font-size-2xl);
    }

    .hero-subtitle {
        font-size: var(--font-size-sm);
    }

    .hero-btn {
        padding: var(--spacing-base) var(--spacing-xl);
        font-size: var(--font-size-base);
    }

    /* Servicios móvil */
    .services-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }

    .service-content {
        padding: var(--spacing-lg);
    }

    .service-title {
        font-size: var(--font-size-lg);
    }

    /* Estadísticas móvil */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-base);
    }

    .stat-item {
        padding: var(--spacing-lg);
    }

    .stat-number {
        font-size: var(--font-size-3xl);
    }

    /* Clientes móvil */
    .client-logo {
        width: 250px;
        height: 180px;
    }

    /* Footer móvil */
    .footer-content {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
        text-align: center;
    }

    .contact-item {
        margin-bottom: var(--spacing-lg);
    }

    .contact-item strong {
        font-size: var(--font-size-xs);
        margin-bottom: var(--spacing-xs);
    }

    .contact-link {
        font-size: var(--font-size-xs);
        word-break: break-word;
    }

    /* Página Nosotros - Móviles */
    .about-title {
        font-size: var(--font-size-3xl);
    }

    .about-description {
        font-size: var(--font-size-base);
    }

    .values-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-base);
    }

    .mission-vision-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }

    .philosophy-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-base);
    }

}

@media (max-width: 768px) {
    .values-container {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        justify-items: center; /* centra horizontalmente cada card */
    }

    .value-item {
        width: 90%; /* mantiene el tamaño original sin deformar */
    }

    /* Última tarjeta centrada */
    .value-item:last-child {
        grid-column: 1 / -1; /* hace que ocupe toda la fila */
        justify-self: center; /* y se centra */
        width: 60%; /* mismo tamaño visual pero centrada */
    }
}


/* Centrar segunda fila de Filosofía en pantallas anchas */
@media (min-width: 900px) {
    .philosophy-grid .philosophy-card:nth-child(4) {
        grid-column: 1;
    }

    .philosophy-grid .philosophy-card:nth-child(5) {
        grid-column: 3;
    }
}

@media (max-width: 480px) {
    /* Ajustes para móviles pequeños */
    .hero-title {
        font-size: var(--font-size-xl);
    }

    .section-title {
        font-size: var(--font-size-2xl);
    }

    .clients-section .section-title {
        font-size: var(--font-size-3xl);
        color: var(--secondary-color);
        margin-bottom: var(--spacing-lg);
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-number {
        font-size: var(--font-size-2xl);
    }

    .client-logo {
        width: 200px;
        height: 150px;
    }

    .navbar-logo .logo {
        height: 65px;
    }

    .container {
        padding: 0 var(--spacing-sm);
    }

    /* Página Nosotros - Móviles pequeños */
    .about-title {
        font-size: var(--font-size-2xl);
    }

    .values-grid {
        grid-template-columns: 1fr;
    }

    .value-item {
        padding: var(--spacing-base);
    }

    .mission-card,
    .vision-card {
        padding: var(--spacing-lg);
    }

    .philosophy-card {
        padding: var(--spacing-base);
    }
}

/* ========================================
   PÁGINA NOSOTROS
======================================== */

/* Sección Hero de Nosotros */
.about-hero-section {
    background-color: var(--bg-light);
    padding: var(--spacing-3xl) 0;
    text-align: center;
}

.about-hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.about-title {
    font-size: var(--font-size-5xl);
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: var(--spacing-xl);
}

.about-description {
    font-size: var(--font-size-lg);
    line-height: 1.8;
    color: var(--text-light);
    text-align: center;
}

.about-description strong {
    color: var(--primary-color);
    font-weight: 600;
}

.about-description em {
    color: var(--secondary-color);
    font-style: normal;
    text-decoration: underline;
    text-decoration-color: var(--primary-color);
    text-underline-offset: 3px;
}

/* Sección Valores, Misión y Visión */
.values-mission-section {
    background-color: #e8f4f8;
    padding: var(--spacing-3xl) 0;
}

.values-section {
    margin-bottom: var(--spacing-3xl);
}

.values-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--spacing-xl);
    margin-top: var(--spacing-2xl);
}

.value-item {
    text-align: center;
    padding: var(--spacing-lg);
    background-color: var(--text-white);
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.value-item:hover {
    transform: translateY(-5px);
}

.value-icon {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-base);
    color: var(--secondary-color);
}

.value-item h3 {
    font-size: var(--font-size-base);
    font-weight: 600;
    color: var(--text-dark);
    margin: 0;
}

/* Misión y Visión */
.mission-vision-section {
    margin-top: var(--spacing-3xl);
}

.mission-vision-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: var(--spacing-2xl);
    margin-top: var(--spacing-2xl);
}

.mission-card,
.vision-card {
    background-color: var(--text-white);
    padding: var(--spacing-2xl);
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    text-align: left;
}

.card-title {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--secondary-color);
    margin-bottom: var(--spacing-lg);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.card-description {
    font-size: var(--font-size-base);
    line-height: 1.7;
    color: var(--text-light);
    margin: 0;
}

/* Sección Filosofía */

.philosophy-section {
    background-color: var(--bg-light);
    padding: var(--spacing-3xl) 0;
}

.philosophy-grid {
    display: grid;
    gap: var(--spacing-xl);
    margin-top: var(--spacing-2xl);
    max-width: 1200px; /* aumentamos el ancho máximo para que entren las 4 */
    margin-left: auto;
    margin-right: auto;
}

.philosophy-card {
    background-color: #f5f5f5;
    padding: var(--spacing-xl);
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 15px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #bcbcbc;
    transition: transform 0.3s ease;
}

.philosophy-card:hover {
    transform: translateY(-3px);
}

.philosophy-card p {
    font-size: var(--font-size-md);
    line-height: 1.6;
    margin: 0;
    color: var(--text-light);
}

.philosophy-card.special p {
    color: var(--text-white);
    font-weight: 600;
}

/* Navbar activo */
.nav-link.active {
    background-color: var(--primary-color);
    color: var(--text-white);
}

/* ========================================
   ANIMACIONES Y TRANSICIONES
======================================== */

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

.service-card,
.stat-item,
.footer-section {
    animation: fadeInUp 0.6s ease-out;
}

/* Efectos de hover mejorados */
.service-card:active {
    transform: scale(0.98);
}

.nav-link:active {
    transform: scale(0.95);
}

.hero-btn:active {
    transform: translateY(-1px) scale(0.98);
}

/* ========================================
   ACCESIBILIDAD
======================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* Focus states para accesibilidad */
.nav-link:focus,
.hero-btn:focus,
.service-card:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Mejoras para lectores de pantalla */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ====== FIX DEFINITIVO PARA IPHONE (12–14 PRO, PRO MAX) ====== */
@media (max-width: 480px) {

    /* Asegura que no haya scroll lateral */
    html, body {
        margin: 0 !important;
        padding: 0 !important;
        overflow-x: hidden !important;
        width: 100% !important;
    }

    /* Contenedor general de cada bloque */
    section, .section {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Contenedor Misión–Visión */
    .mission-vision-container .about-hero-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 1.5rem;
        width: 100%;
        background-color: #e8f3f8; /* azul claro */
        box-sizing: border-box;
    }

    /* Cards */
    .mission-card,
    .vision-card {
        width: 94vw; /* ocupa casi todo el viewport sin causar scroll */
        padding: 1.8rem 1.4rem;
        border-radius: 14px;
        background: #fff;
        box-sizing: border-box;
    }

    .mission-card p,
    .vision-card p {
        font-size: 0.95rem;
        line-height: 1.6;
    }
}

/* Ajuste exclusivo para móviles tipo iPhone Pro */
@media (max-width: 430px) {
    .values-grid {
        display: flex;
        flex-direction: column;
        align-items: center; /* centra horizontalmente */
        justify-content: center;
        gap: 1.25rem; /* espacio entre tarjetas */
    }

    .value-item {
        width: 85%;
        min-height: 70px; /* 👈 asegura altura mínima igual */
        height: 70px; /* 👈 fuerza altura uniforme */
        text-align: center;
        padding: 1rem;
        background-color: #fff;
        border-radius: 15px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
        display: flex;
        align-items: center; /* centra verticalmente */
        justify-content: center; /* centra horizontalmente */
        font-weight: 600;
        transition: transform 0.3s ease;
    }

    .values-grid .value-item:last-child {
        width: 85%
    }

    .value-item:hover {
        transform: translateY(-4px);
    }
}

@media (min-width: 600px) and (max-width: 900px) {
    .values-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 1.25rem;
        justify-items: center;
    }

    .value-item {
        width: 180px;
        height: 70px;
        text-align: center;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Centrar los dos últimos elementos (4° y 5°) */
    .value-item:nth-child(4) {
        grid-column: 2 / 3; /* se coloca en la columna central */
    }

    .value-item:nth-child(5) {
        grid-column: 3 / 4; /* se coloca justo al lado derecho */
    }

    .valores-container .valor:last-child {
        width: auto !important; /* o el valor que usen los demás, por ejemplo 30% */
    }
}



