/* Variables de Colores */
:root {
    --brandy-blue: #000080; /* Un azul brillante pero profundo, como el brandy */
    --accent-red: #FF4500;   /* Rojo naranja vibrante (Orangered) - Más luminoso */
    --deep-red: #DC143C;   /* Rojo intenso (mantenido para detalles clave como el h2::after) */
    --text-dark: #333;
    --text-light: #f4f4f4;
    --bg-light: #ffffff;
    --bg-dark: #222;
}

/* Fuentes */
body {
    font-family: 'Montserrat', sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
}

h1, h2, h3, h4 {
    font-family: 'Oswald', sans-serif;
    color: var(--brandy-blue);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.main-header {
    background-color: var(--bg-light);
    padding: 15px 0;
    border-bottom: 2px solid var(--accent-red); /* Cambiado */
    position: relative;
    overflow: hidden; /* Para el carrusel */
}

.main-header .logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.main-header .logo img {
    height: 100px;
    margin-right: 15px;
}

.main-header .logo h1 {
    margin: 0;
    color: var(--brandy-blue);
    font-size: 2.2em;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.main-header .logo h1:hover {
    color: var(--accent-red); /* Cambiado */
    transform: scale(1.05);
}

.main-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    gap: 30px;
}

.main-nav a {
    text-decoration: none;
    color: var(--brandy-blue);
    font-weight: 700;
    font-size: 1.1em;
    padding: 10px 15px;
    position: relative;
    transition: all 0.3s ease;
}

.main-nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 3px;
    background-color: var(--accent-red); /* Cambiado */
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    transition: width 0.3s ease-in-out;
}

.main-nav a:hover {
    color: var(--accent-red); /* Cambiado */
}

.main-nav a:hover::after {
    width: 100%;
}

