/* --- Variables de Diseño --- */
:root {
    --sap-dark: #020b05;      
    --sap-blue: #1b76d1;      
    --sap-blue-hover: #155eab;
    --tech-accent: #00d5ffe6;   
    --tech-gradient: linear-gradient(135deg, #1b76d1 0%, #4793eb 100%);
    --bg-light: #F4F7F9;      
    --card-bg: #FFFFFF;
    --text-main: #0c0f14;
    --text-light: #64748B;
    --border-color: #e2e8f0;
    --borde-estandar: 8px; 
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset Moderno --- */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    color: var(--text-main);
    background-color: var(--bg-light);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* --- Cabecera --- */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--card-bg);
    padding: 18px 50px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 0;
    z-index: 1000;
    gap: 20px;
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo-principal {
    height: 65px; 
    width: auto;
    object-fit: contain;
    mix-blend-mode: multiply; 
    transition: transform var(--transition-smooth);
}

.logo-principal:hover {
    transform: scale(1.03);
}

nav {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1; 
    gap: 30px; 
}

nav a {
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap; 
    transition: color var(--transition-smooth);
    position: relative;
}

nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--sap-blue);
    transition: width var(--transition-smooth);
}

nav a:hover {
    color: var(--sap-blue);
}

nav a:hover::after {
    width: 100%;
}

/* --- Botones --- */
.btn-tech {
    background: var(--tech-gradient);
    color: #ffffff;
    border: none;
    padding: 12px 28px;
    font-size: 1em;
    font-weight: 600;
    border-radius: var(--borde-estandar);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-tech:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(27, 118, 209, 0.35);
}

header .btn-tech {
    white-space: nowrap; 
    padding: 10px 20px;
    font-size: 0.95em;
}

/* --- Hero Section --- */
.hero {
    text-align: left;
    padding: 140px 60px;
    background: linear-gradient(to right, rgba(2, 11, 5, 0.9) 0%, rgba(10, 25, 47, 0.7) 100%), 
                url('https://res.cloudinary.com/qsbdtbah/image/upload/f_auto,q_auto/WhatsApp_Image_2026-08-05_at_6.51.30_PM_uuiaqy') center/cover no-repeat;
    color: white;
    min-height: 520px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero h1 {
    font-size: 3.2em;
    margin: 0 0 20px 0;
    line-height: 1.2;
    max-width: 700px;
    font-weight: 800;
    letter-spacing: -1px;
}

.hero p {
    font-size: 1.15em;
    color: #E2E8F0;
    max-width: 550px;
    margin-bottom: 35px;
}

/* --- Sección Acerca de Nosotros --- */
.acerca-de {
    padding: 100px 50px;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 60px;
}

.acerca-texto {
    flex: 1;
}

.acerca-texto h2 {
    color: var(--sap-dark);
    font-size: 2.3em;
    margin-bottom: 25px;
    line-height: 1.3;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.acerca-texto p {
    color: var(--text-light);
    font-size: 1.05em;
    margin-bottom: 20px;
}

.acerca-imagen {
    flex: 1;
}

.acerca-imagen img {
    width: 100%;
    border-radius: var(--borde-estandar);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
    transition: transform var(--transition-smooth);
}

.acerca-imagen img:hover {
    transform: scale(1.02);
}

/* --- Secciones Generales --- */
.section-title {
    text-align: center;
    font-size: 2.2em;
    color: var(--sap-dark);
    margin-bottom: 50px;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--tech-gradient);
    margin: 12px auto 0;
    border-radius: 2px;
}

.servicios, .experiencia, .contacto {
    padding: 90px 50px;
    max-width: 1200px;
    margin: 0 auto;
}

/* --- Tarjetas de Servicios --- */
.cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px; 
}

.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color); 
    padding: 40px 25px; 
    flex: 1 1 350px;
    max-width: 370px;
    border-radius: var(--borde-estandar);
    box-shadow: 0 10px 30px rgba(0,0,0,0.02); 
    transition: var(--transition-smooth);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    border-color: var(--sap-blue);
}

.card-icon {
    margin-bottom: 25px;
    display: flex;
    justify-content: center;
}

.card-icon img {
    width: 100px; 
    height: 100px;
    object-fit: contain; 
    transition: transform var(--transition-smooth);
}

.card:hover .card-icon img {
    transform: scale(1.1); 
}

.card h3 {
    color: var(--sap-dark);
    margin: 0 0 15px 0;
    font-size: 1.3em;
    font-weight: 800;
}

.card p:first-of-type {
    color: var(--sap-blue);
    font-size: 0.8em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
    width: 100%;
}

.card p:last-of-type {
    color: var(--text-light);
    font-size: 1em;
    line-height: 1.6;
    margin: 0;
}

