:root {
    --primary-color: #ff0000;
    --text-color: #333333;
    --bg-light: #f5f5f5;
    --white: #ffffff;
    --black: #000000;
    --gray: #888888;
    --light-gray: #f8f8f8;
    --orange: #ff6b35;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Montserrat', sans-serif; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* Header Styles */
#header {
    position: fixed;
    width: 100%;
    background: var(--white);
    padding: 20px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 1000;
    transition: all 0.3s ease;
    top: 0;
    left: 0;
}
#header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}
.logo img { height: 100px; transition: height 0.3s ease; }
.nav-content { display: flex; align-items: center; gap: 40px; }
nav ul { display: flex; list-style: none; gap: 30px; }
nav a { text-decoration: none; color: var(--text-color); font-weight: 600; font-size: 1.2rem; transition: color 0.3s ease; }
nav a:hover { color: var(--primary-color); }
.contact-btn {
    background: transparent !important;
    color: var(--primary-color) !important;
    border: 2px solid var(--primary-color) !important;
    padding: 13px 25px;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: 600;
    transition: all 0.3s ease;
}
.contact-btn:hover {
    background: var(--primary-color) !important;
    color: var(--white) !important;
}
.header-social { display: flex; gap: 15px; }
.header-social a { color: var(--text-color); font-size: 1.5rem; transition: color 0.3s ease; }
.header-social a:hover { color: var(--primary-color); }

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
}
.menu-toggle i { font-size: 24px; color: var(--text-color); }

/* ============ MOBILE MENU FIX ============ */
@media (max-width: 767px) {
    #header { 
        padding: 15px 0; 
    }
    
    #header .container {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .logo { 
        display: block;
        position: relative;
        z-index: 1001;
    }
    
    .logo img { 
        height: 60px; 
        display: block;
    }
    
    .menu-toggle { 
        display: block;
        position: relative;
        z-index: 1001;
    }
    
    .nav-content {
        position: fixed;
        top: 80px; /* Cambiado de 0 a 80px para que empiece justo debajo del header */
        left: -100%;
        width: 100%;
        height: calc(100vh - 80px); /* Ajustado para que ocupe el resto de la pantalla */
        background: var(--white);
        flex-direction: column;
        justify-content: flex-start; /* Cambiado de center a flex-start */
        align-items: center;
        padding: 20px 20px 30px 20px; /* Reducido el padding superior */
        transition: all 0.3s ease;
        z-index: 1000;
    }
    
    .nav-content.active { left: 0; }
    nav ul { flex-direction: column; align-items: center; gap: 25px; margin-top: 10px; } /* Agregado margin-top */
    nav a { font-size: 1.5rem; }
    .contact-btn { padding: 15px 30px !important; font-size: 1.3rem !important; }
    .header-social { margin-top: 20px; gap: 20px; } /* Reducido margin-top */
    .header-social a { font-size: 1.8rem; }
    main { padding-top: 100px !important; }
    body.no-scroll { overflow: hidden; }
}

/* Estilos para la navegación móvil directa (links e iconos debajo del header) */
.mobile-nav-container {
    display: none;
}

@media (max-width: 767px) {
    .mobile-nav-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 20px 0;
        margin-bottom: 30px;
    }
    
    .mobile-nav-links {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        margin-bottom: 20px;
    }
    
    .mobile-nav-links a {
        text-decoration: none;
        color: var(--text-color);
        font-weight: 600;
        font-size: 1.5rem;
        margin: 8px 0;
        text-align: center;
    }
    
    .mobile-nav-links .contact-btn-mobile {
        background: transparent;
        color: var(--primary-color);
        border: 2px solid var(--primary-color);
        padding: 12px 25px;
        border-radius: 8px;
        font-size: 1.2rem;
        font-weight: 600;
        transition: all 0.3s ease;
        display: inline-block;
        margin-top: 5px;
        width: 80%;
        max-width: 250px;
    }
    
    .mobile-social-icons {
        display: flex;
        justify-content: center;
        gap: 25px;
        margin-top: 10px;
    }
    
    .mobile-social-icons a {
        color: var(--text-color);
        font-size: 1.8rem;
        transition: color 0.3s ease;
    }
    
    .mobile-social-icons a:hover {
        color: var(--primary-color);
    }
    
    .page-title {
        margin-top: 20px !important;
        margin-bottom: 30px !important;
    }
}

/* Projects Grid */
main {
    padding-top: 160px;
    padding-bottom: 60px;
    background: var(--bg-light);
    min-height: 100vh;
    transition: padding-top 0.3s;
}

/* Ajuste extra para evitar que el contenido quede tapado en móvil */
@media (max-width: 767px) {
    main { padding-top: 100px !important; }
}
@media (max-width: 479px) {
    main { padding-top: 90px !important; }
}

.page-title {
    text-align: center;
    font-size: 3rem;
    color: var(--text-color);
    margin-bottom: 60px;
    font-weight: 700;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    padding: 0 20px;
}

.project-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.project-image {
    width: 100%;
    height: 250px;
    overflow: hidden;
    position: relative;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.project-card:hover .project-image img {
    transform: scale(1.1);
}

.project-content {
    padding: 25px;
}

.project-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 10px;
}

