/* Variables CSS para una gestión de colores moderna y profesional */
:root {
    /* Paleta Premium - Azules Oscuros en consonancia con el logo */
    --primary: #1e40af;
    /* Azul 800 */
    --primary-hover: #1d4ed8;
    /* Azul 700 */
    --secondary: #3b82f6;
    /* Azul 500 */
    --dark: #0f172a;
    /* Azul marino muy oscuro / Slate 900 */
    --text-main: #334155;
    /* Slate 700 - Texto principal suave */
    --text-muted: #64748b;
    /* Slate 500 */
    --bg-light: #f8fafc;
    /* Slate 50 - Fondo general */
    --bg-white: #ffffff;
    --border: #e2e8f0;
    /* Slate 200 */

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.05);
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-light);
    color: var(--text-main);
    line-height: 1.7;
    scroll-behavior: smooth;
    padding-top: 80px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    font-size: 16px;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--dark);
    font-weight: 700;
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* OCULTAR EL ICONO DE RECAPTCHA */
.grecaptcha-badge {
    visibility: hidden;
}

/* --- Navbar --- */
.navbar {
    background-color: var(--bg-white);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    transition: all 0.3s ease;
}

.navbar-brand {
    padding: 0;
}

.navbar-logo {
    max-width: 140px;
    height: auto;
    transition: transform 0.3s ease;
}

.navbar-logo:hover {
    transform: scale(1.05);
}

.navbar-nav .nav-link {
    color: var(--text-main);
    font-weight: 500;
    font-family: var(--font-heading);
    margin: 0 15px;
    padding: 0.5rem 0;
    position: relative;
    transition: color 0.3s ease;
}

.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    bottom: -8px;
    left: 0;
    border-radius: 3px;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar-nav .nav-link:hover::after,
.navbar-nav .nav-link.active::after {
    width: 100%;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--primary);
}

.navbar-toggler {
    border: none;
    box-shadow: none !important;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%230f172a' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* --- Hero Section Parallax Premium --- */
.hero-section {
    background-image: url('img/hero.png');
    background-size: cover;
    background-position: center;
    min-height: 85vh;
    margin-top: -80px;
    padding-top: 80px;
    position: relative;
    z-index: 1;
    background-attachment: fixed;
}

/* Gradient Overlay - Dark to Transparent for tech look */
.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.9) 0%, rgba(15, 23, 42, 0.6) 100%);
    z-index: 2;
}

.hero-section .container {
    padding-top: 100px;
    padding-bottom: 100px;
    z-index: 3;
    position: relative;
}

.main-title {
    font-size: 5.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.1;
    letter-spacing: -1.5px;
    color: var(--bg-white);
}

.hero-subtitle {
    font-size: 1.6rem;
    font-weight: 400;
    color: #cbd5e1;
    /* Slate 300 */
    max-width: 800px;
    margin: 0 auto 3.5rem auto;
    line-height: 1.6;
}

.hero-badge {
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    box-shadow: 0 4px 15px rgba(30, 64, 175, 0.4);
}

.btn-primary {
    background: var(--primary);
    border: none;
    color: var(--bg-white);
}

.hero-cta {
    padding: 1.2rem 3rem;
    font-size: 1.2rem;
    border-radius: 50px;
    font-weight: 600;
    font-family: var(--font-heading);
    background: var(--primary);
    box-shadow: 0 10px 20px rgba(30, 64, 175, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-cta:hover {
    background: var(--primary-hover);
    transform: translateY(-4px);
    box-shadow: 0 15px 25px rgba(30, 64, 175, 0.4);
    color: var(--bg-white);
}

/* --- Títulos de Sección --- */
.section-title {
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 2rem;
    position: relative;
    padding-bottom: 15px;
    display: inline-block;
    letter-spacing: -0.5px;
}

.section-title::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    width: 80px;
    height: 5px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 5px;
}

/* --- Estructura y Scroll Fix --- */
#products,
#services,
#portfolio,
#contact {
    scroll-margin-top: 80px;
}

