/* ======================= */
/* VARIABLES Y GLOBALES   */
/* ======================= */
:root {
    --primary-blue: #000203;
    --accent-green: #4fa773;
    --light-gray: #F4F7F9;
    --light-gray-footer: #F4F7F9;
    --dark-gray: #1b1b1b;
    --white: #FFFFFF;
    --black: #000000;
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Inter', sans-serif;
    --header-color-fg: #000000;
    --header-color-bg: #ffffff23;
    --hover-bg: #e6e8e9;
    --border: #dce3de;
}

/* Modo oscuro opcional */
@media (prefers-color-scheme: dark) {
    :root {
        --light-gray: #141414;
        --dark-gray: #e7e7e7;
        --accent-green: #1fa055;
        --white: #000000;
        --black: #E5E7EB;
        --header-color-fg: #e2e2e2;
        --header-color-bg: #00000023;
        --border: #376533;
        --light-gray-footer: #F4F7F9;
    }
}

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

html {
    scroll-padding-top: 160px;
    width: 100%;
    overflow-x: hidden;
}

body {
    font-family: var(--font-body);
    background-color: var(--white);
    color: var(--dark-gray);
    line-height: 1.6;
    width: 100%;
    overflow-x: hidden;
}

.skip-link {
    position: absolute;
    left: -999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
    z-index: 999;
    background: var(--accent-green);
    color: #fff;
    padding: 0.75rem 1rem;
    border-radius: 8px;
}

.skip-link:focus {
    left: 1rem;
    top: 1rem;
    width: auto;
    height: auto;
    outline: 2px solid #fff;
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    color: var(--black);
    line-height: 1.2;
}

h1 { font-size: 3rem; }
h2 { font-size: 2.5rem; text-align: center; margin-bottom: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.2rem; }

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
    box-sizing: border-box;
}

section {
    padding: 6rem 0;
    width: 100%;
    overflow-x: hidden;
}

/* ======================= */
/* COMPONENTES       */
/* ======================= */
.btn {
    display: inline-block;
    padding: 0.8rem 1.8rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: var(--accent-green);
    color: #fff;
}
.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(46, 204, 113, 0.4);
}

.btn-secondary {
    background-color: transparent;
    color: var(--black);
    border: 2px solid var(--accent-green);
}
.btn-secondary:hover {
    background-color: var(--accent-green);
    color: #fff;
}

/* ======================= */
/* HEADER         */
/* ======================= */
.header {
    position: sticky;
    top: 0;
    width: 100%;
    background-color: var(--header-color-bg);
    backdrop-filter: blur(10px);
    z-index: 100;
    /* border-bottom: 1px solid #e5e7eb; */
    padding-top: 18pt;
    padding-bottom: 18pt;
}

.nav-container {
    max-width: 1500px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
    width: 100%;
    box-sizing: border-box;
}

.logo {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-blue);
    text-decoration: none;
}

.logo_footer img {
    height: 60pt;
    width: auto;
}

.logo img {
    height: 90pt;
    width: auto;
}

/* Mostrar logo negro en tema claro */
.logo-light {
    display: block;
}

.logo-dark {
    display: none;
}

/* Mostrar logo blanco en tema oscuro */
@media (prefers-color-scheme: dark) {
    .logo-light {
        display: none;
    }
    
    .logo-dark {
        display: block;
    }

}
.footer {
    color: #F4F7F9;
}
.footer a, .footer p {
    color: #F4F7F9;
}


.footer_h4 {
    color: #F4F7F9;
}

.nav a {
    color: var(--header-color-fg);

    font-family:  "Sofia Sans Semi Condensed", sans-serif;
    font-optical-sizing: auto;
    font-weight: 320;
    font-style: normal;
    font-size: 18pt;

    text-decoration: none;
    margin: 0 1rem;
    transition: color 0.3s ease;
}

.nav a:hover {
    color: var(--accent-green);
}

.nav-btn {
    display: block; /* Oculto por defecto en móvil */
}

/* ======================= */
/* HERO SECTION     */
/* ======================= */
.hero {
    height: calc(100vh - 70px);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(rgba(0,0,0,0.1), rgba(0,0,0,0.1)), url('https://images.unsplash.com/photo-1677756119517-756a188d2d94?q=80&w=2070&auto=format&fit=crop') no-repeat center center/cover;
}

.hero-content {
    max-width: 800px;
}

.hero h1 {
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    min-height: 1.2em; /* Evitar que el h1 cambie de altura */
}

.typewriter-text {
    color: #4fa773; /* Color por defecto */
    transition: color 0.3s ease;
    text-shadow: 
        -1px -1px 0 #000,
        1px -1px 0 #000,
        -1px 1px 0 #000,
        1px 1px 0 #000,
        0 0 3px rgba(0, 0, 0, 0.8);
    font-weight: 600;
}

