: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;
    --gray-medium: #e0e0e0;
    --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;
    overflow-y: auto;
}

body {
    font-family: 'Montserrat', sans-serif;
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--white);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.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: Eliminadas propiedades flex directas de aquí */
    /* display: flex; */
    /* align-items: center; */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* NUEVA REGLA: Para el contenido de contact-bar */
.contact-bar .container {
    display: flex; /* Añade flexbox para alinear el contenido */
    justify-content: flex-end; /* Mantiene al final (derecha) */
    align-items: center;
    height: 100%; /* Asegura que ocupe la altura del padre */
}

.contact-info {
    /* CAMBIO: Eliminadas propiedades de ancho y margen, ahora gestionadas por .contact-bar .container */
    /* width: 100%; */
    /* max-width: 1200px; */
    /* margin: 0 auto; */
    /* padding: 0 1.5rem; */
    display: flex; /* Mantenido para que los spans se alineen horizontalmente */
    gap: 3.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;
}

.contact-info span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

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

/* NUEVA REGLA: Para el contenido del header */
.header .container {
    display: flex;
    justify-content: space-between; /* Esto mantiene el logo a la izquierda y el nav a la derecha */
    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;
}

.btn {
    display: inline-block;
    padding: 0.9rem 2rem;
    border-radius: 30px;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition-time);
    margin: 0 0.8rem;
    cursor: pointer;
    font-size: 1rem;
    letter-spacing: 0.5px;
    border: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background-color: var(--corporate-red);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--corporate-red-dark);
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(255, 0, 0, 0.2);
}

.btn-secondary {
    background-color: transparent;
    color: var(--white);
    border: 2px solid var(--white);
}

.btn-secondary:hover {
    background-color: var(--white);
    color: var(--corporate-blue);
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(255, 255, 255, 0.2);
}

.cta-section .btn-secondary {
    background-color: var(--corporate-blue);
    color: var(--white);
    border: 2px solid var(--corporate-blue);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.cta-section .btn-secondary:hover {
    background-color: var(--white);
    color: var(--corporate-blue);
    border-color: var(--corporate-blue);
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(2, 61, 121, 0.25);
}

.btn-small {
    padding: 0.7rem 1.5rem;
    font-size: 0.9rem;
    margin: 0;
}

main {
    flex-grow: 1;
    padding-top: calc(40px + 69.6px);
    background-color: var(--white);
}

.hero-products {
    background:
        linear-gradient(rgba(2, 61, 121, 0.2), rgba(1, 42, 82, 0.9)),
        url('../img/fondo-guia.jpg') no-repeat center/cover;

    min-height: 75vh;
    height: auto;
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--white);
    padding-top: 50px;
    padding-bottom: 2rem;
    position: relative;
    z-index: 1;
}

.hero-products::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 120px;
    background: linear-gradient(transparent, var(--white));
    z-index: 2;
}

.hero-products .hero-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 4rem;
    position: relative;
    z-index: 3;
}

.hero-products h1 {
    font-size: clamp(2rem, 5vw, 3.8rem);
    margin-bottom: 1.2rem;
    line-height: 1.2;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
    font-weight: 700;
}

.hero-products p {
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    margin-bottom: 0;
    opacity: 0.9;
    margin-left: auto;
    margin-right: auto;
}

.products-content-section {
    padding: 3rem 0 5rem;
    background-color: var(--white);
    position: relative;
    z-index: 2;
}

.category-section {
    margin-bottom: 4rem;
    padding-top: 2rem;
}

.category-heading {
    font-size: 2.2rem;
    color: var(--corporate-blue);
    text-align: center;
    margin-bottom: 2.5rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.category-heading::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--corporate-red);
    margin: 0.8rem auto 0;
    border-radius: 2px;
}

.guide-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
    justify-content: center;
    align-items: stretch;
}

.guide-card {
    background-color: var(--white);
    border: 1px solid var(--gray-medium);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: transform var(--transition-time) ease, box-shadow var(--transition-time) ease;
    display: flex;
    flex-direction: column;
    text-align: center;
    padding: 1.5rem;
}

.guide-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--box-shadow-hover);
}

.guide-card .fas.fa-file-pdf {
    font-size: 4rem;
    color: var(--corporate-red);
    margin: 0 auto 1rem;
    display: block;
}

.guide-card h4 {
    font-size: 1.3rem;
    color: var(--corporate-blue);
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.guide-card p {
    font-size: 0.95rem;
    color: var(--text-light);
    line-height: 1.5;
    flex-grow: 1;
    margin-bottom: 1.5rem;
    padding: 0;
}

.guide-card .btn {
    margin-top: auto;
    align-self: center;
    margin-bottom: 0;
}

.cta-section {
    margin-top: 4rem;
    padding: 2rem;
    background-color: var(--gray-light);
    border-radius: 10px;
    text-align: center;
}

.cta-section h3 {
    font-size: 1.8rem;
    color: var(--corporate-blue);
    margin-bottom: 1rem;
}

.cta-section p {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.footer {
    background-color: var(--corporate-blue-dark);
    color: var(--white);
    padding: 3.5rem 0 1.5rem;
    font-size: 0.95rem;
    margin-top: auto;
}

.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);
}