.products-section,
.services-section,
.portfolio-section,
.contact-section {
    width: 100%;
    padding: 100px 0;
    position: relative;
    overflow: hidden;
}

/* --- Colores de Secciones Modernos --- */
.products-section {
    background-color: var(--bg-white);
}

.services-section {
    background-color: var(--bg-light);
}

.portfolio-section {
    background-color: var(--bg-white);
}

.contact-section {
    background: linear-gradient(to bottom, var(--bg-light) 0%, var(--bg-white) 100%);
}

/* --- Productos Premium --- */
.product-item {
    background: var(--bg-white);
    border-radius: 20px;
    padding: 50px 30px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.product-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-item:hover {
    transform: translateY(-12px);
    box-shadow: var(--shadow-xl);
    border-color: transparent;
}

.product-item:hover::before {
    opacity: 1;
}

.product-icon {
    width: 100%;
    max-width: 250px;
    height: auto;
    margin: 0 auto 25px auto;
    display: block;
    transition: transform 0.5s ease;
}

.product-item:hover .product-icon {
    transform: scale(1.05);
}

.product-item h3 {
    font-size: 2.2rem;
    color: var(--dark);
    font-weight: 700;
    margin-bottom: 15px;
}

.product-item p {
    font-size: 1.15rem;
    color: var(--text-muted);
    flex-grow: 1;
}

.product-item .btn-secondary {
    margin-top: 25px;
    padding: 0.8rem 2rem;
    font-size: 1.05rem;
    border-radius: 50px;
    font-weight: 600;
    font-family: var(--font-heading);
    background-color: var(--bg-light);
    color: var(--primary);
    border: 1px solid var(--primary);
    transition: all 0.3s ease;
}

.product-item .btn-secondary:hover {
    background-color: var(--primary);
    color: var(--bg-white);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(30, 64, 175, 0.2);
}

/* --- Featured AI Service --- */
.featured-ai {
    background: var(--bg-white) !important;
    border: 2px solid rgba(30, 64, 175, 0.1) !important;
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.featured-ai::after {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.1) 0%, rgba(255, 255, 255, 0) 70%);
    border-radius: 50%;
    z-index: 0;
}

.featured-ai .col-md-9 {
    position: relative;
    z-index: 1;
}

.glassmorphism-icon {
    width: 90px;
    height: 90px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(30, 64, 175, 0.1), rgba(236, 72, 153, 0.1));
    border-radius: 20px;
    border: 1px solid rgba(30, 64, 175, 0.2);
    box-shadow: var(--glass-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.featured-ai:hover .glassmorphism-icon {
    transform: rotate(5deg) scale(1.05);
    box-shadow: 0 10px 25px rgba(30, 64, 175, 0.2);
}

.icon-ai {
    font-size: 3.5rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.featured-ai h3 {
    font-size: 2.2rem;
    font-weight: 800;
}

/* --- Servicios Generales --- */
.glass-card {
    background: var(--bg-white);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    padding: 35px 25px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    position: relative;
    overflow: hidden;
}

.glass-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.4) 0%, rgba(255, 255, 255, 0) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(30, 64, 175, 0.2);
}

.glass-card:hover::after {
    opacity: 1;
}

.glass-card i {
    font-size: 3rem;
    margin-bottom: 20px;
    color: var(--primary);
    transition: transform 0.3s ease;
    position: relative;
    z-index: 1;
}

.glass-card:hover i {
    transform: scale(1.1);
}

.glass-card .icon-web {
    color: #f97316;
}

/* Orange */
.glass-card .icon-seo {
    color: #10b981;
}

/* Emerald */
.glass-card .icon-db {
    color: #eab308;
}

/* Yellow */
.glass-card .icon-support {
    color: #06b6d4;
}

/* Cyan */
.glass-card .icon-social {
    color: #ef4444;
}

/* Red */
.glass-card .icon-hosting {
    color: #8b5cf6;
}

/* Violet */

.glass-card h3 {
    font-size: 1.5rem;
    color: var(--dark);
    font-weight: 700;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}

