/* --- CONFIGURACIÓN DE SCROLL --- */
html {
    scroll-behavior: smooth !important; /* Fuerza el deslizamiento suave */
}

html, body {
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* Esto mata el movimiento lateral */
    position: relative;
}

/* Punto de anclaje maestro */
#top {
    position: absolute;
    top: 0;
    left: 0;
}

/* Asegura que el ID de inicio (en el body o header) respete el espacio */
#inicio {
    scroll-margin-top: 100px; /* Evita que el menú fijo tape el contenido al bajar */
}



/* --- VARIABLES GLOBALES --- */
:root {
    --color-primary: #FFC107; /* Amarillo AM Arquitectos */
    --color-dark: #222222;    /* Gris oscuro casi negro */
    --color-gray: #666666;    /* Gris para textos */
    --color-light: #ffffff;   /* Fondos claros */
    --font-main: 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    --max-width: 1200px;      /* Ancho máximo del contenido */
}




/* --- RESET BÁSICO --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    color: var(--color-light);
    line-height: 1.6;
}

a { text-decoration: none; color: inherit; transition: 0.3s; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* --- UTILIDADES --- */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
}

.section-title h2 {
    font-size: 2rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* --- HEADER & NAV --- */
.main-header {
    background: #000000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-light);
    border-left: 4px solid var(--color-primary);
    padding-left: 10px;
}

.logo span { font-weight: 300; }

.main-nav ul { display: flex; gap: 30px; }
.main-nav a { font-weight: 500; font-size: 0.9rem; text-transform: uppercase; }
.main-nav a:hover { color: var(--color-primary); }

.btn-contacto {
    background: var(--color-dark);
    color: #ffffff !important;
    padding: 8px 20px;
    border-radius: 4px;
}
.btn-contacto:hover { background: var(--color-primary); color: #ffffff !important; }


/* --- HERO REESTRUCTURADO SIN ENCIMAMIENTOS --- */


/* El video siempre al fondo */
.video-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%; 
    min-height: 100%;
    width: auto;
    height: auto;
    z-index: -100;
    transform: translate(-50%, -50%);
    object-fit: cover; /* Esto es clave: ajusta el video al contenedor sin deformarlo */
}

.hero {
    position: relative;
    height: 100vh; /* Cambia a 100 para que llene la pantalla */
    width: 100%;
    overflow: hidden;
    display: flex;
    align-items: center; /* Centra todo verticalmente */
}


/* Capa de contenido encima del video */
.hero-overlay {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 1400px; /* Ancho máximo para que no se pegue a las orillas */
    margin: 0 auto;
    padding: 0 40px;
}

/* EL TRUCO: 3 Columnas con espacio obligatorio entre ellas */
.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr; /* 3 espacios iguales */
    align-items: center;
    gap: 20px; /* Espacio mínimo de seguridad entre columnas */
}

/* Columna Izquierda: Texto */
.hero-text {
    text-align: left;
    margin-bottom: 0; /* Quitamos el margen excesivo en PC */
}

.hero-text h1 {
    font-size: 3rem;
    color: var(--color-dark);
    line-height: 1.1;
    margin-bottom: 20px;
}

/* Columna Central: Logotipo (Protegido) */
.hero-logo {
    display: flex;
    justify-content: center;
}

.hero-logo img {
    max-width: 300px; /* Tamaño máximo del logo */
    width: 100%;
    height: auto;
}

/* Columna Derecha: Tarjeta de Vidrio */
.hero-stats {
    display: flex;
    justify-content: flex-end;
}

.glass-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-left: 4px solid #FFC107; /* Amarillo de AM Arquitectos */
    padding: 25px;
    max-width: 250px;
    text-align: left;
}

.glass-card h2 {
    color: #FFC107;
    font-size: 3rem;
    margin: 0;
}

.glass-card p {
    color: #000000;
    font-size: 1.1rem;
    margin-top: 10px;
    font-weight: bold;
}