.typewriter-cursor {
    display: inline-block;
    animation: blink 1s infinite;
    color: #fff;
    margin-left: 2px;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.hero p {
    font-size: 1.2rem;
    margin: 1rem 0 2rem;
    color: #f4f7f9;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.hero-buttons .btn {
    margin: 0 0.5rem;
}
.hero-buttons .btn-secondary {
    border-color: #fff;
    color: #fff;
}
.hero-buttons .btn-secondary:hover {
    background-color: #fff;
    color: var(--primary-blue);
}


/* ======================= */
/* QUIÉNES SOMOS      */
/* ======================= */
.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    margin-bottom: 4rem;
    width: 100%;
}
.about-text p { margin-bottom: 1rem; }
.about-image img {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}
.team { margin-top: 4rem; text-align: center; }

.team-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}
.team-grid a {
    display: block;
    text-decoration: none;
    color: inherit;
    width: 100%;
}

.team-member {
    height: 420px;
    position: relative;
    text-align: center;
    border-radius: 24px;
    padding: 1.75rem;
    background: linear-gradient(145deg, var(--white) 0%, var(--light-gray) 100%);
    border: 1px solid var(--border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    transition: transform 0.35s ease, box-shadow 0.35s ease;
    width: 100%;
    box-sizing: border-box;
}
.team-member::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(79, 167, 115, 0.12), transparent 45%);
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}
.team-member:hover {
    transform: translateY(-12px);
    box-shadow: 0 16px 45px rgba(0, 0, 0, 0.1);
}
.team-member:hover::before {
    opacity: 1;
}
.team-member img {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1rem;
    border: 3px solid var(--border);
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.team-member:hover img {
    transform: scale(1.05);
    box-shadow: 0 0 0 8px rgba(79, 167, 115, 0.12);
}
.team-member h4 {
    margin-bottom: 0.25rem;
    letter-spacing: 0.04em;
    color: var(--accent-green);
    text-transform: uppercase;
}
.team-member h3 {
    margin-bottom: 0.3rem;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.team-member p {
    font-size: 0.92rem;
}

/* ======================= */
/* SERVICIOS        */
/* ======================= */
.services { background-color: var(--light-gray); }
.services-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    width: 100%;
}
.service-card {
    background-color: var(--white);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}
.service-card i {
    color: var(--accent-green);
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
}
.service-card h3 { margin-bottom: 1rem; }
.service-card ul {
    list-style: none;
    padding-left: 1rem;
    margin: 1rem 0;
}
.service-card ul li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
}
.service-card ul li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--accent-green);
    font-weight: bold;
}
.benefit { margin-top: 1.5rem; }

/* ======================= */
/* CASOS DE ÉXITO      */
/* ======================= */
.projects-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    width: 100%;
}
.project-card {
    border-left: 4px solid var(--accent-green);
    padding: 2rem;
    background-color: var(--light-gray);
    border-radius: 0 8px 8px 0;
}
.project-card h4 { margin-bottom: 1rem; }
.highlight {
    color: var(--accent-green);
    font-weight: bold;
}

/* ======================= */
/* CONTACTO        */
/* ======================= */
.contact { background-color: var(--light-gray); }
.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    width: 100%;
}
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-family: var(--font-body);
}
.contact-form input:focus,
.contact-form textarea:focus {
    outline: 2px solid var(--accent-green);
    border-color: transparent;
}
.contact-form button {
    align-self: flex-start;
    border: none;
    cursor: pointer;
}

/* ======================= */
/* FOOTER         */
/* ======================= */
.footer {
    background-color: var(--primary-blue);
    color: var(light-gray-footer);
    padding: 4rem 0;
}
.footer a, .footer p {
    color: var(light-gray-footer);
    text-decoration: none;
}
.footer .logo { color: var(--white); }
.footer-container {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 2rem;
}
.footer-col {
    display: flex;
    flex-direction: column;
}

/* ======================= */
/* CARRUSEL DE CLIENTES    */
/* ======================= */
.clients { background-color: var(--white); }
.clients .container { padding-bottom: 0; }
.clients-intro {
    text-align: center;
    margin-bottom: 1.5rem;
}
.carousel {
    background-color: var(--white);
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    overflow: hidden;
    padding: 0 0.5rem;
}
.carousel-track {
    display: flex;
    gap: 2rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 2rem 1rem;
    scroll-behavior: smooth;
    outline: none;
    flex: 1;
    min-width: 0; /* Permite que el flex item se encoja */
    /* Ocultar scrollbar pero mantener funcionalidad */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE y Edge */
    /* Mejorar el scroll suave */
    overscroll-behavior-x: contain;
}

