:root {
    --corporate-blue: #023d79;
    --corporate-blue-dark: #012a52;
    --corporate-red: #FF0000;
    --corporate-red-dark: #cc0000;
    --text-color: #333333;
    --text-light: #666666;
    --white: #ffffff;
    --gray-light: #f5f5f5;
    --transition-time: 0.3s;
    --box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    --box-shadow-hover: 0 10px 25px rgba(0, 0, 0, 0.12);
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}
    
body {
    font-family: 'Montserrat', sans-serif;
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--white);
    overflow-x: hidden;
    /* CAMBIO: El padding-top debe ser la suma de las alturas de contact-bar y header */
    padding-top: calc(40px + 69.6px); /* 40px de contact-bar y aproximadamente 69.6px de header */
    min-height: 100vh; /* Añadido para que el footer se fije abajo */
    display: flex; /* Añadido para que el footer se fije abajo */
    flex-direction: column; /* Añadido para que el footer se fije abajo */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    padding: 0 1.5rem;
}

.contact-bar {
    background-color: var(--corporate-blue);
    color: var(--white);
    padding: 0.5rem 0;
    font-size: 0.9rem;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1100;
    height: 40px;
    /* CAMBIO: Eliminamos display: flex; align-items: center; de aquí */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* NUEVA REGLA: Para el .container dentro de .contact-bar */
.contact-bar > .container {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    height: 100%; /* Asegura que el contenedor interno ocupe toda la altura */
}

.contact-info {
    /* CAMBIO: Eliminamos propiedades que ahora gestiona el .container padre */
    /* width: 100%; */
    /* max-width: 1200px; */
    /* margin: 0 auto; */
    /* padding: 0 1.5rem; */
    display: flex; /* Mantenemos flex para los elementos internos */
    gap: 3.5rem;
}

.contact-info span { /* Asegura que el span tenga display flex para alinear ícono y texto */
    display: flex;
    align-items: center;
    gap: 0.5rem;
}


.contact-link {
    color: inherit;
    text-decoration: none;
    transition: all var(--transition-time) ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.contact-link:hover {
    color: var(--corporate-red);
    text-decoration: none;
}

.header {
    background-color: var(--corporate-blue);
    padding: 1rem 1.5rem;
    /* CAMBIO: Eliminamos display: flex; justify-content: space-between; align-items: center; de aquí */
    position: fixed;
    width: 100%;
    top: 40px;
    z-index: 1000;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
}

/* NUEVA REGLA: Para el .container dentro de .header */
.header > .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* .container ya gestiona el max-width y margin: 0 auto; */
}

.logo img {
    height: auto;
    max-width: 18rem;
    width: 100%;
    transition: transform 0.3s ease;
}

.logo:hover img {
    transform: scale(1.03);
}

.navbar ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.navbar a {
    color: var(--white);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.05rem;
    position: relative;
    padding: 0.5rem 0;
    transition: all var(--transition-time) ease-in-out;
    letter-spacing: 0.5px;
}

.navbar a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 3px;
    background: var(--corporate-red);
    bottom: 0;
    left: 0;
    transition: width var(--transition-time) ease-in-out;
    border-radius: 3px;
}

.navbar a:hover {
    color: var(--white);
    transform: translateY(-2px);
}

.navbar a:hover::after,
.navbar a.active::after {
    width: 100%;
}

.navbar a.active {
    color: var(--white);
    font-weight: 700;
}

.menu-toggle {
    display: none;
    cursor: pointer;
    padding: 10px;
}

.menu-toggle i {
    color: var(--white);
    font-size: 1.8rem;
}

.legal-content-section {
    padding: 6rem 0;
    background-color: var(--white);
    flex-grow: 1; /* Añadido para que el contenido empuje el footer hacia abajo */
}

.legal-content-section > .container > div {
    max-width: 900px;
    margin: 0 auto;
    line-height: 1.7;
    color: var(--text-color);
}

.legal-content-section h1,
.legal-content-section h2 {
    color: var(--corporate-blue);
    margin-bottom: 25px;
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
}

.legal-content-section h3 {
    color: var(--corporate-blue);
    margin-top: 30px;
    margin-bottom: 15px;
    font-size: 1.8rem;
    font-weight: 700;
}

.legal-content-section p {
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
}

.legal-content-section strong {
    font-weight: 700;
    color: var(--corporate-blue);
}

.legal-content-section a {
    color: var(--corporate-blue);
    text-decoration: underline;
    transition: color var(--transition-time) ease;
}

.legal-content-section a:hover {
    color: var(--corporate-red);
    text-decoration: none;
}

.legal-content-section ul {
    list-style: none;
    padding-left: 20px;
    margin-bottom: 1.5rem;
}

.legal-content-section ul li {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.legal-content-section ul li i {
    color: var(--corporate-red);
    margin-right: 8px;
}

.footer {
    background-color: var(--corporate-blue-dark);
    color: var(--white);
    padding: 3.5rem 0 1.5rem;
    font-size: 0.95rem;
    margin-top: auto; /* Añadido para que el footer se fije abajo */
}

.footer .footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 30px;
    padding-bottom: 2.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    align-items: flex-start;
}

.footer-section {
    min-width: 200px;
    margin-bottom: 1.5rem;
    flex-grow: 1;
    flex-basis: auto;
}