.btn-primary {
    background-color: #FFC107; /* El amarillo de tu logo */
    color: #000 !important;    /* Texto negro para contraste */
    padding: 12px 30px;        /* Tamaño del botón */
    font-weight: bold;
    text-transform: uppercase;
    display: inline-block;     /* Para que tome bien el margen y padding */
    border-radius: 4px;        /* Bordes sutilmente redondeados */
    transition: background 0.3s ease;
    text-decoration: none;
}

.btn-primary:hover {
    background-color: #e0a800; /* Un tono más oscuro al pasar el mouse */
}


/* --- SECCIÓN SERVICIOS (ESTILO TARJETAS) --- */

.servicios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.servicio-card {
    background: #000000;
    padding: 20px 25px;
    border-radius: 8px; /* Bordes ligeramente redondeados */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-bottom: 3px solid transparent; /* Línea invisible abajo */
    text-align: center;
}

.servicio-card:hover {
    transform: translateY(-20px); /* Se levanta un poco */
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    border-bottom: 3px solid var(--color-primary); /* Aparece línea amarilla al hover */
}


.servicio-card h3 {
    margin-bottom: 15px;
    font-size: 1.25rem;
    color: #FFC107; /* Amarillo AM Arquitectos */
    font-weight: bold;
}

.servicio-card p {
    font-size: 0.95rem;
    color: #ffffff;
    line-height: 1.6;
}

.servicio-info {
    padding: 25px; /* Crea el espacio de aire en los 4 lados */
}

.servicio-img-container {
    width: 100%;
    height: 200px; /* ALTURA FIJA: Ajusta este valor según prefieras */
    overflow: hidden;
    background-color: #000; /* Fondo de seguridad si la imagen falla */
}

.servicio-img {
    width: 100%;
    height: 100%;
    /* CLAVE: Recorta la imagen para que llene el cuadro sin estirarse */
    object-fit: cover; 
    /* OPCIONAL: Centra la parte más importante de la foto */
    object-position: center; 
}

.hero-text .btn-primary {
    margin-top: 30px; /* Dale aire al botón */
    display: inline-block;
}

.hero-text h1 {
    text-shadow: 2px 2px 15px rgba(0, 0, 0, 0.7);
}


/* texto clientes */

.clientes {
    text-align: center;
    padding: 60px 0;
    background-color: #ffffff; /* Color claro para que el texto resalte */
}

.clientes h3 {
    font-size: 2.5rem; /* Título más grande */
    color: #000;
    text-transform: uppercase;
    font-weight: 800;
    margin-bottom: 80px;
}

.clientes-descripcion {
    font-size: 1.4rem; /* Párrafo más grande y legible */
    color: #444;
    max-width: 800px;
    margin: 0 auto 50px auto; /* Más espacio inferior antes de los logos */
    line-height: 1.4;
    font-weight: 500;
}

/* Asegúrate de que el slider no tape el texto de arriba */
.slider {
    margin-top: 20px;
    overflow: hidden;}



/* --- SECCIÓN CLIENTES CON MOVIMIENTO --- */
.clientes-section {
    background-color: #f9f9f9;
    padding: 60px 0;
    overflow: hidden; /* Vital para que los logos no se salgan de la pantalla */
}

/* Reemplazamos el grid estático por una pista de animación */
.logos-grid {
    display: flex;             /* Obliga a los logos a ponerse uno al lado del otro */
    flex-wrap: nowrap;        /* Evita que los logos salten a la siguiente línea */
    align-items: center;
    width: max-content;       /* Permite que el contenedor sea tan ancho como todos los logos juntos */
    animation: scroll-infinito 30s linear infinite;
}


.logo-item {
    flex: 0 0 200px;         /* Cada logo ocupa exactamente 250px y no se encoge */
    display: flex;
    justify-content: center;
    padding: 0 40px;
}

.logo-item img {
    height: 70px;
    filter: grayscale(60%);
    opacity: 0.6;
    transition: 0.3s ease;
}

.logo-item img:hover {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.1);
}

/* Ajuste de la animación para que coincida con el número de logos */
@keyframes scroll-infinito {
    0% { transform: translateX(0); }
    /* Si tienes 6 logos originales, se desplaza el ancho de esos 6 */
    100% { transform: translateX(calc(-250px * 8)); } 
}