/* Ocultar scrollbar en Chrome, Safari y Opera */
.carousel-track::-webkit-scrollbar {
    display: none;
}

.carousel-item {
    flex: 0 0 auto;
    width: 200px;
    height: 120px;
    border-radius: 12px;
    overflow: hidden;
    scroll-snap-align: center;
    background-color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.carousel-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.carousel-item a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    filter: none;
    transition: transform 0.3s ease;
}

.carousel-item:hover img {
    transform: scale(1.05);
}

@media (prefers-color-scheme: dark) {
    .carousel-item img {
        filter: invert(100%);
    }
}

.carousel-btn {
    appearance: none;
    border: none;
    background: var(--white);
    color: var(--black);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 10;
    flex-shrink: 0;
    font-size: 1.2rem;
    font-weight: bold;
}

.carousel-btn:hover {
    transform: scale(1.1);
    background: var(--accent-green);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(79, 167, 115, 0.3);
}

.carousel-btn:active {
    transform: scale(0.95);
}

.carousel-btn:disabled,
.carousel-btn[style*="pointer-events: none"] {
    opacity: 0.5;
    cursor: not-allowed;
}

.carousel-btn.prev {
    margin-right: 1rem;
}

.carousel-btn.next {
    margin-left: 1rem;
}

/* Responsivo */
@media (max-width: 768px) {
    .carousel {
        padding: 0 0.25rem;
    }
    
    .carousel-track {
        gap: 1.5rem;
        padding: 1.5rem 0.5rem;
    }
    
    .carousel-item {
        width: 180px;
        height: 100px;
        padding: 0.75rem;
    }
    
    .carousel-btn {
        width: 40px;
        height: 40px;
    }
    
    .carousel-btn.prev {
        margin-right: 0.5rem;
    }
    
    .carousel-btn.next {
        margin-left: 0.5rem;
    }
}

@media (max-width: 520px) {
    .carousel-track {
        gap: 1rem;
        padding: 1rem 0.25rem;
    }
    
    .carousel-item {
        width: 160px;
        height: 90px;
        padding: 0.5rem;
    }
    
    .carousel-btn {
        display: none;
    }
}
.footer-col h4 {
    margin-bottom: 1rem;
}
.footer-col a {
    margin-bottom: 0.5rem;
    transition: color 0.3s;
}
.footer-col a:hover { color: var(--accent-green); }
.logo-sonicali { font-size: 0.9rem; margin: 0 0 1rem; }
.social-links a { margin-right: 1rem; }

/* Íconos de contacto alineados verticalmente */
.footer-col p {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.footer-col p svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ======================= */
/* RESPONSIVE DESIGN   */
/* ======================= */
@media (max-width: 992px) {
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    
    .nav { display: none; } /* Simplificación para móvil */
    
    .about-content,
    .services-grid,
    .projects-grid,
    .contact-container {
        grid-template-columns: 1fr;
    }

    .about-image { order: -1; margin-bottom: 2rem; }
    
    .container {
        padding: 0 1.5rem;
    }
    
    section {
        padding: 4rem 0;
    }
    
    /* En tablets, mantener 2 columnas (2x2) */
    .team-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    section {
        padding: 3rem 0;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    
    /* Team grid: en móvil, usar 1 columna (apiladas) */
    .team-grid {
        grid-template-columns: 1fr;
        max-width: 100%;
    }
    
    .team-member {
        height: auto;
        min-height: 420px;
    }
    
    .team-member img {
        width: 140px;
        height: 140px;
    }
    
    .hero {
        height: auto;
        min-height: calc(100vh - 70px);
        padding: 3rem 0;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .hero-buttons {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
    
    .hero-buttons .btn {
        margin: 0;
        width: 100%;
        max-width: 300px;
    }
    
    .service-card {
        padding: 1.5rem;
    }
    
    .footer-container {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .footer-col {
        align-items: center;
    }
    .contact-form button {
        align-self: stretch;
    }
    .nav-btn { display: none; }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.75rem;
    }
    
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; margin-bottom: 1.5rem; }
    h3 { font-size: 1.25rem; }
    h4 { font-size: 1.1rem; }
    
    .team-member {
        padding: 1.25rem;
        min-height: 380px;
    }
    
    .team-member img {
        width: 120px;
        height: 120px;
    }
    
    .team-member h3 {
        min-height: 50px;
        font-size: 1.1rem;
    }
    
    .service-card {
        padding: 1.25rem;
    }
    
    .project-card {
        padding: 1.5rem;
    }
    
    .nav-container {
        padding: 0 1rem;
    }
    
    .logo img {
        height: 60pt;
    }
    
    .btn {
        padding: 0.7rem 1.5rem;
        font-size: 0.9rem;
    }
}

