:root {
    --azul-drad: #003366;
    --azul-brillante: #00509d;
    --gris-fondo: #f4f7f6;
    --blanco: #ffffff;
    --oscuro: #1a1a1a;
    --sombra: 0 10px 30px rgba(0,0,0,0.15);
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: 'Segoe UI', sans-serif; 
}

body { 
    line-height: 1.6; 
    color: var(--oscuro); 
    overflow-x: hidden; 
}

/* --- NAVEGACIÓN --- */
.navbar { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 20px 5%; 
    background: var(--blanco); 
    position: fixed; 
    width: 100%; 
    z-index: 1000; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); 
}

.logo { 
    font-size: 1.5rem; 
    font-weight: bold; 
    color: var(--azul-drad); 
}

.nav-links { 
    display: flex; 
    list-style: none; 
}

.nav-links li { 
    margin-left: 20px; 
}

.nav-links a { 
    text-decoration: none; 
    color: var(--oscuro); 
    font-weight: 500; 
}

/* --- HERO --- */
.hero { 
    height: 80vh; 
    background: linear-gradient(rgba(0,51,102,0.7), rgba(0,0,0,0.8)), 
                url('https://images.unsplash.com/photo-1513828583688-c52646db42da?q=80&w=2000'); 
    background-size: cover; 
    background-position: center; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    text-align: center; 
    color: var(--blanco); 
    padding: 0 5%;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 30px;
}

.hero .btn-primary {
    display: inline-block;
    background-color: var(--azul-brillante);
    color: white !important; 
    padding: 15px 40px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.hero .btn-primary:hover {
    background-color: white;
    color: var(--azul-drad) !important;
    transform: translateY(-3px);
}

/* --- ESPECIALIDADES --- */
.services { 
    padding: 80px 5%; 
    background: var(--gris-fondo); 
    text-align: center; 
}

.services-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); 
    gap: 20px; 
}

.service-card { 
    background: white; 
    border-radius: 8px; 
    overflow: hidden; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.1); 
    transition: transform 0.3s ease, box-shadow 0.3s ease; 
    cursor: pointer;
    animation: fadeInUp 0.8s ease backwards;
}

.service-card:hover { 
    transform: translateY(-10px); 
    box-shadow: 0 15px 35px rgba(0,0,0,0.2); 
}

.service-card img { 
    width: 100%; 
    height: 180px; 
    object-fit: cover; 
}

.services h2 {
    margin-bottom: 60px; 
    text-align: center;
    color: var(--azul-drad);
}

.service-info i {
    transition: transform 0.5s ease;
    display: inline-block;
    color: var(--azul-brillante);
    margin-bottom: 10px;
    font-size: 2rem;
}

.service-card:hover .service-info i {
    transform: rotateY(360deg);
}

/* --- PROYECTOS --- */
.projects-gallery-section { 
    padding: 100px 5%; 
    background: var(--blanco); 
}

.project-entry { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 40px; 
    background: var(--gris-fondo); 
    padding: 30px; 
    border-radius: 12px; 
    margin-bottom: 30px;
    align-items: center;
}

.project-details h3 { 
    color: var(--azul-drad); 
    margin-bottom: 15px; 
    border-left: 4px solid var(--azul-brillante); 
    padding-left: 15px; 
}

.badge {
    background: var(--azul-brillante);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
    display: inline-block;
    margin-bottom: 10px;
}

.task-list { 
    list-style: none; 
    padding-left: 15px; 
}

.task-list li { 
    margin-bottom: 5px; 
    font-size: 0.9rem; 
}

.task-list li::before { 
    content: "✓ "; 
    color: var(--azul-brillante); 
    font-weight: bold; 
}

.photo-grid-4 { 
    display: grid; 
    grid-template-columns: repeat(2, 1fr); 
    gap: 10px; 
}

.photo-slot { 
    background: #e0e0e0; 
    height: 120px; 
    border-radius: 8px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    overflow: hidden;
    border: 1px dashed #ccc;
}

.photo-slot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- CHATBOT FLOTANTE (REDUCIDO PARA MÓVIL) --- */
#chat-widget-container { 
    position: fixed; 
    bottom: 20px; 
    right: 5px; 
    z-index: 10001; 
    display: flex;
    flex-direction: column;
    align-items: flex-end; 
}

#chat-window {
    display: none; 
    width: 350px;         
    height: 95vh;         
    max-height: 550px;    
    background: white;
    border-radius: 15px; 
    box-shadow: var(--sombra);
    margin-bottom: 10px; 
    overflow: hidden; 
    flex-direction: column;
    border: 1px solid #ddd;
    transition: all 0.3s ease;
}

/* ESTE BLOQUE CORRIGE EL ANCHO EN CELULAR */
@media (max-width: 480px) {
    #chat-window {
        width: 98vw;       /* Se reduce al 75% del ancho de pantalla */
        max-width: 350px;  /* No deja que pase de 300px en celulares grandes */
        height: 90vh;      
    }
}

#chat-header {
    background: var(--azul-drad); 
    color: white; 
    padding: 12px;
    display: flex; 
    justify-content: space-between; 
    align-items: center;
}

#chat-header button { 
    background: none; 
    border: none; 
    color: white; 
    font-size: 20px; 
    cursor: pointer; 
}

#chat-window iframe { 
    width: 100%; 
    height: 100%; 
    border: none;
}

#chat-button {
    width: 55px; 
    height: 55px; 
    border-radius: 50%; 
    background: var(--azul-drad);
    color: white; 
    border: 2px solid white; 
    cursor: pointer; 
    font-size: 22px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: 0.3s;
}

#chat-button:hover { transform: scale(1.1); }

/* --- CONTACTO --- */
.contact {
    padding: 80px 5%;
    background-color: var(--blanco);
    text-align: center;
}

.contact-form {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 15px; 
    background: var(--gris-fondo);
    padding: 30px;
    border-radius: 12px;
}

/* --- FOOTER --- */
footer {
    background-color: #001a33; 
    color: #ffffff;
    text-align: center;
    padding: 15px 0; 
    width: 100vw; 
    position: relative;
    left: 50%;
    margin-left: -50vw;
    box-sizing: border-box;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    .hero h1 { font-size: 2rem; }
    .project-entry { grid-template-columns: 1fr; }
}