.logo-item img:hover { filter: grayscale(0); opacity: 1; transform: scale(1.10); }




/* --- PORTAFOLIO (GRID) --- */
.portfolio { padding: 80px 0; }

.grid-portfolio {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* Responsivo automático */
    gap: 30px;
}

.proyecto-card {
    position: relative;
    height: 350px;
    overflow: hidden;
    cursor: pointer;
    background: #ccc;
}

.proyecto-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.card-overlay {
    position: absolute;
    bottom: -100%; /* Oculto abajo */
    left: 0;
    width: 100%;
    padding: 30px;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    color: white;
    transition: bottom 0.3s ease;
}

.proyecto-card:hover img { transform: scale(1.1); }
.proyecto-card:hover .card-overlay { bottom: 0; } /* Sube al hacer hover */





/* --- FOOTER --- */
footer {
    background: var(--color-dark);
    color: #000000;
    text-align: center;
    padding: 60px 0;
}

footer p { margin-bottom: 10px; }
footer strong { color: #fff; letter-spacing: 1px; }
.copyright { font-size: 0.8rem; margin-top: 30px; border-top: 1px solid #333; padding-top: 20px; }

/* --- RESPONSIVE MOBILE --- */
@media (max-width: 768px) {
    .hero h1 { font-size: 2rem; }
    .nav-container { flex-direction: column; height: auto; padding: 15px; }
    .main-nav ul { gap: 15px; margin-top: 15px; flex-wrap: wrap; justify-content: center; }
}

/* --- FOOTER CORREGIDO --- */
footer {
    background-color: #000000;
    color: #fff;
    padding-top: 60px;
    padding-bottom: 20px; /* Menos espacio abajo para el copyright */
    border-top: 5px solid var(--color-primary);
}

.footer-content {
    display: flex;
    justify-content: space-between; /* Uno a cada extremo */
    align-items: center;            /* CLAVE: Esto los centra verticalmente */
    flex-wrap: wrap;
    padding-bottom: 40px;           /* Espacio antes de la línea del copyright */
    border-bottom: 1px solid #333;  /* Línea divisoria sutil */
}

/* Logo */
.footer-logo img {
    max-width: 180px;
    height: auto;
}

.footer-logo {
    margin-top: 15px; /* Dale un poco de aire respecto a la línea amarilla */
}


/* Texto de contacto */
.footer-info {
    text-align: right;
}

.footer-info h3 {
    text-transform: uppercase;
    font-size: 1.2rem;
    margin-bottom: 15px;
    letter-spacing: 1px;
    color: #fff;
}

.footer-info p {
    margin-bottom: 8px;
    color: #ccc;
    font-size: 0.95rem;
}

.footer-info strong {
    color: var(--color-primary); /* Amarillo */
}

/* Barra de Copyright (Nueva) */
.copyright-bar {
    padding-top: 20px;
    text-align: center; /* Centrado al medio de la página */
    font-size: 0.8rem;
    color: #ffffff;
}

/* Ajuste Móvil */
@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        gap: 30px;
        text-align: center;
    }
    
    .footer-info {
        text-align: center;
    }
}


.contacto-section {
    padding: 80px 0;
    background-color: #111; /* Un poco más claro que el footer para dar profundidad */
    text-align: center;
}

.contacto-section h3 {
    color: #fff;
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.contacto-intro {
    color: #ccc;
    margin-bottom: 40px;
}

.contacto-form {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group input, 
.form-group select, 
.form-group textarea {
    width: 100%;
    padding: 15px;
    background: #222;
    border: 1px solid #444;
    color: #fff;
    font-family: 'Montserrat', sans-serif; /* Usamos la letra del Hero */
    border-radius: 4px;
}

.form-group input:focus {
    border-color: #FFC107; /* Brillo amarillo al escribir */
    outline: none;
}

.contacto-form .btn-primary {
    width: 100%;
    margin-top: 10px;
    cursor: pointer;
    border: none;
}


/* --- BOTÓN WHATSAPP CON NOTIFICACIÓN --- */
.whatsapp-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #25d366;
    color: #fff;
    padding: 10px 20px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    z-index: 1000;
    transition: all 0.3s ease;
}

.whatsapp-icon-container {
    position: relative;
    display: flex;
    align-items: center;
    font-size: 1.8rem;
}

/* El globo de notificación rojo */
.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #ff3b30; /* Rojo vibrante */
    color: white;
    font-size: 12px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border: 2px solid #25d366;
    animation: pulse-red 2s infinite;
}