/* --- Grid de Experiencia --- */
.experiencia-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px 40px;
    font-size: 1.05em;
    color: var(--sap-dark);
    font-weight: 500;
    background: var(--card-bg);
    padding: 40px;
    border-radius: var(--borde-estandar);
    box-shadow: 0 10px 30px rgba(0,0,0,0.02);
    border: 1px solid var(--border-color);
}

.experiencia-item {
    display: flex;
    align-items: center;
}

.experiencia-item::before {
    content: '✓';
    color: white;
    background: var(--sap-blue);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8em;
    font-weight: bold;
    margin-right: 12px;
    flex-shrink: 0;
}

/* --- Contacto --- */
.contacto-container {
    display: flex;
    gap: 50px;
    background: var(--card-bg);
    padding: 50px;
    border-radius: var(--borde-estandar);
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
    border: 1px solid var(--border-color);
}

form {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

form input, form textarea {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid var(--border-color);
    border-radius: var(--borde-estandar);
    font-family: inherit;
    font-size: 1em;
    background-color: var(--bg-light);
    transition: var(--transition-smooth);
}

form input:focus, form textarea:focus {
    outline: none;
    border-color: var(--sap-blue);
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(27, 118, 209, 0.1);
}

form textarea {
    resize: vertical;
    min-height: 130px;
}

.info-contacto {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.info-contacto h3 {
    color: var(--sap-dark);
    margin-top: 0;
    font-size: 1.5em;
}

/* --- Footer --- */
footer {
    background-color: var(--sap-dark);
    color: #94A3B8;
    text-align: center;
    padding: 30px;
    font-size: 0.9em;
    margin-top: 60px;
}

/* --- Botón Flotante (Toggle del Chatbot) --- */
.floating-btn {
    position: fixed;
    bottom: 30px; 
    right: 30px;
    width: 65px;
    height: 65px;
    background-color: #ffffff;
    border-radius: 50%;
    box-shadow: 0 10px 25px rgba(0, 51, 102, 0.2); 
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: 2px solid var(--sap-blue);
}

.floating-btn:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 30px rgba(0, 51, 102, 0.3);
}

/* --- Ventana del Chatbot --- */
.chat-window {
    position: fixed;
    bottom: 110px; 
    right: 30px;
    width: 340px;
    max-height: 75vh;
    background: var(--card-bg);
    border-radius: var(--borde-estandar);
    box-shadow: 0 20px 40px rgba(0, 51, 102, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
    border: 1px solid var(--border-color);
    opacity: 0;
    transform: translateY(15px);
    pointer-events: none;
    transition: var(--transition-smooth);
}

.chat-window.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.chat-header {
    background: var(--sap-dark);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid var(--sap-blue);
}

.chat-header button {
    background: none;
    border: none;
    color: white;
    font-size: 1.5em;
    cursor: pointer;
    transition: color var(--transition-smooth);
}

.chat-header button:hover {
    color: var(--sap-blue);
}

.chat-messages {
    height: 340px;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: var(--bg-light);
}

.message-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.message-wrapper.user {
    justify-content: flex-end;
}

.bot-avatar {
    width: 32px;
    height: 32px;
    min-width: 32px;
    background: var(--sap-blue);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.9em;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 0.9em;
    line-height: 1.4;
    word-wrap: break-word;
}

.bot-message {
    background: white;
    color: var(--sap-dark);
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    border: 1px solid var(--border-color);
}

.user-message {
    background: var(--sap-blue);
    color: white;
    border-bottom-right-radius: 4px;
    box-shadow: 0 2px 5px rgba(27, 118, 209, 0.2);
}

.quick-replies {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.quick-reply-btn {
    background: white;
    border: 1px solid var(--sap-blue);
    color: var(--sap-blue);
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 0.8em;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.quick-reply-btn:hover {
    background: var(--sap-blue);
    color: white;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 5px;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background-color: #94A3B8;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
}

.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

.chat-input {
    display: flex;
    padding: 15px;
    background: white;
    border-top: 1px solid var(--border-color);
}

.chat-input input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    outline: none;
    font-family: inherit;
    transition: var(--transition-smooth);
}

.chat-input input:focus {
    border-color: var(--sap-blue);
    box-shadow: 0 0 0 2px rgba(27, 118, 209, 0.1);
}

.chat-input button {
    background: var(--sap-blue);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    margin-left: 10px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.chat-input button:hover {
    transform: scale(1.05);
    background: var(--sap-blue-hover);
}

/* --- Responsividad Mejorada --- */
@media (max-width: 900px) {
    .acerca-de, .contacto-container {
        flex-direction: column;
        text-align: center;
        padding: 40px 20px;
    }
    .hero {
        padding: 100px 20px;
        text-align: center;
        align-items: center;
    }
    .hero h1 {
        font-size: 2.4em;
    }
    header {
        flex-direction: column;
        gap: 15px;
        padding: 15px 20px;
    }
    nav {
        gap: 15px;
        flex-wrap: wrap;
    }
    .chat-window {
        width: calc(100vw - 40px);
        right: 20px;
        bottom: 95px;
    }
}