/* =========================
   VARIABLES
========================= */
:root {
    --primary: #0d6efd;
    --primary-dark: #0b5ed7;
    --text: #333;
    --muted: #6c757d;

    --card-radius: 16px;
    --card-shadow: 0 5px 15px rgba(0,0,0,0.06);
    --card-shadow-hover: 0 12px 30px rgba(0,0,0,0.15);
}

/* =========================
   HERO
========================= */
.hero-static {
    background: url('assets/img/codigo.jpg') center/cover no-repeat;
    color: #fff;
    padding: 120px 0;
    text-align: center;
}

/* =========================
   ESPACIADO / TITULOS
========================= */
.section-padding {
    padding: 80px 0;
}

.section-title-area {
    margin-bottom: 50px;
    text-align: center;
}

.section-title {
    font-weight: 700;
}

.section-subtitle {
    color: var(--muted);
}

/* =========================
   CARDS
========================= */
.ui-card {
    background: #fff;
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    padding: 25px;
    height: 100%;
    transition: all 0.3s ease;
}

.ui-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: var(--card-shadow-hover);
}

/* ICONO */
.ui-icon {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    font-size: 26px;
    color: var(--primary);
    transition: all 0.3s ease;
}

.ui-card:hover .ui-icon {
    background: var(--primary);
    color: #fff;
}

/* =========================
   TECNOLOGIAS
========================= */
.tech-card {
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
}

.tech-card img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* =========================
   FORM
========================= */
.form-custom {
    border-radius: 10px;
    padding: 12px 14px;
    border: 1px solid #e0e0e0;
}

.form-custom:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(13,110,253,0.1);
}

.form-control.is-invalid { border-color: #dc3545; }
.form-control.is-valid { border-color: #198754; }

.invalid-feedback {
    display: none;
    font-size: 13px;
}

.form-control.is-invalid + .invalid-feedback {
    display: block;
}

/* =========================
   HEADER BASE
========================= */
.site-header {
    position: fixed;
    width: 100%;
    z-index: 1000;
        background: rgba(255,255,255,0.7);
    backdrop-filter: blur(10px);
    padding: 12px 0;
    transition: all 0.3s ease;
}

/* SCROLL */
.site-header.scrolled {
    background: #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

/* LOGO */
.logo {
    height: 45px;
}

/* =========================
   MENU DESKTOP
========================= */
.nav-menu {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 30px;
    margin: 0;
}

.nav-menu li a {
    position: relative;
    display: inline-block;
    color: var(--text);
	font-weight: 600;
    text-decoration: none;
    line-height: 1.2; /* 🔥 clave */
    padding-bottom: 2px; /* pequeño espacio controlado */
}

.nav-menu li a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0; /* 🔥 pegado al texto */
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s ease;
}

.nav-menu li a:hover::after {
    width: 100%;
}

/* =========================
   CTA (CORREGIDO)
========================= */
.nav-cta {
    background: var(--primary);
    color: #fff !important;
    padding: 8px 18px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.25s ease;
}

.nav-cta:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}


/* =========================
   HAMBURGUESA
========================= */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background: #fff;
    transition: 0.3s;
}

/* SCROLLED ICON COLOR */
.site-header.scrolled .menu-toggle span {
    background: #333;
}


/* BOTÓN FLOTANTE */
#chatbot-toggle {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 60px;
    height: 60px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    font-size: 22px;
    z-index: 9999;
    transition: 0.3s;
}

#chatbot-toggle:hover {
    transform: scale(1.1);
}

/* CAJA */
#chatbot-box {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 320px;
    height: 420px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
}

#chatbot-box.open {
    display: flex;
    animation: fadeInUp 0.2s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* HEADER */
#chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--primary);
    color: white;
    padding: 10px;
    font-weight: bold;
}

#chat-close {
    cursor: pointer;
}

/* BODY */
#chat-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 10px;
    overflow-y: auto;
    background: #f7f7f7;
}

/* MENSAJES */
.msg {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 18px;
    margin: 6px 0;
    font-size: 14px;
    line-height: 1.4;
}

.msg.user {
    background: var(--primary);
    color: white;
    align-self: flex-end;
}

.msg.bot {
    background: #e4e6eb;
    align-self: flex-start;
}

/* FOOTER */
#chat-footer {
    display: flex;
    border-top: 1px solid #ddd;
    background: #fff;
}

#chat-input {
    flex: 1;
    border: none;
    padding: 10px;
    outline: none;
}

#chat-send {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0 15px;
    cursor: pointer;
}

/* =========================
   MOBILE
========================= */
@media (max-width: 992px) {

    .menu-toggle {
        display: flex;
        z-index: 1001;
    }


    .site-header .container {
        position: relative;
    }

    .main-navigation {
        display: flex;
        flex-direction: column;
        align-items: flex-start;

        position: fixed;
        top: 0;
        right: -100%;
        width: 260px;
        height: 100vh;

        background: #fff;
        padding: 90px 20px 20px; /* 🔥 espacio real para header */
        transition: right 0.35s cubic-bezier(.77,0,.18,1);

        box-shadow: -5px 0 15px rgba(0,0,0,0.1); /* 👈 mejora visual */
        z-index: 999;
        padding-top: 90px; /* ya lo ajustamos arriba */
    }

    .main-navigation.active {
        right: 0;
    }

    .nav-menu {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        padding: 0;
        margin: 0;
    }

    .nav-menu li {
        width: 100%;
    }

    .nav-menu li a {
        display: block;
        width: 100%;
        padding: 12px 5px;
        border-bottom: 1px solid #eee; /* 👈 orden visual */
    }

    .nav-cta {
        display: block;
        width: 100%;
        margin-top: 15px;
        text-align: center;
    }

    /* overlay */
    .menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.4);
        opacity: 0;
        visibility: hidden;
        transition: 0.3s;
        z-index: 998;
    }

    .menu-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    /* animación */
    .menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }
}