/* Carrusel del Header */
.header-carousel {
    position: relative;
    width: 100%;
    height: 500px; /* Altura del carrusel */
    margin-top: 20px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.carousel-slide.active {
    opacity: 1;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-nav {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.carousel-nav .dot {
    width: 12px;
    height: 12px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.carousel-nav .dot.active {
    background-color: var(--accent-red); /* Cambiado */
    transform: scale(1.2);
}

/* Estilos para el texto superpuesto en el carrusel */
.carousel-text {
    position: absolute;
    bottom: 50%; /* Centra verticalmente */
    left: 50%; /* Centra horizontalmente */
    transform: translate(-50%, 50%); /* Ajuste para centrado perfecto */
    background-color: rgba(0, 0, 0, 0.6); /* Fondo semi-transparente para legibilidad */
    color: var(--text-light); /* Color del texto (blanco) */
    padding: 15px 30px;
    font-size: 2.5em; /* Tamaño de fuente grande */
    font-weight: 700;
    text-align: center;
    border-radius: 8px;
    opacity: 0; /* Oculto por defecto */
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
    width: 80%; /* Ancho del texto */
    box-sizing: border-box; /* Incluir padding en el ancho */
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5); /* Sombra para mejor legibilidad */
}

/* El texto solo se muestra cuando la diapositiva está activa */
.carousel-slide.active .carousel-text {
    opacity: 1;
    transform: translate(-50%, 50%) scale(1.05); /* Efecto de ligera escala al aparecer */
}

/* Ajuste para dispositivos móviles */
@media (max-width: 768px) {
    .carousel-text {
        font-size: 1.5em; /* Tamaño de fuente más pequeño para móviles */
        padding: 10px 20px;
        bottom: 20%; /* Posiciona el texto más arriba en móviles */
    }
}


/* Secciones Generales */
section {
    padding: 80px 0;
    text-align: center;
}

section:nth-of-type(even) {
    background-color: #f9f9f9;
}

h2 {
    font-size: 2.8em;
    margin-bottom: 40px;
    position: relative;
    display: inline-block;
    color: var(--brandy-blue);
    transition: color 0.3s ease;
}

h2:hover {
    color: var(--accent-red); /* Cambiado */
}

h2::after {
    content: '';
    position: absolute;
    width: 80px;
    height: 4px;
    background-color: var(--deep-red); /* Se mantiene rojo intenso para esta línea */
    left: 50%;
    bottom: -10px;
    transform: translateX(-50%);
    border-radius: 2px;
}

h4 {
    font-size: 1.0em;
    margin-bottom: 40px;
    position: relative;
    display: inline-block;
    color: #FF4500;
    transition: color 0.3s ease;
}

h5 {
    font-size: 1.5em;
    margin-bottom: 40px;
    position: relative;
    display: inline-block;
    color: #f4f4f4;
    transition: color 0.3s ease;
}


/* Botones */
.btn-primary, .btn-secondary {
    display: inline-block;
    padding: 15px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1em;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    margin-top: 20px;
}

.btn-primary {
    background-color: var(--accent-red); /* Cambiado */
    color: var(--text-light);
    box-shadow: 0 4px 8px rgba(255,69,0,0.5); /* Sombra ajustada al nuevo rojo */
}

.btn-primary:hover {
    background-color: var(--brandy-blue);
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,128,0.4);
}

.btn-secondary {
    background-color: var(--brandy-blue);
    color: var(--text-light);
    box-shadow: 0 4px 8px rgba(0,0,128,0.3);
}

.btn-secondary:hover {
    background-color: var(--accent-red); /* Cambiado */
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(255,69,0,0.5); /* Sombra ajustada al nuevo rojo */
}

/* Hero Section */
.hero-section {
    background: linear-gradient(rgba(0,0,128,0.7), rgba(0,0,128,0.7)), url('https://via.placeholder.com/1500x700/000080/FFFFFF?text=Fondo+Legal') no-repeat center center/cover;
    color: var(--text-light);
    padding: 10px 20px;
}

.hero-content h2 {
    color: var(--text-light);
    font-size: 3.5em;
    margin-bottom: 20px;
}
.hero-content h2::after {
    background-color: var(--accent-red); /* Cambiado */
}


.hero-content p {
    font-size: 1.3em;
    max-width: 800px;
    margin: 0 auto 30px;
    
}

/* Services Section */
.services-section .service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 50px;
   
}


.service-card {
    background-color: var(--bg-light);
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
   
}


.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.service-card h3 {
    color: var(--brandy-blue);
    font-size: 1.8em;
    margin-bottom: 15px;
    position: relative;
    padding-bottom: 10px;
}

.service-card h3::after {
    content: '';
    position: absolute;
    width: 60px;
    height: 3px;
    background-color: var(--accent-red); /* Cambiado */
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
}

.service-card ul {
    list-style: none;
    padding: 0;
    margin-top: 15px;
    text-align: left;
}

.service-card ul li {
    margin-bottom: 8px;
    font-size: 1.05em;
    position: relative;
    padding-left: 25px;
}

.service-card ul li::before {
    content: '✅'; /* Un checkmark divertido */
    position: absolute;
    left: 0;
    color: var(--accent-red); /* Cambiado */
}


/* Products Section */
.products-section .product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.product-card {
    background-color: var(--bg-light);
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.product-card h3 {
    color: var(--brandy-blue);
    font-size: 1.8em;
    margin-bottom: 15px;
    position: relative;
    padding-bottom: 10px;
}

.product-card h3::after {
    content: '';
    position: absolute;
    width: 60px;
    height: 3px;
    background-color: var(--accent-red); /* Cambiado */
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
}

.product-card ul {
    list-style: none;
    padding: 0;
    margin-top: 15px;
    text-align: left;
}

.product-card ul li {
    margin-bottom: 8px;
    font-size: 1.05em;
    position: relative;
    padding-left: 25px;
}

.poduct-card ul li::before {
    content: '✅'; /* Un checkmark divertido */
    position: absolute;
    left: 0;
    color: var(--accent-red); /* Cambiado */
}



/* Contact Section */
.contact-section .contact-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 10px;
    margin-top: 20px;
}

.contact-option {
    background-color: var(--bg-light);
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.contact-option:hover {
    transform: translateY(-10px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.contact-option h3 {
    color: var(--brandy-blue);
    font-size: 1.8em;
    margin-bottom: 20px;
}

.contact-form input,
.contact-form textarea {
    width: calc(100% - 20px);
    padding: 12px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1em;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
    border-color: var(--accent-red); /* Cambiado */
    box-shadow: 0 0 8px rgba(255,69,0,0.3); /* Sombra ajustada al nuevo rojo */
    outline: none;
}

/* Clients Section */
.clients-section {
    background-color: var(--brandy-black);
    color: var(--text-light);
}

.clients-section h2 {
    color: var(--bg-light: #ffffff);
}
.clients-section h2::after {
    background-color: var(--accent-red); /* Cambiado */
}

.client-testimonials {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 30px;
    margin-top: 50px;
}

.cards-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 3 columnas iguales */
  gap: 20px; /* espacio entre columnas y filas */
  justify-items: center; /* centra las cards en su celda */
  padding: 20px;
}

.testimonial-card {
    background-color: var(--bg-dark);
    border-radius: 10px;
    padding: 30px;
    max-width: 250px;
    text-align: left;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: transform 0.3s ease, background-color 0.3s ease;
}


.testimonial-card:hover {
    transform: translateY(-10px);
    background-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.testimonial-card p {
    font-style: italic;
    font-size: 0.8em;
    margin-bottom: 15px;
    color: var(--text-light);
}

.testimonial-card h4 {
    color: var(--accent-red); /* Cambiado */
    font-size: 0.8em;
    margin: 0;
}

/* Footer */
.main-footer {
    background-color: var(--bg-dark);
    color: var(--text-light);
    padding: 30px 0;
    text-align: center;
    border-top: 2px solid var(--accent-red); /* Cambiado */
}

.main-footer p {
    margin: 5px 0;
    font-size: 0.9em;
}

/* Chatbot */
.chatbot-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 350px;
    height: 450px;
    background-color: var(--bg-light);
    border-radius: 15px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
    display: none; /* Oculto por defecto */
    flex-direction: column;
    overflow: hidden;
    z-index: 1000;
    border: 2px solid var(--brandy-blue);
}

.chatbot-header {
    background-color: var(--brandy-blue);
    color: var(--text-light);
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.2em;
    border-top-left-radius: 13px;
    border-top-right-radius: 13px;
}

.chatbot-header h3 {
    margin: 0;
    color: var(--text-light);
}

.chatbot-header .close-chatbot {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1.8em;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.chatbot-header .close-chatbot:hover {
    transform: rotate(90deg);
    color: var(--deep-red);
}

.chatbot-body {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: #e9e9e9;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.message {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 15px;
    word-wrap: break-word;
}

.message.bot {
   background-color: #ADD8E6; /* Un azul claro (Light Blue) */
    color: var(--text-dark); /* Cambiamos el color del texto a oscuro para mejor contraste */
    align-self: flex-start;
    border-bottom-left-radius: 0;
}

.message.user {
    background-color: var(--brandy-blue);
    color: var(--text-light);
    align-self: flex-end;
    border-bottom-right-radius: 0;
}

.chatbot-footer {
    display: flex;
    padding: 15px;
    border-top: 1px solid #ccc;
    background-color: var(--bg-light);
}

.chatbot-footer input {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 20px;
    margin-right: 10px;
    font-size: 1em;
}

.chatbot-footer button {
    background-color: var(--accent-red); /* Cambiado */
    color: var(--text-light);
    border: none;
    border-radius: 20px;
    padding: 10px 20px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.chatbot-footer button:hover {
    background-color: var(--brandy-blue);
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-nav ul {
        flex-direction: column;
        gap: 10px;
    }

    .main-header .logo h1 {
        font-size: 1.8em;
    }

    .carousel-slide {
        height: 300px;
    }

    h2 {
        font-size: 2em;
    }

    .hero-content h2 {
        font-size: 2.5em;
    }

    .service-grid, .contact-options {
        grid-template-columns: 1fr;
    }

    .testimonial-card {
        max-width: 100%;
    }

    .chatbot-container {
        width: 90%;
        right: 5%;
        left: 5%;
        bottom: 20px;
        height: 400px;
    }
}