.footer-section:nth-child(1) {
    flex-basis: 250px;
    flex-grow: 0;
}

.footer-section:nth-child(2) {
    flex-basis: 150px;
    flex-grow: 0;
}

.footer-logo {
    width: 18rem;
    height: auto;
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
    margin-left: -14px;
}

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

.about-footer p {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
}

.footer-section h4 {
    font-size: 1.4rem;
    color: var(--white);
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section ul li {
    margin-bottom: 0.8rem;
}

.footer-section ul li a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color var(--transition-time) ease;
}

.footer-section ul li a:hover {
    color: var(--corporate-red);
}

.footer-section p {
    margin-bottom: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.footer-section p .fa-map-marker-alt {
    padding-top: 0.2em;
}

.footer-section p i {
    color: var(--corporate-red);
    font-size: 1rem;
}

.footer-section p a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color var(--transition-time) ease;
}

.footer-section p a:hover {
    color: var(--corporate-red);
}

.social-links a {
    color: var(--white);
    font-size: 1.5rem;
    margin-right: 4.2rem;
    transition: color var(--transition-time) ease;
    text-decoration: none;
}

.social-links a:hover {
    color: var(--corporate-red);
}

.contact-link-footer {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color var(--transition-time) ease;
}

.contact-link-footer:hover {
    color: var(--corporate-red);
}

.separator {
    color: rgba(255, 255, 255, 0.8);
    margin: 0 5px;
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
}

.footer-bottom p {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

.footer-bottom a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color var(--transition-time) ease;
}

.footer-bottom a:hover {
    color: var(--corporate-red);
}

.scroll-to-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--corporate-red);
    color: var(--white);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: var(--box-shadow);
    transition: all var(--transition-time) ease;
    z-index: 999;
    text-decoration: none;
}

.scroll-to-top-btn:hover {
    background-color: var(--corporate-red-dark);
    transform: translateY(-3px);
    box-shadow: var(--box-shadow-hover);
}

@media (max-width: 992px) {
    /* CAMBIO: Logo img en header ya no necesita max-width si el container lo maneja */
    .logo img {
        max-width: 150px; /* Ajuste para que el logo no sea demasiado grande en tabletas */
    }
}

@media (max-width: 768px) {
    body {
        padding-top: 60px; /* Ajuste para cuando contact-bar desaparece */
    }

    .contact-bar {
        display: none;
    }

    .header {
        top: 0;
        padding: 0.8rem; /* Ajuste de padding para móviles */
        /* CAMBIO: No flex-wrap aquí, se gestiona en .header > .container */
        /* flex-wrap: wrap; */
    }
    /* NUEVA REGLA: Para el .container dentro de .header en móviles */
    .header > .container {
        flex-wrap: wrap; /* Permite que el logo y el toggle se envuelvan */
        justify-content: space-between; /* Mantiene la separación entre logo/toggle */
    }

    .menu-toggle {
        display: block;
        order: 1;
    }
    .logo {
        order: 0;
    }
    .logo img {
        max-width: 150px;
    }

    .navbar {
        order: 2;
        width: 100%;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.5s ease-out;
        background-color: var(--corporate-blue);
    }
    .navbar.active {
        max-height: 500px;
        padding: 1rem 0;
    }
    .navbar ul {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .legal-content-section {
        padding: 4rem 0;
    }
    .legal-content-section h1,
    .legal-content-section h2 {
        font-size: 2rem;
        margin-bottom: 2rem;
    }
    .legal-content-section h3 {
        font-size: 1.6rem;
        margin-top: 25px;
        margin-bottom: 12px;
    }
    .legal-content-section p,
    .legal-content-section ul li {
        font-size: 0.95rem;
    }

    .footer .footer-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1.5rem;
    }
    .footer-section {
        min-width: unset;
        width: 100%;
        margin-bottom: 0;
    }
    .footer-section:last-child {
        margin-bottom: 0;
    }
    .footer-section ul {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    .footer-section p {
        justify-content: center;
    }
    .social-links {
        display: flex;
        justify-content: center;
        gap: 1.5rem;
    }
    .social-links a {
        margin-right: 0;
    }

    .footer-section.about-footer {
        max-width: 300px;
        margin-left: auto;
        margin-right: auto;
        padding-bottom: 1.5rem;
    }
    
    .about-footer p {
        font-size: 0.9rem;
    }

    .footer-section:nth-child(3) {
        max-width: 300px;
        margin-left: auto;
        margin-right: auto;
    }
    .footer-section:nth-child(3) p {
        text-align: center;
        word-wrap: break-word;
    }
}

@media (max-width: 576px) {
    /* Ajuste de padding-top para el body para cuando el header es más pequeño */
    body {
        padding-top: 55px;
    }
    .logo img {
        max-width: 120px;
    }
    .footer {
        padding: 2.5rem 0 1rem;
    }
    .footer-section h4 {
        font-size: 1.1rem;
    }
    .footer-section ul li a,
    .footer-section p,
    .footer-bottom p {
        font-size: 0.8rem;
    }
    .footer-section.about-footer {
        max-width: 250px;
    }
    .footer-section:nth-child(3) {
        max-width: 280px;
    }
}