/* Animación de pulso para la notificación */
@keyframes pulse-red {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.7); }
    70% { transform: scale(1.2); box-shadow: 0 0 0 10px rgba(255, 59, 48, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 59, 48, 0); }
}

.whatsapp-btn:hover {
    transform: translateY(-5px);
    background-color: #128c7e;
}

/* En móviles ocultamos el texto largo pero mantenemos el ícono y la notificación */
@media (max-width: 768px) {
    .whatsapp-text { display: none; }
    .whatsapp-btn { padding: 15px; border-radius: 50%; }
}



.main-header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background-color: rgba(0, 0, 0, 0.9); /* Un fondo oscuro para que se lea el menú */
}

/* Añade un margen al body para que el contenido no se meta debajo del header fijo */
body {
    padding-top: 80px; 
}
/* Esto hace que el movimiento sea suave y no un salto */
html {
    scroll-behavior: smooth;
}


/* --- BOTÓN VOLVER ARRIBA (CON EFECTO) --- */
.scroll-top-btn {
    position: fixed;
    bottom: 30px;
    left: 30px;
    background-color: #FFC107;
    color: #000 !important;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    
    /* Estado inicial: Invisible */
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease; /* Transición suave */
    transform: translateY(20px); /* Empieza un poco más abajo */
}

/* Clase que activará JavaScript al hacer scroll */
.scroll-top-btn.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0); /* Sube a su posición original */
}





@media (max-width: 768px) {
    /* Hacemos los botones más compactos */
    .whatsapp-btn, .scroll-top-btn {
        bottom: 20px;
        width: 45px;
        height: 45px;
        padding: 0;
    }

    .whatsapp-btn { right: 15px; }
    .scroll-top-btn { left: 15px; }

    /* Ocultamos el texto largo de WhatsApp para dejar solo el ícono */
    .whatsapp-text {
        display: none;
    }
    
    /* Centramos el ícono de WhatsApp en el círculo móvil */
    .whatsapp-icon-container {
        font-size: 1.5rem;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    /* Ajustamos el contenedor principal */
    .hero {
        height: auto;
        padding: 100px 20px 60px; /* Espacio para que no choque con el header */
    }

    .hero-content {
        display: flex;
        flex-direction: column; /* Apilamos los elementos verticalmente */
        align-items: center;
        text-align: center;
        gap: 40px;
    }

    .hero-text h1 {
        font-size: 2rem; /* Tamaño de letra más cómodo para móvil */
        margin-bottom: 20px;
    }

    /* Quitamos el logo central en móvil para ahorrar espacio */
    .hero-logo {
        display: none;
    }

    /* Ajustamos la tarjeta de estadísticas */
    .glass-card {
        max-width: 100%;
        width: 100%;
        margin-top: 20px;
    }
}


@media (max-width: 768px) {
    /* 1. Quitamos el Grid y forzamos Flexbox vertical */
    .hero-content {
        display: flex !important;
        flex-direction: column !important;
        height: auto !important;
        min-height: 10vh !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 0 !important; /* Manejaremos el espacio con márgenes */
    }

    /* 2. El texto "Creamos espacios..." */
    .hero-text {
        width: 100% !important;
        text-align: center !important;
        margin-bottom: 150px !important; /* Espacio debajo del título */
    }

    .hero-text h1 {
        font-size: 1.8rem !important;
        line-height: 1.2 !important;
    }

    /* 3. El botón amarillo: Forzamos que se separe de la tarjeta */
    .hero-text .btn-primary {
        display: inline-block !important;
        margin: 20px auto !important; 
        position: relative !important;
        z-index: 10 !important;
    }

    /* 4. La tarjeta de estadísticas (+50) */
    .hero-stats {
        width: 100% !important;
        margin-top: 120px !important; /* EMPUJA LA TARJETA HACIA ABAJO */
        position: relative !important;
    }

    .glass-card {
        position: relative !important;
        top: 0 !important;
        left: 0 !important;
        transform: none !important;
        margin: 0 auto !important;
        max-width: 280px !important;
    }
}




/* --- ESTILOS MENÚ HAMBURGUESA --- */
.menu-toggle {
    display: none; /* Oculto en PC */
    background: none;
    border: none;
    color: #FFC107; /* Amarillo corporativo */
    font-size: 1.8rem;
    cursor: pointer;
    z-index: 1100;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block; /* Visible en móvil */
    }

    .main-nav {
        position: fixed;
        top: 70px; /* Debajo del header */
        right: -100%; /* Escondido a la derecha */
        width: 80%;
        height: 100vh;
        background: rgba(0, 0, 0, 0.95);
        transition: 0.4s ease-in-out;
        box-shadow: -5px 0 15px rgba(0,0,0,0.5);
    }

    /* Clase que activa el JavaScript */
    .main-nav.active {
        right: 0; /* Aparece al hacer clic */
    }

    .main-nav ul {
        flex-direction: column;
        padding-top: 50px;
        gap: 30px;
        align-items: center;
    }

    .main-nav a {
        font-size: 1.2rem;
    }
}