.glass-card p {
    font-size: 1.05rem;
    color: var(--text-muted);
    position: relative;
    z-index: 1;
    margin: 0;
}

/* --- Portfolio --- */
.portfolio-item {
    background-color: var(--bg-white);
    border-radius: 20px;
    padding: 25px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.portfolio-item:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-xl);
}

.portfolio-img {
    border-radius: 12px;
    width: 100%;
    height: auto;
    border: 1px solid var(--border);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.portfolio-item:hover .portfolio-img {
    opacity: 0.9;
    transform: scale(1.02);
}

.portfolio-item h4 {
    font-size: 1.5rem;
    color: var(--dark);
    font-weight: 700;
    margin-top: 20px;
    margin-bottom: 10px;
}

.portfolio-item p {
    font-size: 1.05rem;
    color: var(--text-muted);
    flex-grow: 1;
}

.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
    font-weight: 600;
    border-radius: 50px;
    padding: 0.5rem 1.5rem;
    text-align: center;
    align-self: center;
}

.btn-outline-primary:hover {
    background-color: var(--primary);
    border-color: var(--primary);
    color: var(--bg-white);
    box-shadow: 0 4px 10px rgba(30, 64, 175, 0.25);
}

/* Carrusel JS Styling */
#portfolio-items .carousel-indicators {
    bottom: -40px;
    margin-top: 30px;
    position: relative;
}

#portfolio-items .carousel-indicators button {
    background-color: var(--primary);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    opacity: 0.3;
    transition: all 0.3s ease;
}

#portfolio-items .carousel-indicators button.active {
    opacity: 1;
    width: 20px;
    border-radius: 5px;
}

#portfolio-items .carousel-control-prev,
#portfolio-items .carousel-control-next {
    width: 5%;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

#portfolio-items .carousel-control-prev:hover,
#portfolio-items .carousel-control-next:hover {
    opacity: 1;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    filter: invert(100%);
    /* Hacemos los controles negros si es necesario, o los estilizamos */
    background-color: var(--primary);
    border-radius: 50%;
    padding: 20px;
}

/* --- Contacto --- */
.contact-header {
    margin-bottom: 3.5rem;
}

.contact-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto;
}

.form-container {
    background: var(--bg-white);
    border-radius: 24px;
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--border);
    max-width: 750px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.form-control {
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 1rem 1.2rem;
    font-size: 1.1rem;
    font-family: var(--font-body);
    transition: all 0.3s ease;
    background-color: var(--bg-light);
}

.form-control::placeholder {
    color: #94a3b8;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(30, 64, 175, 0.1);
    background-color: var(--bg-white);
}

.btn-submit {
    padding: 1rem 3rem;
    font-size: 1.2rem;
    font-weight: 600;
    font-family: var(--font-heading);
    border-radius: 50px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    box-shadow: 0 8px 15px rgba(30, 64, 175, 0.2);
    transition: all 0.3s ease;
    color: white;
}

.btn-submit:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 20px rgba(30, 64, 175, 0.3);
}

/* --- Footer --- */
footer {
    background-color: var(--dark);
    color: var(--bg-light);
    border-top-left-radius: 30px;
    border-top-right-radius: 30px;
    padding-top: 40px;
    padding-bottom: 30px;
}

footer p {
    font-size: 1.05rem;
    color: #94a3b8;
    /* Muted en oscuro */
}

.footer-line-2::before {
    content: '- ';
}


/* --- Botón Volver Arriba --- */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    color: var(--bg-white);
    box-shadow: 0 8px 15px rgba(30, 64, 175, 0.3);
    z-index: 1030;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    font-size: 1.2rem;
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 20px rgba(30, 64, 175, 0.4);
    color: white;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}


/* ------------------------------------------- */
/* --- Media Queries --- */
/* ------------------------------------------- */

