/* --- Variables y Estilos Base --- */
:root {
    --primary-orange: #FF6B35;
    --primary-black: #000000;
    --gradient-1: linear-gradient(135deg, #FF6B35 0%, #FF8A50 100%);
}
body {
    background-color: var(--primary-black);
    color: #E0E0E0;
    font-family: 'Poppins', sans-serif;
    overflow-x: hidden;
    scroll-behavior: smooth;
}
p { color: #BDBDBD; }
h1, h2, h3, h4, h5, h6 { 
    color: #FFFFFF;
    text-transform: uppercase;
}

/* --- MODIFICACIÓN: Logo más grande y con mejor espaciado --- */
.fixed-logo {
    position: absolute;
    top: 25px;
    left: 25px;
    z-index: 50;
}
.fixed-logo img {
    height: 150px; /* Tamaño para PC aumentado */
    width: auto;
    transition: height 0.3s ease;
}

/* --- Hero Section (Estructura Definitiva) --- */
/* --- CAMBIO REALIZADO (Inicio) --- */
.hero-bg {
    position: relative;
    z-index: 1;
    /* IMAGEN DE FONDO PARA PC (POR DEFECTO) */
    background-image: url('images/fon.jpg');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

/* Esta regla ya no es necesaria porque eliminamos la etiqueta <img> */
.hero-bg-img {
    display: none; 
}
/* --- CAMBIO REALIZADO (Fin) --- */

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0,0,0,0.8) 0%, rgba(255,107,53,0.3) 100%);
    z-index: 2;
}

#inicio .container, #inicio .floating-particles {
    z-index: 3;
}

/* --- Botones --- */
.futuristic-btn {
    position: relative; background: var(--gradient-1); border: none; color: white !important;
    padding: 15px 40px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px;
    border-radius: 50px; cursor: pointer; overflow: hidden; transition: all 0.3s ease;
    display: inline-block; text-decoration: none;
}
.futuristic-btn:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(255,107,53,0.4); }
.futuristic-btn:disabled { background: #aaa; cursor: not-allowed; }

/* --- Tarjetas (Servicios, Proyectos) --- */
.service-card .service-icon { font-size: 3rem; color: var(--primary-orange); margin-bottom: 1rem; transition: all 0.3s ease; }
.service-card:hover .service-icon { transform: scale(1.2) rotate(10deg); color: #FF8A50; }
.project-card {
    position: relative; overflow: hidden; border-radius: 20px; transition: all 0.5s ease; cursor: pointer;
    background-color: #1A202C;
}
.project-card:hover { transform: translateY(-10px) scale(1.02); box-shadow: 0 20px 40px rgba(0,0,0,0.3); }
.project-card img {
    width: 100%; height: 280px;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.project-card:hover img { transform: scale(1.05); }
.project-card .card-content {
    position: absolute; bottom: 0; left: 0; right: 0; padding: 1.5rem; z-index: 2;
    background: linear-gradient(to top, rgba(0,0,0,0.95) 20%, transparent 100%);
    opacity: 0; transform: translateY(20px); transition: all 0.4s ease;
}
.project-card:hover .card-content { transform: translateY(0); opacity: 1; }

/* --- Estructura de Carruseles --- */
.carousel-section {
    padding-top: 5rem;
    padding-bottom: 5rem;
}
.carousel-container {
    max-width: 90vw;
    margin: 2rem auto 0 auto;
    padding: 2rem;
    background-color: #1A202C;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}
.carousel-content {
    display: flex;
    flex-direction: column; /* Default: vertical layout */
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
}
.carousel-fixed-details {
    padding: 2.5rem;
    text-align: left;
    background-color: #1A202C;
    border-radius: 12px 12px 0 0;
}
.project-detail-label {
    color: var(--primary-orange);
}
.carousel-fixed-details p, .carousel-fixed-details ul {
    color: #BDBDBD;
    margin-bottom: 1rem;
}
.carousel-image {
    position: relative;
    width: 100%;
    height: 600px; /* Default height for vertical layout */
    background-color: transparent;
    overflow: hidden;
}
.carousel-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Default fit */
    min-width: 100%;
    min-height: 100%;
    display: block;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* --- Diseño Horizontal para Carruseles --- */
.carousel-content.horizontal-layout {
    flex-direction: row;
    align-items: stretch; 
    border: 1px solid #2D3748;
}
.carousel-content.horizontal-layout .carousel-image {
    width: 40%; 
    height: auto;
    border-radius: 12px 0 0 12px;
}
.carousel-content.horizontal-layout .carousel-image img {
    border-radius: 12px 0 0 12px;
    object-fit: contain; 
}
.carousel-content.horizontal-layout .carousel-fixed-details {
    width: 60%;
    border-radius: 0 12px 12px 0;
    padding: 2.5rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center; 
}

/* === AJUSTE ESPECÍFICO PARA SAN GABRIEL === */
#san-gabriel .carousel-content {
    border: 1px solid #2D3748;
}
#san-gabriel .carousel-image {
    height: 500px; 
}
#san-gabriel .carousel-image img {
    object-fit: contain;
}

/* === AJUSTE ESPECÍFICO PARA ALBORA === */
#albora .carousel-content {
    border: 1px solid #2D3748;
}
#albora .carousel-image {
    height: 500px; 
}
#albora .carousel-image img {
    object-fit: contain;
}