@media (max-width: 768px) {
    .footer-content {
        text-align: center;
        flex-direction: column;
        gap: 30px;
    }
    
    .footer-info {
        margin-top: 10px;
    }
}

.section-title {
    text-align: center;
    margin-bottom: 60px;
    padding-top: 40px;
}

.section-title span {
    display: block;
    color: #FFC107; /* Amarillo corporativo */
    font-size: 0.9rem;
    letter-spacing: 2px;
    font-weight: bold;
    margin-bottom: 10px;
}

.section-title h2 {
    font-size: 2.5rem;
    color: #333;
    font-weight: 700;
    text-transform: uppercase;
    position: relative;
    padding-bottom: 15px;
}

/* Línea decorativa debajo del nombre */
.section-title h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background-color: #FFC107;
}

/* Ajuste para que en celular no se vea gigante */
@media (max-width: 768px) {
    .section-title h2 {
        font-size: 1.8rem;
    }
}


/* Si la sección tiene fondo oscuro, el título debe ser blanco */
.contacto-section .section-title h2 {
    color: #ffffff !important;
}

.portfolio .section-title h2 {
    color: #222; /* Gris oscuro para fondo blanco */
}

/* --- SECCIÓN DE MANIFIESTO --- */
.brand-statement {
    background-color: #ffffff;
    padding: 80px 20px; /* Espacio equilibrado */
    text-align: center;
    position: relative;
    z-index: 20; /* Asegura que tape cualquier rastro del video al bajar */
}

.brand-statement p {
    font-size: 1.8rem;
    color: #444;
    font-weight: 300;
    font-style: italic;
    max-width: 900px;
    margin: 0 auto;
    line-height: 1.4;
}

/* Detalle decorativo: una pequeña barra amarilla al final de la frase */
.statement-line {
    width: 40px;
    height: 3px;
    background-color: #FFC107;
    margin: 30px auto 0;
}

/* Ajuste para Laptops y Móviles */
@media (max-width: 1024px) {
    .brand-statement p {
        font-size: 1.4rem;
    }
}

@media (max-width: 768px) {
    .brand-statement {
        padding: 60px 20px;
    }
    .brand-statement p {
        font-size: 1.2rem;
    }
}

.alianza-sopcom {
    background-color: #000000;
    padding: 30px 0;
    border-top: 1px solid #ddd;
}

.alianza-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.alianza-wrapper p {
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 500;
}

.alianza-wrapper img {
    height: 35px; /* Tamaño discreto del logo de Sopcom */
    filter: grayscale(100%);
    opacity: 0.7;
    transition: 0.3s;
}

.alianza-wrapper img:hover {
    filter: grayscale(0%);
    opacity: 1;
}

@media (max-width: 768px) {
    .alianza-wrapper {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}