:root {
    --primary-blue: #2F3875;
    --white: #ffffff;
}

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

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
}

html {
    scroll-padding-top: 60px; /* Ajusta este valor según la altura de tu header */
    scroll-behavior: smooth;
}

/* Header */
.header {
    background-color: var(--primary-blue);
    padding: 1rem 2rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-links a {
    color: var(--white);
    text-decoration: none;
    margin-left: 2rem;
    font-weight: 500;
}

.contact-btn {
    background-color: var(--white);
    color: var(--primary-blue) !important;
    padding: 0.5rem 1rem;
    border-radius: 25px;
}

/* Estilos para los puntos de anclaje */
.anchor {
    display: block;
    position: relative;
    top: -60px; /* Debe coincidir con el scroll-padding-top */
    visibility: hidden;
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6rem 1rem;
    overflow: hidden;
}

.slideshow-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.slides {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.slides img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slides::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(47, 56, 117, 0.8);
}

.hero-content {
    position: relative;
    z-index: 1;
    color: var(--white);
    max-width: 800px;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

/* Slideshow Navigation */
.prev, .next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    padding: 16px;
    color: white;
    font-weight: bold;
    font-size: 24px;
    transition: 0.6s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    background-color: rgba(0,0,0,0.2);
    z-index: 2;
}

.next {
    right: 0;
    border-radius: 3px 0 0 3px;
}

.prev {
    left: 0;
}

.prev:hover, .next:hover {
    background-color: rgba(0,0,0,0.8);
}

.dots-container {
    position: absolute;
    bottom: 20px;
    width: 100%;
    text-align: center;
    z-index: 2;
}

.dot {
    cursor: pointer;
    height: 12px;
    width: 12px;
    margin: 0 4px;
    background-color: rgba(255,255,255,0.5);
    border-radius: 50%;
    display: inline-block;
    transition: background-color 0.6s ease;
}

.dot.active, .dot:hover {
    background-color: white;
}

/* Services Section */
.services {
    padding: 4rem 0;
    background-color: var(--primary-blue);
}

.service-grid {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.service-item {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 4rem;
    background-color: var(--white);
}

/* Modificación del reverse para que funcione correctamente */
.service-item.reverse {
    grid-template-columns: 1fr 1fr;
    grid-auto-flow: dense;
}

.service-item.reverse .service-content {
    grid-column: 1;
}

.service-item.reverse .service-image {
    grid-column: 2;
}

.service-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.service-content {
    padding: 3rem;
}

.service-content h2 {
    color: var(--primary-blue);
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    line-height: 1.2;
}

.service-button {
    display: inline-block;
    color: var(--primary-blue);
    text-decoration: none;
    padding: 0.8rem 2rem;
    border: 2px solid var(--primary-blue);
    border-radius: 25px;
    margin-top: 2rem;
    font-weight: 500;
}

.cta-button {
    display: inline-block;
    background-color: transparent;
    color: var(--white);
    text-decoration: none;
    padding: 0.8rem 2rem;
    border: 2px solid var(--white);
    border-radius: 25px;
    margin-top: 2rem;
    font-weight: 500;
}

/* Clients Section */
.clients {
    padding: 4rem 0;
    text-align: center;
    background-color: var(--white);
}

/* Bottom CTA Section */
.bottom-cta {
    position: relative;
    background-image: url('img/contact-bg.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--white);
    padding: 6rem 1rem;
    text-align: center;
    isolation: isolate; /* Crea un nuevo contexto de apilamiento */
}

/* Overlay para la imagen de fondo 
.bottom-cta::before {
    content: '';
    position: absolute;
    inset: 0; /* Equivalente a top: 0; right: 0; bottom: 0; left: 0;
    background-color: var(--primary-blue);
    opacity: 0.9;
    z-index: -1;
}*/

.cta-content {
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
}

.cta-content h2 {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    line-height: 1.4;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cta-content p {
    margin-bottom: 1.5rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Footer */
.footer {
    background-color: var(--primary-blue);
    color: var(--white);
    padding: 3rem 1rem;
    text-align: center;
}

.footer-logo {
    margin-bottom: 2rem;
}

.contact-info p {
    margin-bottom: 0.5rem;
}

.legal-links {
    padding-top: 1.5rem;
}

.legal-links a {
    color: var(--white);
    text-decoration: none;
    font-size: 0.9rem;
    transition: opacity 0.3s ease;
}

.legal-links a:hover {
    opacity: 0.8;
}

.separator {
    color: rgb(255, 255, 255);
    margin: 0 1rem;
    font-size: 0.9rem;
}

/* Estilos base para páginas legales */
.legal-content {
    padding: 8rem 1rem 4rem;
    background-color: var(--white);
    min-height: calc(100vh - 400px);
}

.legal-container {
    max-width: 800px;
    margin: 0 auto;
}

.legal-container h1 {
    color: var(--primary-blue);
    font-size: 2.5rem;
    margin-bottom: 2rem;
}

.legal-container h2 {
    color: var(--primary-blue);
    font-size: 1.8rem;
    margin: 2rem 0 1rem;
}

.legal-container h3 {
    color: var(--primary-blue);
    font-size: 1.4rem;
    margin: 1.5rem 0 1rem;
}

.legal-container p {
    margin-bottom: 1rem;
    line-height: 1.8;
    color: #444;
}

.legal-container ul, 
.legal-container ol {
    margin: 1rem 0 1rem 2rem;
}

.legal-container li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .service-item,
    .service-item.reverse {
        grid-template-columns: 1fr;
    }

    .service-item.reverse .service-content,
    .service-item.reverse .service-image {
        grid-column: 1;
    }
    
    .service-item.reverse .service-image {
        order: -1; /* Asegura que la imagen siempre va primero en móvil */
    }

    .service-content {
        padding: 2rem;
    }

    .cta-content h2 {
        font-size: 1.3rem;
    }

    .prev, .next {
        padding: 8px;
        font-size: 18px;
    }

    .dot {
        height: 8px;
        width: 8px;
        margin: 0 3px;
    }

    .hero-content {
        padding: 0 1rem;
    }

    .bottom-cta {
        background-attachment: scroll; /* Mejor rendimiento en móviles */
        padding: 4rem 1rem;
    }

    .legal-content {
        padding-top: 6rem;
    }

    .legal-container h1 {
        font-size: 2rem;
    }

    .legal-container h2 {
        font-size: 1.5rem;
    }

    .cookie-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .cookie-buttons {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.8rem;
    }

    .hero p {
        font-size: 0.9rem;
    }

    .legal-links {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .separator {
        display: none;
    }

    .legal-container h1 {
        font-size: 1.8rem;
    }

    .legal-container h2 {
        font-size: 1.3rem;
    }

/* Buttons */
.service-button {
    display: inline-block;
    color: var(--primary-blue);
    text-decoration: none;
    padding: 0.8rem 2rem;
    border: 2px solid var(--primary-blue);
    border-radius: 25px;
    margin-top: 2rem;
    font-weight: 500;
}
    .cta-button {
        width: 100%;
        text-align: center;
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
    }

    .service-content h2 {
        font-size: 1.5rem;
    }

    .service-content {
        padding: 1.5rem;
    }

    .bottom-cta {
        padding: 2rem 1rem;
    }

    .footer {
        padding: 2rem 1rem;
    }

    .contact-info p {
        font-size: 0.9rem;
    }

    .prev, .next {
        padding: 6px;
        font-size: 16px;
    }

    .bottom-cta {
        padding: 3rem 1rem;
    }
}

/* Animaciones */
.fade {
    transition: opacity 1s ease-in-out;
}

/* Hover effects */
.service-button:hover {
    background-color: var(--primary-blue);
    color: var(--white);
    transition: all 0.3s ease;
}

.cta-button:hover {
    background-color: var(--white);
    color: var(--primary-blue);
    transition: all 0.3s ease;
}

.nav-links a:hover {
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.contact-btn:hover {
    background-color: rgba(255, 255, 255, 0.9);
}

/* Utilidades */
.hidden {
    display: none;
}

/* Accesibilidad */
@media (prefers-reduced-motion: reduce) {
    .fade,
    .slides,
    .service-button,
    .cta-button,
    .nav-links a {
        transition: none;
    }
}

/* Focus states */
a:focus,
button:focus,
.dot:focus {
    outline: 2px solid var(--white);
    outline-offset: 2px;
}

.service-button:focus,
.contact-btn:focus {
    outline-color: var(--primary-blue);
}

/* Estilos para el banner de cookies */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(47, 56, 117, 0.95);
    color: #fff;
    padding: 1rem;
    z-index: 1000;
    display: none;
    backdrop-filter: blur(10px);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.cookie-content p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
}

.cookie-buttons {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-shrink: 0;
}

.cookie-accept {
    background: var(--white);
    color: var(--primary-blue);
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.cookie-accept:hover {
    background-color: #f0f0f0;
}

.cookie-more {
    color: var(--white);
    text-decoration: none;
    font-size: 0.9rem;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
}

.cookie-more:hover {
    border-bottom-color: var(--white);
}

/* WhatsApp Floating Button */
.whatsapp-float {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 1001;
}

.whatsapp-float a {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 60px;
    height: 60px;
    background-color: #25D366;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.whatsapp-float a:hover {
    background-color: #20BD5C;
    transform: scale(1.05);
}

.whatsapp-icon {
    width: 35px;
    height: 35px;
    fill: white;
}

/* Media query for smaller screens */
@media (max-width: 480px) {
    .whatsapp-float {
        bottom: 15px;
        right: 15px;
    }
    
    .whatsapp-float a {
        width: 50px;
        height: 50px;
    }
    
    .whatsapp-icon {
        width: 30px;
        height: 30px;
    }
}