/* Reset y configuración base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

/* Header con fondo blanco - más compacto */
header {
    background: white;
    color: #1e40af;
    padding: 0.5rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    border-bottom: 1px solid #e2e8f0;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    min-height: 60px;
}

.logo-nombre {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-header {
    background: transparent;
    border-radius: 8px;
    padding: 0.25rem;
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.logo-header:hover {
    transform: scale(1.05);
}

.logo-header img {
    max-height: 45px;
    width: auto;
    object-fit: contain;
}

.nombre {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1e40af;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 1.5rem;
    align-items: center;
}

nav a {
    color: #1e40af;
    text-decoration: none;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.95rem;
}

nav a:hover {
    background: #f1f5f9;
    color: #2563eb;
    transform: translateY(-1px);
}

.btn-login {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    text-decoration: none;
    display: inline-block;
    background: #2563eb;
    color: white;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.btn-login:hover {
    background: #1e40af;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

/* Hero Section con imagen de fondo */
.hero {
    background: url("../Recursos/Imagenesempresa/lefoo(3).png") no-repeat center center/cover;
    color: white;
    padding: 8rem 0 5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-top: 60px;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.hero p {
    font-size: 1.3rem;
    margin-bottom: 3rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-btn {
    background: white;
    color: #2563eb;
    padding: 1rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.hero-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    background: #f8fafc;
}

/* Secciones */
.carousel-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.carousel-header {
    text-align: center;
    margin-bottom: 3rem;
}

.carousel-title {
    font-size: 2.5rem;
    color: #1e40af;
    margin-bottom: 1rem;
    font-weight: 700;
}

.carousel-subtitle {
    font-size: 1.1rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

.articles-section {
    background: #f8fafc;
    padding: 4rem 0;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.article-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    border-left: 4px solid #2563eb;
    transition: transform 0.3s ease;
}

.article-card:hover {
    transform: translateY(-3px);
}

.article-card h3 {
    color: #2563eb;
    font-size: 1.4rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.article-card p {
    color: #666;
    line-height: 1.6;
}

.article-card strong {
    color: #1e40af;
    font-weight: 700;
}

.services-carousel {
    background: white;
    padding: 4rem 0;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.service-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #2563eb, #3b82f6);
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.service-icon {
    width: 100px;
    height: 80px;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.service-icon img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.service-card p {
    color: #666;
    margin-bottom: 1.5rem;
}

.btn-quote {
    background: #2563eb;
    color: white;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-quote:hover {
    background: #1e40af;
    transform: translateY(-2px);
}

.contact-section {
    background: #f8fafc;
    padding: 4rem 0;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.contact-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s ease;
}

.contact-card:hover {
    transform: translateY(-3px);
}

.contact-card h3 {
    color: #2563eb;
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.contact-card a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
}

.contact-card a:hover {
    text-decoration: underline;
}

footer {
    background: #1f2937;
    color: white;
    padding: 3rem 0 1rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-section h3 {
    color: #3b82f6;
    margin-bottom: 1rem;
    font-weight: 600;
}

.footer-section p,
.footer-section a {
    color: #d1d5db;
    text-decoration: none;
    margin-bottom: 0.5rem;
    display: block;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 1px solid #374151;
    color: #9ca3af;
}

/* BOTÓN FLOTANTE DE CHAT */
.chat-float-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
    z-index: 999;
    transition: all 0.3s ease;
    border: none;
}

.chat-float-button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(16, 185, 129, 0.6);
}

.chat-float-button svg {
    width: 30px;
    height: 30px;
    fill: white;
}

/* MODAL DEL CHATBOT */
.chat-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.chat-modal.active {
    display: flex;
}

.chat-modal-content {
    background: white;
    border-radius: 20px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
}

.chat-modal-header {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-modal-header h2 {
    font-size: 1.5rem;
    margin: 0;
}

.chat-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.chat-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

#chat-container-modal {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#status-modal {
    text-align: center;
    padding: 0.75rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    font-weight: 600;
    background: #f0fdf4;
    color: #10b981;
    border: 2px solid #d1fae5;
    font-size: 0.9rem;
}

#messages-modal {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 15px;
    margin-bottom: 1rem;
    scroll-behavior: smooth;
    min-height: 300px;
    max-height: 400px;
}

#messages-modal::-webkit-scrollbar {
    width: 8px;
}

#messages-modal::-webkit-scrollbar-track {
    background: #e2e8f0;
    border-radius: 10px;
}

#messages-modal::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 10px;
}

#messages-modal::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

.message {
    margin-bottom: 1.5rem;
    display: flex;
    opacity: 0;
    transform: translateY(10px);
    animation: slideIn 0.3s ease forwards;
}

@keyframes slideIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.cliente {
    justify-content: flex-end;
}

.message.admin {
    justify-content: flex-start;
}

.message > div:first-child {
    max-width: 70%;
    padding: 0.875rem 1.125rem;
    border-radius: 18px;
    word-wrap: break-word;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: relative;
    font-size: 0.95rem;
}

.message.cliente > div:first-child {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.admin > div:first-child {
    background: white;
    color: #1e293b;
    border: 2px solid #e2e8f0;
    border-bottom-left-radius: 4px;
}

.message-time {
    font-size: 0.7rem;
    opacity: 0.7;
    display: block;
    margin-top: 0.5rem;
    font-style: italic;
}

#form-chat-modal {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 15px;
}

#mensaje-modal {
    flex: 1;
    padding: 0.875rem 1.25rem;
    border: 2px solid #e2e8f0;
    border-radius: 50px;
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: all 0.3s ease;
}

#mensaje-modal:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

#form-chat-modal button {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    color: white;
    border: none;
    padding: 0.875rem 2rem;
    border-radius: 50px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

#form-chat-modal button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

#form-chat-modal button:active {
    transform: translateY(0);
}

#form-chat-modal button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.typing-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: white;
    border-radius: 18px 18px 18px 4px;
    border: 2px solid #e2e8f0;
    max-width: fit-content;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #94a3b8;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        gap: 1rem;
    }

    nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero p {
        font-size: 1.1rem;
    }

    .chat-float-button {
        width: 55px;
        height: 55px;
        bottom: 20px;
        right: 20px;
    }

    .chat-modal-content {
        max-height: 95vh;
    }

    .message > div:first-child {
        max-width: 85%;
    }

    #form-chat-modal {
        flex-direction: column;
    }

    #form-chat-modal button {
        width: 100%;
    }
}