/* ==========================================================================
   PERSINOVAA - LAYOUT.CSS
   Estructura principal, Grillas, Header, Hero y Footer
   Agencia: Web Total México
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. BARRA DE ANUNCIO SUPERIOR (Top Bar Promo - Marketing)
   -------------------------------------------------------------------------- */
.top-bar-promo {
    background-color: var(--color-black, #0a0a0a);
    color: var(--color-white, #ffffff);
    text-align: center;
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    animation: slideDownBanner 0.5s ease-out forwards;
}

#countdown-promo {
    color: var(--color-accent, #00a8ff);
    font-weight: 800;
}

/* --------------------------------------------------------------------------
   2. HEADER & NAVEGACIÓN (Sticky y Transparente)
   -------------------------------------------------------------------------- */
.main-header {
    position: fixed;
    top: 36px; /* Altura de la top bar */
    left: 0;
    width: 100%;
    z-index: 999;
    padding: 1rem 0;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    background-color: transparent;
}

/* Clase añadida por JS cuando se hace scroll */
.main-header.scrolled {
    top: 0;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    padding: 0.8rem 0;
}

/* CORRECCIÓN DE LAYOUT: Reordenamiento visual para un look Premium */
.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem; /* Separación obligatoria entre bloques */
    width: 100%;
}

/* Logo siempre a la izquierda */
.logo-container {
    order: 1;
    flex-shrink: 0;
}

.logo-text {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -1px;
    color: var(--color-white, #ffffff);
    transition: color 0.3s ease;
}

.main-header.scrolled .logo-text {
    color: var(--color-black, #0a0a0a);
}

/* Navegación al centro */
.main-nav {
    order: 2;
    flex-grow: 1; /* Toma todo el espacio disponible */
    display: flex;
    justify-content: center; /* Centra los enlaces */
}

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

.nav-link {
    color: var(--color-white, #ffffff);
    font-weight: 600;
    font-size: 0.95rem;
    position: relative;
    padding: 0.5rem 0;
    white-space: nowrap; /* Evita que el texto del enlace se rompa */
}

.main-header.scrolled .nav-link {
    color: var(--color-gray-dark, #495057);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background-color: var(--color-primary, #0056b3);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.main-header.scrolled .nav-link:hover,
.main-header.scrolled .nav-link.active {
    color: var(--color-primary, #0056b3);
}

/* Teléfono a la derecha (antes del botón) */
.header-contact-info {
    order: 3;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.phone-link {
    color: var(--color-white, #ffffff);
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.main-header.scrolled .phone-link {
    color: var(--color-black, #0a0a0a);
}

.phone-link i {
    color: var(--color-accent, #00a8ff);
}

/* Botón y Hamburguesa al extremo derecho */
.header-actions {
    order: 4;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-shrink: 0;
}

.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--color-white, #ffffff);
    font-size: 1.8rem;
    cursor: pointer;
}

.main-header.scrolled .mobile-menu-toggle {
    color: var(--color-black, #0a0a0a);
}

/* --------------------------------------------------------------------------
   3. SECCIÓN HERO (Alto impacto visual)
   -------------------------------------------------------------------------- */
.hero-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: 80px; /* Compensa el header fijo */
    background-color: var(--color-black, #0a0a0a);
    background-image: url('../assets/img/hero-bg.jpg'); 
    background-size: cover;
    background-position: center;
    background-attachment: fixed; /* Efecto Parallax sutil */
}

/* Capa oscura para resaltar el texto */
.hero-dark-overlay::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.4) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.hero-title {
    color: #ffffff;
    font-size: clamp(2.5rem, 5vw, 4.5rem); /* Tipografía fluida */
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: clamp(1.1rem, 2vw, 1.25rem);
    margin-bottom: 2.5rem;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: #ffffff;
    font-size: 1.5rem;
    z-index: 2;
    cursor: pointer;
}

/* --------------------------------------------------------------------------
   4. GRILLAS (Estructuras CSS Grid)
   -------------------------------------------------------------------------- */

/* Grilla de Confianza (Trust Section) */
.trust-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

/* Grilla Masonry para Categorías */
.masonry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

/* Grilla de Galería (Proyectos) - Layout Asimétrico Premium */
.gallery-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: repeat(2, 250px);
    gap: 1.5rem;
    margin-top: 3rem;
}

.main-item {
    grid-row: 1 / span 2;
    border-radius: 16px;
    overflow: hidden;
}

.side-item {
    border-radius: 16px;
    overflow: hidden;
}

/* Grilla de Contacto (Info + Formulario) */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 0;
    align-items: stretch;
}

.contact-info {
    padding: 4rem 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    z-index: 2;
    position: relative;
}

.contact-form-wrapper {
    padding: 4rem 3rem 4rem 5rem;
    margin-left: -2rem; /* Superposición sutil para diseño moderno */
    z-index: 1;
}

.huge-phone {
    font-size: 2.5rem;
    font-weight: 800;
    display: block;
    margin: 1rem 0;
    line-height: 1;
}

.detail-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.detail-item i {
    font-size: 1.5rem;
    margin-top: 5px;
}

/* Carrusel de Testimonios (Simulación con CSS Flex y Scroll Snap) */
.testimonials-carousel {
    display: flex;
    gap: 2rem;
    overflow-x: auto;
    padding: 2rem 1rem;
    scroll-snap-type: x mandatory;
    scrollbar-width: none; /* Ocultar scrollbar en Firefox */
    -ms-overflow-style: none;  /* Ocultar scrollbar en IE/Edge */
}

.testimonials-carousel::-webkit-scrollbar {
    display: none; /* Ocultar scrollbar en Chrome/Safari */
}

.testimonials-carousel .testimonial-card {
    min-width: 320px;
    flex: 0 0 auto;
    scroll-snap-align: center;
}

/* --------------------------------------------------------------------------
   5. CABECERAS DE SECCIÓN (Section Headers)
   -------------------------------------------------------------------------- */
.section-header {
    max-width: 700px;
    margin: 0 auto 3rem auto;
}

.section-title {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 1rem;
}

.section-description {
    font-size: 1.125rem;
    color: var(--color-gray-dark, #6c757d);
}

/* --------------------------------------------------------------------------
   6. FOOTER
   -------------------------------------------------------------------------- */
.footer-nav {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.footer-nav a {
    color: var(--color-gray-dark, #495057);
    font-weight: 600;
}

.footer-nav a:hover {
    color: var(--color-primary, #0056b3);
}

.social-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: var(--color-gray-light, #f8f9fa);
    color: var(--color-black, #0a0a0a);
    border-radius: 50%;
    margin: 0 0.5rem;
    transition: all var(--transition-normal);
}

.social-icons a:hover {
    background-color: var(--color-primary, #0056b3);
    color: #ffffff;
    transform: translateY(-3px);
}

/* --------------------------------------------------------------------------
   7. MEDIA QUERIES (Responsividad Total)
   -------------------------------------------------------------------------- */

@media (max-width: 1200px) {
    /* Si la pantalla es un poco más pequeña, el teléfono puede apretar el menú */
    .header-contact-info {
        display: none; /* Ocultamos el teléfono en pantallas medianas para dar espacio al menú */
    }
}

@media (max-width: 1024px) {
    .contact-grid {
        grid-template-columns: 1fr;
    }
    
    .contact-form-wrapper {
        margin-left: 0;
        padding: 3rem;
        border-radius: 0 0 16px 16px;
    }

    .contact-info {
        border-radius: 16px 16px 0 0;
        padding: 3rem;
    }
}

@media (max-width: 768px) {
    /* Header Móvil */
    .mobile-menu-toggle {
        display: block;
        order: 5;
    }

    .main-nav {
        position: fixed;
        top: 0;
        right: -100%; /* Oculto por defecto */
        width: 80%;
        max-width: 350px;
        height: 100vh;
        background-color: #ffffff;
        flex-direction: column;
        justify-content: center;
        padding: 3rem;
        transition: right 0.4s ease;
        box-shadow: -10px 0 30px rgba(0,0,0,0.1);
        z-index: 1000;
    }

    /* Clase activa controlada por JS */
    .main-nav.is-open {
        right: 0;
    }

    .nav-list {
        flex-direction: column;
        width: 100%;
        gap: 1.5rem;
    }

    .nav-link {
        color: var(--color-black, #0a0a0a);
        font-size: 1.25rem;
        display: block;
    }

    /* Grillas en Móvil */
    .gallery-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
    }

    .main-item {
        grid-row: auto;
        height: 300px;
    }

    .side-item {
        height: 250px;
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }

    .btn-large {
        width: 100%;
    }
    
    .contact-form-wrapper {
        padding: 2rem 1.5rem;
    }
    
    .contact-info {
        padding: 2rem 1.5rem;
    }
}