/* === AJUSTES PARA INVERTIR DISEÑO === */
#san-fernando .carousel-content.horizontal-layout,
#skyline .carousel-content.horizontal-layout {
    flex-direction: row-reverse;
}
#san-fernando .carousel-content.horizontal-layout .carousel-image,
#skyline .carousel-content.horizontal-layout .carousel-image {
    border-radius: 0 12px 12px 0;
}
#san-fernando .carousel-content.horizontal-layout .carousel-image img,
#skyline .carousel-content.horizontal-layout .carousel-image img {
    border-radius: 0 12px 12px 0;
}
#san-fernando .carousel-content.horizontal-layout .carousel-fixed-details,
#skyline .carousel-content.horizontal-layout .carousel-fixed-details {
    border-radius: 12px 0 0 12px;
}

.carousel-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0,0,0,0.6);
    color: white;
    padding: 1rem 1.25rem;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
}
.carousel-nav-btn:hover {
    background-color: var(--primary-orange);
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 5px 15px rgba(255,107,53,0.3);
}
.carousel-thumbnails {
    display: flex;
    justify-content: flex-start;
    gap: 12px;
    margin-top: 1.5rem;
    width: 100%;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    padding-bottom: 10px;
}
.carousel-thumbnails::-webkit-scrollbar { display: none; }
.carousel-thumbnails { -ms-overflow-style: none; scrollbar-width: none; }
.thumbnail-item {
    width: 100px;
    height: 65px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s ease;
    flex-shrink: 0;
    scroll-snap-align: start;
}
.thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}
.thumbnail-item:hover img { transform: scale(1.1); }
.thumbnail-item.active {
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 3px rgba(255,107,53,0.5);
    transform: scale(1.05);
}

/* Ocultar botones y miniaturas si solo hay una imagen */
.single-image-carousel .carousel-nav-btn,
.single-image-carousel .carousel-thumbnails {
    display: none;
}

/* --- Premium Living --- */
#premium-living {
    background-image: linear-gradient(to bottom, rgba(17, 24, 39, 0.7), rgba(17, 24, 39, 0.9)), url('images/fondo-premium.webp');
    background-size: cover; background-position: center; background-repeat: no-repeat;
}
.feature-icon { font-size: 3.5rem; color: var(--primary-orange); transition: all 0.3s ease; }
.feature-icon:hover { transform: scale(1.2); color: #FF8A50; }

/* --- Formulario de Contacto --- */
.form-input {
    width: 100%; background-color: rgba(45, 55, 72, 0.5); border: 1px solid #4A5568;
    color: #FFFFFF; padding: 14px; border-radius: 8px; transition: all 0.3s ease;
    backdrop-filter: blur(4px); font-size: 1rem;
}
.form-input:focus {
    outline: none; border-color: var(--primary-orange);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.4); background-color: rgba(45, 55, 72, 0.8);
}
#form-status { font-weight: 600; }