@media (max-width: 992px) {
    .navbar-collapse {
        background: var(--bg-white);
        margin-top: 1rem;
        padding: 1rem;
        border-radius: 12px;
        box-shadow: var(--shadow-lg);
    }

    .navbar-nav .nav-link {
        margin: 10px 0;
    }

    .main-title {
        font-size: 4rem;
    }

    .hero-subtitle {
        font-size: 1.4rem;
    }

    .section-title {
        font-size: 2.4rem;
    }

    .products-section,
    .services-section,
    .portfolio-section,
    .contact-section {
        padding: 70px 0;
    }
}

@media (max-width: 768px) {
    body {
        padding-top: 70px;
    }

    .navbar {
        padding: 0.8rem 0;
    }

    .navbar-logo {
        max-width: 120px;
    }

    .hero-section {
        background-attachment: scroll;
        min-height: 70vh;
    }

    .main-title {
        font-size: 3rem;
        letter-spacing: -1px;
    }

    .hero-subtitle {
        font-size: 1.2rem;
        background: rgba(15, 23, 42, 0.4);
        padding: 10px;
        border-radius: 10px;
        backdrop-filter: blur(5px);
    }

    .hero-cta {
        padding: 1rem 2rem;
        font-size: 1.1rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .products-section,
    .services-section,
    .portfolio-section,
    .contact-section {
        padding: 60px 0;
    }

    .product-item {
        padding: 40px 20px;
    }

    .product-icon {
        max-width: 200px;
    }

    .featured-ai {
        padding: 25px;
    }

    .featured-ai h3 {
        font-size: 1.8rem;
    }

    .glassmorphism-icon {
        width: 70px;
        height: 70px;
    }

    .icon-ai {
        font-size: 2.8rem;
    }

    .form-container {
        padding: 1.5rem !important;
        border-radius: 16px;
    }

    .btn-submit {
        width: 100%;
    }

    .back-to-top {
        display: none !important;
    }

    .footer-line-1 {
        display: block;
        margin-bottom: 5px;
    }

    .footer-line-2 {
        display: block;
    }

    .footer-line-2::before {
        content: normal !important;
    }
}

/* --- ANIMACIONES --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-animate {
    opacity: 0;
    animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.delay-1 {
    animation-delay: 0.1s;
}

.delay-2 {
    animation-delay: 0.3s;
}

.delay-3 {
    animation-delay: 0.5s;
}

/* --- Ajustes para móviles extra pequeños --- */
@media (max-width: 480px) {
    .main-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .hero-animate {
        animation-duration: 0.6s;
    }

    .products-section,
    .services-section,
    .portfolio-section,
    .contact-section {
        padding: 50px 0;
    }
}

/* Clases utilitarias adicionales para Bootstrap si faltan */
@media (min-width: 768px) {
    .w-md-auto {
        width: auto !important;
    }
}

/* --- AI Chat Agent (Real OpenAI Chat) --- */
.whatsapp-agent {
    position: fixed;
    bottom: 100px;
    right: 30px;
    z-index: 2000;
}

.wa-button-pill {
    display: flex;
    align-items: center;
    background: white;
    padding: 6px 20px 6px 6px;
    border-radius: 50px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border: 2px solid var(--primary);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    outline: none;
}

.wa-button-pill:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(79, 70, 229, 0.2);
}

.wa-avatar-wrapper {
    position: relative;
    width: 45px;
    height: 45px;
    margin-right: 12px;
}

.wa-pill-img {
    width: 45px !important;
    height: 45px !important;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    border: 1px solid #eee;
    transition: all 0.3s ease;
}

.wa-close-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    font-size: 24px;
    color: var(--primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
}

/* Estado activo: El botón se convierte en círculo con cruz */
.wa-button-pill.chat-active {
    width: 56px;
    height: 56px;
    padding: 0 !important;
    justify-content: center;
    border-radius: 50%;
    background: var(--bg-white);
    border-color: var(--primary);
}