.project-category {
    font-size: 0.95rem;
    color: var(--gray);
    margin-bottom: 20px;
    font-weight: 500;
}

.project-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.project-link:hover {
    color: #cc0000;
    transform: translateX(5px);
}

.project-link i {
    font-size: 0.9rem;
}

/* Estilos para la sección "Más Proyectos" */
.more-projects-section {
    margin-top: 80px;
}

.section-divider {
    border: none;
    height: 1px;
    background-color: #cccccc;
    margin: 0 20px 40px 20px;
}

.more-projects-title {
    text-align: center;
    font-size: 2.2rem;
    color: var(--text-color);
    margin-bottom: 40px;
    font-weight: 700;
    cursor: pointer;
    transition: color 0.3s ease;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

.more-projects-title:hover {
    color: var(--primary-color);
}

.more-projects-title:after {
    content: '\f107';
    font-family: 'Font Awesome 5 Free';
    margin-left: 10px;
    font-weight: 900;
    transition: transform 0.3s ease;
}

.more-projects-title.active:after {
    transform: rotate(180deg);
}

.more-projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease, opacity 0.5s ease;
    opacity: 0;
}

.more-projects-grid.active {
    max-height: 2000px;
    opacity: 1;
    margin-top: 30px;
}

/* Estilos para el slider de imágenes */
.slider {
    position: relative;
    overflow: hidden;
}

.slide-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.slide.active {
    opacity: 1;
}

/* Footer - Estilos actualizados */
footer {
    background: #f0f0f0;
    color: var(--text-color);
    padding: 60px 0 30px 0;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    margin-bottom: 30px;
}

.footer-logo {
    text-align: left;
}

.footer-logo img {
    height: 60px;
    margin-bottom: 15px;
}

.footer-nav h4,
.footer-contact h4,
.footer-social h4 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: var(--primary-color);
    font-weight: 600;
}

.footer-nav ul {
    list-style: none;
}

.footer-nav ul li {
    margin-bottom: 10px;
}

.footer-nav a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-nav a:hover {
    color: var(--primary-color);
}

/* Estilos mejorados para la sección de contacto */
.contact-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
}