/* --- Animaciones y Utilidades --- */
.fade-in, .slide-up { opacity: 0; transition: all 0.8s ease-out; }
.fade-in { transform: translateY(30px); }
.slide-up { transform: translateY(50px); }
.fade-in.visible, .slide-up.visible { opacity: 1; transform: translateY(0); }
.hidden { display: none !important; }
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); }
}

/* --- Lightbox --- */
.lightbox {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.92); backdrop-filter: blur(5px); z-index: 1000;
    align-items: center; justify-content: center; opacity: 0;
    transition: opacity 0.4s ease; flex-direction: column; padding: 20px; box-sizing: border-box;
}
.lightbox.active { display: flex; opacity: 1; }
.lightbox-project-img {
    max-width: 90vw; max-height: 80vh; object-fit: contain;
    border-radius: 8px; margin-bottom: 15px;
}
#lightbox-caption {
    color: #ddd; text-align: center; max-width: 800px;
    font-size: 1.1rem; line-height: 1.6; display: none; padding: 0 15px;
}
.close-lightbox {
    position: absolute; top: 15px; right: 35px; color: white;
    font-size: 45px; font-weight: bold; cursor: pointer; transition: color 0.3s; z-index: 1001;
}
.close-lightbox:hover { color: var(--primary-orange); }

/* --- Partículas Flotantes --- */
.floating-particles, .floating-particles-galeria {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    overflow: hidden; pointer-events: none;
}
.floating-particles .particle, .floating-particles-galeria .particle {
    position: absolute; display: block;
    background: linear-gradient(to bottom, rgba(255, 107, 53, 0.8), rgba(255, 138, 80, 0.5));
    border-radius: 50%;
}
.floating-particles .particle { animation: animate-hero 15s linear infinite; }
@keyframes animate-hero {
    0% { transform: translateY(0) scale(1); opacity: 1; }
    100% { transform: translateY(-100vh) scale(0); opacity: 0; }
}
.floating-particles .particle:nth-child(1) { top: 100%; left: 10%; width: 30px; height: 30px; animation-delay: 0s; animation-duration: 12s;}
.floating-particles .particle:nth-child(2) { top: 100%; left: 20%; width: 20px; height: 20px; animation-delay: 2s; animation-duration: 7s;}
.floating-particles .particle:nth-child(3) { top: 100%; left: 30%; width: 40px; height: 40px; animation-delay: 4s; animation-duration: 8s;}
.floating-particles .particle:nth-child(4) { top: 100%; left: 40%; width: 25px; height: 25px; animation-delay: 0s; animation-duration: 9s;}
.floating-particles .particle:nth-child(5) { top: 100%; left: 50%; width: 35px; height: 35px; animation-delay: 3s; animation-duration: 6s;}
.floating-particles .particle:nth-child(6) { top: 100%; left: 60%; width: 28px; height: 28px; animation-delay: 6s; animation-duration: 10s;}
.floating-particles .particle:nth-child(7) { top: 100%; left: 70%; width: 32px; height: 32px; animation-delay: 1s; animation-duration: 11s;}
.floating-particles .particle:nth-child(8) { top: 100%; left: 80%; width: 18px; height: 18px; animation-delay: 5s; animation-duration: 8s;}
.floating-particles .particle:nth-child(9) { top: 100%; left: 90%; width: 38px; height: 38px; animation-delay: 2.5s; animation-duration: 9.5s;}

.floating-particles-galeria .particle { animation: animate-galeria 15s linear infinite; }
@keyframes animate-galeria {
    0% { transform: translate(0, 100vh) scale(0); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translate(100vw, -100vh) scale(1); opacity: 0; }
}