.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) {
    .header {
        padding: 1rem 1.5rem;
    }
    .logo img {
        max-width: 150px;
    }
    .btn {
        padding: 0.8rem 1.8rem;
        font-size: 0.95rem;
    }

    main {
        padding-top: calc(40px + 60px);
    }

    .hero-products {
        min-height: 70vh;
        padding-top: 60px;
    }
    .hero-products::before {
        height: 100px;
    }
    .hero-products .hero-content {
        max-width: 900px;
        padding: 0 2rem;
    }
    .hero-products h1 {
        font-size: 3rem;
    }
    .hero-products p {
        font-size: 1.3rem;
        margin-bottom: 0;
    }

    .products-content-section {
        padding: 2.5rem 0 4rem;
    }
    .category-heading {
        font-size: 2rem;
        margin-bottom: 2rem;
    }
    .category-heading::after {
        margin: 0.6rem auto 0;
    }

    .guide-grid {
        gap: 2rem;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    .guide-card h4 {
        font-size: 1.2rem;
    }
    .guide-card p {
        font-size: 0.9rem;
    }
    .guide-card .fas.fa-file-pdf {
        font-size: 3.5rem;
    }

    .cta-section {
        margin-top: 3rem;
        padding: 1.5rem;
    }
    .cta-section h3 {
        font-size: 1.6rem;
    }
    .cta-section p {
        font-size: 1rem;
    }

    .footer-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
        gap: 20px;
    }
    .footer-section {
        min-width: 180px;
        margin-bottom: 1.5rem;
        flex-grow: 1;
        flex-basis: auto;
    }
    .footer-section:first-child {
        flex-basis: 200px;
        flex-grow: 0;
    }
    .footer-section:nth-child(2) {
        flex-basis: 120px;
        flex-grow: 0;
    }
    .footer-section ul {
        padding: 0;
        text-align: left;
    }
    .footer-section ul li {
        margin-bottom: 0.5rem;
    }
    .footer-section p {
        justify-content: flex-start;
    }
    .social-links {
        margin-top: 1rem;
        display: flex;
        justify-content: flex-start;
        gap: 1rem;
    }
    .social-links a {
        margin-right: 0;
    }
}

@media (max-width: 768px) {
    /* CAMBIO: Contact bar se oculta en móviles */
    .contact-bar {
        display: none;
    }

    .header {
        top: 0;
        padding: 0.8rem;
        /* CAMBIO: No flex-wrap aquí, se gestiona en .header .container */
        /* flex-wrap: wrap; */
    }
    /* CAMBIO: Aquí se añade flex-wrap para el comportamiento móvil del header */
    .header .container {
        flex-wrap: wrap; /* Asegura que los elementos se envuelvan en pantallas pequeñas */
        justify-content: space-between; /* Mantiene logo y toggle separados */
    }

    .menu-toggle {
        display: block;
        order: 1;
    }
    .logo {
        order: 0;
    }
    .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: 0.8rem;
        text-align: center;
    }
    .navbar a {
        font-size: 1rem;
    }

    main {
        padding-top: 60px;
    }

    .hero-products {
        min-height: 60vh;
        padding-top: 40px;
    }
    .hero-products::before {
        height: 80px;
    }
    .hero-products .hero-content {
        padding: 0 1.5rem;
    }
    .hero-products h1 {
        font-size: 2.5rem;
    }
    .hero-products p {
        font-size: 1.1rem;
        margin-bottom: 0;
    }

    .products-content-section {
        padding: 2rem 0 3rem;
    }
    .category-heading {
        font-size: 1.8rem;
        margin-bottom: 1.8rem;
    }

    .guide-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    .guide-card {
        max-width: 400px;
        margin: 0 auto;
    }
    .guide-card h4 {
        font-size: 1.2rem;
        margin: 1rem 1rem 0.5rem;
    }
    .guide-card p {
        font-size: 0.85rem;
    }
    .guide-card .fas.fa-file-pdf {
        font-size: 3rem;
    }

    .cta-section {
        margin-top: 2.5rem;
        padding: 1.2rem;
    }
    .cta-section h3 {
        font-size: 1.4rem;
    }
    .cta-section p {
        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:first-child,
    .footer-section:nth-child(2),
    .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;
    }
    .about-footer p {
        font-size: 0.8rem;
    }
    .footer-section h4 {
        font-size: 1.2rem;
    }
    .footer-section ul li a,
    .footer-section p,
    .footer-bottom p {
        font-size: 0.75rem;
    }
}

@media (max-width: 576px) {
    main {
        padding-top: 55px;
    }

    .hero-products {
        min-height: 50vh;
        padding-top: 30px;
    }
    .hero-products::before {
        height: 70px;
    }
    .hero-products .hero-content {
        padding: 0 1rem;
    }
    .hero-products h1 {
        font-size: 2rem;
    }
    .hero-products p {
        font-size: 0.9rem;
        margin-bottom: 0;
    }

    .products-content-section {
        padding: 1.5rem 0 2rem;
    }
    .category-heading {
        font-size: 1.6rem;
        margin-bottom: 1.5rem;
    }

    .guide-grid {
        gap: 1rem;
    }
    .guide-card h4 {
        font-size: 1.1rem;
        margin: 0.8rem 0.8rem 0.4rem;
    }
    .guide-card p {
        font-size: 0.8rem;
    }
    .guide-card .fas.fa-file-pdf {
        font-size: 2.5rem;
    }

    .cta-section {
        margin-top: 2rem;
        padding: 1rem;
    }
    .cta-section h3 {
        font-size: 1.2rem;
    }
    .cta-section p {
        font-size: 0.95rem;
    }

    .footer {
        padding: 2rem 0 0.8rem;
    }
    .footer-section:first-child,
    .footer-section:nth-child(2),
    .footer-section:nth-child(3) {
        max-width: 250px;
    }
}