.contact-item a {
    display: flex;
    align-items: center;
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.contact-item a:hover {
    color: var(--primary-color);
}

.contact-item i {
    color: var(--primary-color);
    margin-right: 10px;
    min-width: 16px;
    font-size: 1rem;
}

.contact-item span {
    display: inline-block;
    color: var(--text-color);
}

/* Estilos de iconos sociales actualizados - SOLUCIÓN AL PROBLEMA DE LÍNEAS */
.social-links {
    display: flex;
    gap: 15px;
}

.social-links a {
    color: var(--text-color);
    font-size: 1.5rem;
    transition: all 0.3s ease;
    padding: 8px;
    border-radius: 50%;
    background: rgba(255, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    text-decoration: none; /* SOLUCIÓN: elimina el subrayado de los iconos */
}

.social-links a:hover {
    color: var(--white);
    background: var(--primary-color);
    transform: translateY(-3px);
}

/* Responsive Footer */
@media (max-width: 991px) {
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .more-projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* SOLUCIÓN PARA LA VISTA MOBILE */
@media (max-width: 767px) {
    /* Corregido para asegurar que proyectos aparezcan en columna en mobile */
    .projects-grid,
    .more-projects-grid {
        grid-template-columns: 1fr !important; /* !important para asegurar que siempre se aplique */
        gap: 25px;
        padding: 0 15px;
    }
    
    /* Ajustes del footer para mobile */
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 30px;
    }
    
    .footer-logo {
        text-align: center;
    }
    
    .contact-item {
        justify-content: center;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .more-projects-title {
        font-size: 1.8rem;
    }
}

@media (max-width: 479px) {
    .container {
        padding: 0 15px;
    }
    .logo img {
        height: 50px;
    }
    .page-title {
        font-size: 1.8rem;
        margin-bottom: 30px;
    }
    .projects-grid {
        padding: 0 10px;
        gap: 20px;
    }
    .project-content {
        padding: 20px;
    }
    .project-title {
        font-size: 1.2rem;
    }
    nav a {
        font-size: 1.3rem;
    }
    .contact-btn {
        padding: 12px 25px !important;
        font-size: 1.2rem !important;
    }
    .header-social a {
        font-size: 1.6rem;
    }
}
@media (min-width: 1200px) {
    .projects-grid, .more-projects-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
/* Estilos para el botón flotante de WhatsApp */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: flex;
    align-items: center;
    background-color: #25d366;
    color: white;
    border-radius: 50px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    text-decoration: none;
    padding: 15px 25px 10px 20px;
    transition: all 0.3s ease;
    font-family: 'Montserrat', sans-serif;
}

.whatsapp-float:hover {
    background-color: #128C7E;
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3);
}

.whatsapp-float-icon {
    font-size: 32px; /* Tamaño más grande del ícono */
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.whatsapp-float-text {
    font-size: 16px; /* Texto más grande */
    font-weight: 600;
    white-space: nowrap;
}

/* Estilos responsivos para móviles */
@media (max-width: 767px) {
    .whatsapp-float {
        padding: 12px 20px;
        bottom: 20px;
        right: 20px;
    }
    
    .whatsapp-float-icon {
        font-size: 28px; /* Aún grande pero adaptado a móvil */
    }
    
    .whatsapp-float-text {
        font-size: 14px;
    }
}

/* Para pantallas muy pequeñas, solo mostrar el ícono */
@media (max-width: 480px) {
    .whatsapp-float {
        width: 60px;
        height: 60px;
        border-radius: 50%;
        padding: 0;
        justify-content: center;
    }
    
    .whatsapp-float-icon {
        margin-right: 0;
        font-size: 32px;
    }
    
    .whatsapp-float-text {
        display: none;
    }
}
/* Estilos para el chatbot */
.chatbot-container {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 1000;
    font-family: 'Montserrat', sans-serif;
}

.chatbot-toggle {
    display: flex;
    align-items: center;
    background-color: #1a365d;
    color: #ffffff;
    border-radius: 50px;
    padding: 10px 20px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
}

.chatbot-toggle:hover {
    transform: scale(1.05);
    background-color: #2c4a7c;
}

.chatbot-avatar {
    background-color: #ffffff;
    color: #1a365d;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    font-size: 20px;
}

.chatbot-info {
    display: flex;
    flex-direction: column;
}

.chatbot-name {
    font-weight: 600;
    font-size: 14px;
}

.chatbot-status {
    font-size: 12px;
    color: #8cff7a;
}

.chatbot-window {
    position: absolute;
    bottom: 70px;
    left: 0;
    width: 320px;
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease;
    max-height: 500px;
}

.chatbot-header {
    background-color: #1a365d;
    color: #ffffff;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chatbot-header-info {
    display: flex;
    align-items: center;
}

.chatbot-header-avatar {
    background-color: #ffffff;
    color: #1a365d;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    font-size: 20px;
}

.chatbot-header h3 {
    margin: 0;
    font-size: 16px;
}

.chatbot-close {
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
}

.chatbot-messages {
    padding: 15px;
    overflow-y: auto;
    height: 300px;
    display: flex;
    flex-direction: column;
}

.message-container {
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
}

.bot-message {
    align-items: flex-start;
}

.user-message {
    align-items: flex-end;
}

.message-bubble {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 15px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.bot-message .message-bubble {
    background-color: #f0f2f5;
    color: #333;
    border-bottom-left-radius: 5px;
}

.user-message .message-bubble {
    background-color: #1a365d;
    color: #ffffff;
    border-bottom-right-radius: 5px;
}

.message-bubble p {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
}

/* Estilos para los botones de servicios */
.services-buttons-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
    padding-left: 0;
    width: 100%;
}

.service-option-btn {
    background-color: #1a365d;
    color: #ffffff;
    border: none;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    box-shadow: 0 2px 5px rgba(26, 54, 93, 0.2);
    font-family: 'Montserrat', sans-serif;
    width: 100%;
    max-width: 250px;
}

.service-option-btn:hover {
    background-color: #2c4a7c;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(26, 54, 93, 0.3);
}

.service-option-btn:active {
    transform: translateY(0);
}

/* Estilos para el botón de WhatsApp dentro del chat */
.whatsapp-button-container {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 15px;
    padding-left: 0;
}

.whatsapp-chat-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #25D366;
    color: #ffffff;
    border: none;
    border-radius: 25px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
    transition: all 0.3s ease;
    font-family: 'Montserrat', sans-serif;
}

.whatsapp-chat-btn:hover {
    background-color: #128C7E;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
}

.whatsapp-chat-btn i {
    margin-right: 8px;
    font-size: 18px;
}

.chatbot-suggestions {
    padding: 10px 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    border-top: 1px solid #e9e9e9;
}

.suggestion-btn {
    background-color: #f0f2f5;
    border: none;
    border-radius: 15px;
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #333;
}

.suggestion-btn:hover {
    background-color: #e0e2e5;
}

.chatbot-input {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-top: 1px solid #e9e9e9;
}

.chatbot-input input {
    flex: 1;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 8px 15px;
    font-size: 14px;
    outline: none;
}

.chatbot-input button {
    background-color: #1a365d;
    color: white;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    margin-left: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.chatbot-input button:hover {
    background-color: #2c4a7c;
}

/* Responsive styles */
@media screen and (max-width: 767px) {
    .chatbot-window {
        width: 280px;
        left: 0;
        bottom: 70px;
        max-height: 400px;
    }
    
    .chatbot-messages {
        height: 250px;
    }
    
    .chatbot-toggle {
        padding: 8px 15px;
    }
    
    .chatbot-avatar {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
    
    .chatbot-name {
        font-size: 13px;
    }
    
    .chatbot-status {
        font-size: 11px;
    }
    
    .whatsapp-chat-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .service-option-btn {
        font-size: 12px;
        padding: 9px 14px;
    }
}