/* --- Contacto y Redes Sociales --- */
.contact-item i { color: var(--primary-orange); font-size: 1.5rem; margin-top: 0.25rem; }

.social-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; background-color: #2D3748; color: #E0E0E0;
    border-radius: 50%; font-size: 1.25rem; text-decoration: none; transition: all 0.3s ease;
    flex-shrink: 0;
}
.social-icon:hover {
    background-color: var(--primary-orange); color: #FFFFFF; transform: translateY(-3px);
}
.kite-animation-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 20px;
    border-radius: 50px; background-color: #25D366; color: white !important;
    text-decoration: none; font-weight: 600; font-size: 0.95rem; white-space: nowrap;
    transition: all 0.3s ease; overflow: hidden; position: relative;
}
.kite-animation-btn .fa-brands { font-size: 1.2rem; }
.kite-animation-btn:hover {
    transform: translateY(-3px); box-shadow: 0 10px 30px rgba(37, 211, 102, 0.4); background-color: #1DA851;
}

/* ========================================================== */
/* ===         AJUSTES PARA MÓVIL (ACTUALIZADO)           === */
/* ========================================================== */
@media (max-width: 768px) {
    /* --- CAMBIO REALIZADO (Inicio) --- */
    /* FILTRO PARA CAMBIAR IMAGEN DE FONDO EN MÓVIL */
    .hero-bg {
        /* IMAGEN DE FONDO PARA CELULAR */
        background-image: url('images/celularfon.jpg');
    }
    /* --- CAMBIO REALIZADO (Fin) --- */

    /* MODIFICACIÓN: Ajusta el logo para móviles */
    .fixed-logo {
        top: 20px;
        left: 20px;
    }
    .fixed-logo img {
        height: 110px; /* Tamaño para celular aumentado */
    }
    
    /* AJUSTE PARA LA IMAGEN DE FONDO (RECOMENDADO) */
    #inicio.hero-bg {
        min-height: 85vh; /* La sección ocupará el 85% de la altura de la pantalla */
    }
    
    body { font-size: 14px; }
    section { padding: 3rem 1rem; }
    h2 { font-size: 1.75rem !important; margin-bottom: 1rem; }
    h3 { font-size: 1.15rem !important; }
    p, .contact-item, .feature-icon + p { font-size: 0.875rem; line-height: 1.6; }
    
    #inicio h1 { font-size: 2.1rem !important; line-height: 1.25; }
    #inicio p { font-size: 1rem; }

    .carousel-container {
        padding: 1rem;
        max-width: 95vw;
    }
    .carousel-image {
        height: 400px;
    }
    .carousel-fixed-details {
        padding: 1.5rem;
    }

    .carousel-content.horizontal-layout {
        flex-direction: column;
        border: none;
    }
    .carousel-content.horizontal-layout .carousel-image {
        width: 100%;
        height: 300px;
        border-radius: 12px 12px 0 0;
    }
    .carousel-content.horizontal-layout .carousel-image img {
        border-radius: 12px 12px 0 0;
        object-fit: cover;
        height: 100%;
    }
    .carousel-content.horizontal-layout .carousel-fixed-details {
        width: 100%;
        border-radius: 0 0 12px 12px;
        padding: 1.5rem;
        justify-content: flex-start;
    }

    #contacto .max-w-7xl { 
        grid-template-columns: 1fr; 
        gap: 2rem;
        padding-left: 0;
        padding-right: 0;
    }
}


/* ========================================================== */
/* ===       SOLUCIÓN DEFINITIVA PARA REDES SOCIALES        === */
/* ========================================================== */

#social-links-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center; 
    gap: 1rem; 
}

@media (max-width: 768px) {
    #social-links-container {
        display: grid;
        grid-template-columns: 1fr 1fr;
        justify-items: center;
        gap: 1rem;
    }

    .social-icon {
        /* No changes needed */
    }

    #whatsapp-contact-btn {
        grid-column: 1 / -1;
        width: 100%;
        justify-content: center;
    }
}