.wa-button-pill.chat-active .wa-avatar-wrapper {
    margin-right: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wa-button-pill.chat-active .wa-pill-img {
    opacity: 0;
    transform: scale(0.5);
    position: absolute;
}

.wa-button-pill.chat-active .wa-close-icon {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(90deg) scale(1.1);
    color: var(--primary);
}

.wa-button-pill.chat-active .wa-text-pill,
.wa-button-pill.chat-active .wa-badge-online-pill {
    display: none;
}

.wa-badge-online-pill {
    display: inline-block;
    width: 9px;
    height: 9px;
    background-color: #4ADE80;
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(74, 222, 128, 0.5);
    flex-shrink: 0;
}

.wa-text-pill {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.wa-welcome-text {
    font-size: 0.75rem;
    color: #64748b;
    line-height: 1;
    margin-bottom: 2px;
}

.wa-action-text {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--dark);
    line-height: 1;
}

.wa-badge-online {
    display: inline-block;
    width: 10px;
    height: 10px;
    background-color: #4ADE80;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.4);
    flex-shrink: 0;
}

.wa-header .wa-badge-online {
    width: 10px;
    height: 10px;
}

/* Chat Window */
.wa-chat-window {
    position: absolute;
    bottom: 85px;
    right: 0;
    width: 350px;
    max-width: calc(100vw - 40px);
    background: white;
    border-radius: 20px;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.18);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.wa-chat-window.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.wa-header {
    background: linear-gradient(135deg, var(--dark), var(--primary));
    color: white;
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wa-header h5 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
}

.wa-header p {
    margin: 0;
    font-size: 0.8rem;
    opacity: 0.9;
}

.wa-body {
    height: 380px;
    padding: 20px;
    background-color: #f8fafc;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Fullscreen Mode - Modal Centered on Desktop */
.wa-chat-window.fullscreen {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90vw;
    height: 85vh;
    max-width: 1000px;
    max-height: 800px;
    border-radius: 15px;
    z-index: 2500;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.wa-chat-window.fullscreen .wa-body {
    height: calc(85vh - 140px);
    max-height: 660px;
    flex: 1;
}

/* Maintain Fullscreen on Mobile */
@media (max-width: 768px) {
    .wa-chat-window.fullscreen {
        top: auto;
        bottom: 0;
        left: 0;
        transform: none;
        width: 100vw;
        height: 88dvh;
        max-width: 100vw;
        max-height: 88dvh;
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
    }

    .wa-chat-window.fullscreen .wa-body {
        height: calc(88dvh - 140px);
        max-height: none;
    }

    .wa-header .fullscreen-btn {
        opacity: 1;
        font-size: 1.5rem;
        background: rgba(255, 255, 255, 0.15);
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        transition: background 0.2s;
    }

    .wa-header .fullscreen-btn:active {
        background: rgba(255, 255, 255, 0.25);
    }
}

.wa-header .fullscreen-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
    padding: 5px;
}

.wa-header .fullscreen-btn:hover {
    opacity: 1;
}

/* Chat Bubbles */
.chat-msg {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.5;
    position: relative;
    animation: fadeInMsg 0.3s ease forwards;
}

@keyframes fadeInMsg {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-msg.bot {
    align-self: flex-start;
    background: white;
    color: var(--dark);
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border);
}

.chat-msg.user {
    align-self: flex-end;
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 4px;
}

.wa-footer {
    padding: 15px;
    background: white;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
}

.wa-input {
    flex-grow: 1;
    border: 1px solid var(--border);
    border-radius: 25px;
    padding: 10px 15px;
    font-size: 0.95rem;
    outline: none;
    transition: border 0.3s ease;
}

.wa-input:focus {
    border-color: var(--primary);
}

.wa-send-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.wa-send-btn:hover {
    background: var(--primary-hover);
    transform: scale(1.05);
}

.wa-send-btn:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
}

/* Loading dots */
.typing-dots {
    display: flex;
    gap: 4px;
    padding: 10px;
}

.typing-dots span {
    width: 6px;
    height: 6px;
    background: #94a3b8;
    border-radius: 50%;
    animation: typingJump 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingJump {

    0%,
    80%,
    100% {
        transform: scale(1);
    }

    40% {
        transform: scale(1.5);
    }
}

@media (max-width: 480px) {
    .wa-chat-window {
        width: 320px;
        bottom: 80px;
        right: -10px;
    }
}