/* ======================= VARIABLES Y RESET BÁSICO ======================= */
:root {
    --color-primary: #005A9C;      /* Un azul corporativo, profesional */
    --color-secondary: #28B4C2;    /* Un turquesa para acentos y CTAs */
    --color-dark: #122333;         /* Texto principal oscuro */
    --color-light: #F8F9FA;        /* Fondos claros */
    --color-text-muted: #6c757d;  /* Texto secundario */
    --color-white: #FFFFFF;
    --color-success: #28a745;
    --color-danger: #dc3545;
    
    --font-family-base: 'Poppins', sans-serif;
    --container-width: 1140px;
    --border-radius: 8px;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family-base);
    color: var(--color-dark);
    background-color: var(--color-white);
    line-height: 1.6;
}

/* ======================= UTILIDADES Y ESTILOS GLOBALES ======================= */
.container {
    width: 90%;
    max-width: var(--container-width);
    margin-left: auto;
    margin-right: auto;
}

section {
    padding: 60px 0;
}

.section-title {
    text-align: center;
    font-size: 2.2rem;
    color: var(--color-dark);
    margin-bottom: 40px;
    font-weight: 700;
}

.section-title--light {
    color: var(--color-white);
}

.button {
    display: inline-block;
    padding: 12px 28px;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.2s ease, background-color 0.2s ease;
    text-align: center;
    border: none;
    cursor: pointer;
}

.button:hover {
    transform: translateY(-3px);
}

.button--primary {
    background-color: var(--color-primary);
    color: var(--color-white);
}

.button--primary:hover {
    background-color: #004b82;
}

.button--secondary {
    background-color: var(--color-secondary);
    color: var(--color-white);
}

.button--secondary:hover {
    background-color: #219aab;
}

.button--full-width {
    width: 100%;
}

/* HEADER */
.header {
    background-color: var(--color-white);
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 999; 
}

.header__container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header__logo {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--color-primary);
    text-decoration: none;
    position: relative; /* FIX: Necesario para que z-index funcione */
    z-index: 1001;      /* Nivel superior: Siempre visible */
}

/* --- Estilos de la Navegación de Escritorio --- */
.nav__list {
    display: flex;
    align-items: center;
    gap: 25px;
    list-style: none;
}

.nav__link {
    text-decoration: none;
    color: var(--color-dark);
    font-weight: 600;
    transition: color 0.3s ease;
}

.nav__link:hover {
    color: var(--color-primary);
}

.button--small {
    padding: 8px 18px;
    font-size: 0.9rem;
}

/* --- Lógica del Menú Móvil (Checkbox Hack) --- */
.nav__checkbox {
    display: none;
}

.nav__toggle {
    display: none;
    cursor: pointer;
    font-size: 2.5rem;
    line-height: 1;
    color: var(--color-dark);
    position: relative; /* FIX: Necesario para que z-index funcione */
    z-index: 1001;      /* Nivel superior: Siempre visible */
}

/* Ocultamos el icono de 'X' por defecto */
.nav__icon--close {
    display: none;
}

/* La MAGIA: Cuando el checkbox está marcado... */
.nav__checkbox:checked + .nav__toggle .nav__icon--open {
    display: none; /* ...ocultamos la hamburguesa... */
}

.nav__checkbox:checked + .nav__toggle .nav__icon--close {
    display: block; /* ...y mostramos la X. */
}

.nav__checkbox:checked ~ .nav__list {
    right: 0; /* ...y mostramos el panel del menú. */
}

/* --- Media Query para el comportamiento móvil --- */
@media (max-width: 768px) {
    .nav__toggle {
        display: block;
    }

    .nav__list {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        max-width: 300px;
        height: 100vh;
        background-color: var(--color-white);
        box-shadow: -5px 0 15px rgba(0,0,0,0.1);
        
        flex-direction: column;
        justify-content: center;
        gap: 40px;
        transition: right 0.4s cubic-bezier(0.77, 0, 0.175, 1);
        
        /* Nivel intermedio: El panel se queda por debajo del botón */
        z-index: 1000;
    }
}
/* ======================= HERO ======================= */
.hero {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 90vh;
    padding: 40px 20px;
    color: var(--color-white);
    text-align: center;
}

.hero__picture {
    position: absolute;
    inset: 0;
    z-index: -2;
}

.hero__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}
.hero__background {
    height: 100%;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(18, 35, 51, 0.7);
    z-index: -1;
}

.hero__container {
    position: relative;
}

.hero__title {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
    color: var(--color-white);
}

.hero__subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 0 auto 30px;
}

@media (min-width: 768px) {
    .hero {
        min-height: auto;
        padding: 160px 0;
    }

    .hero__title {
        font-size: 3.5rem;
    }

    .hero__subtitle {
        font-size: 1.2rem;
    }
}


/* ======================= PROBLEMS ======================= */
.problems__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

.problem-card {
    background-color: var(--color-light);
    padding: 30px;
    border-radius: var(--border-radius);
    text-align: center;
}

.problem-card__icon {
    width: 40px;
    height: 40px;
    margin-bottom: 15px;
    color: var(--color-danger);
}

.problem-card__title {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.problem-card__text {
    color: var(--color-text-muted);
}

.problems__summary {
    text-align: center;
    margin-top: 40px;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--color-primary);
}


/* ======================= SOLUTIONS ======================= */
.solutions__table-wrapper {
    overflow-x: auto; /* Permite scroll horizontal en móvil */
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
}

.solutions-table {
    width: 100%;
    border-collapse: collapse;
}

.solutions-table th, .solutions-table td {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.solutions-table th {
    background-color: var(--color-light);
    font-weight: 600;
    color: var(--color-primary);
}

.solutions-table tr:last-child td {
    border-bottom: none;
}

.solutions-table td strong {
    color: var(--color-success);
}

/* Escondemos los labels por defecto */
.solutions-table td::before {
    content: attr(data-label);
    font-weight: bold;
    display: none; /* Se mostrará en móvil */
    margin-right: 10px;
}

/* ======================= RESULTS BANNER (CTA) ======================= */
.results-banner {
    background-color: var(--color-primary);
    color: var(--color-white);
}

.results-banner__container {
    text-align: center;
}

.results-banner__list {
    list-style: none;
    padding: 0;
    margin: 30px auto;
    max-width: 600px;
    text-align: left;
}

.results-banner__list li {
    display: flex;
    align-items: center;
    font-size: 1.1rem;
    margin-bottom: 15px;
}

.results-banner__list img {
    width: 24px;
    height: 24px;
    margin-right: 15px;
    color: var(--color-secondary);
}


/* ======================= TESTIMONIALS ======================= */
.testimonials__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

.testimonial-card {
    background-color: var(--color-light);
    border-left: 5px solid var(--color-secondary);
    padding: 30px;
    border-radius: var(--border-radius);
}

.testimonial-card__quote p {
    font-style: italic;
    color: var(--color-text-muted);
    margin-bottom: 15px;
}

.testimonial-card__author {
    font-weight: 600;
    color: var(--color-dark);
    font-style: normal;
}


/* ======================= CONTACT ======================= */
.contact {
    background-color: var(--color-light);
}

.contact__container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    align-items: center;
}

.contact__info p {
    margin-bottom: 15px;
}

.form {
    background-color: var(--color-white);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.form__group {
    margin-bottom: 20px;
}

.form__label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 0.9rem;
}

.form__input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-family: inherit;
}

.form__input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0, 90, 156, 0.2);
}

.form__consent {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.form__consent-label {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.form__consent-label a {
    color: var(--color-primary);
    text-decoration: underline;
    font-weight: 600;
}

.form__legal-info {
    margin-top: 20px;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.form__legal-info p {
    margin-bottom: 5px;
}

/* ======================= FAQ ======================= */
.faq__list {
    max-width: 800px;
    margin: 0 auto;
}

.faq__item {
    border-bottom: 1px solid #ddd;
}

.faq__question {
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    padding: 20px 0;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.faq__icon {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23005A9C' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='12' y1='5' x2='12' y2='19'%3E%3C/line%3E%3Cline x1='5' y1='12' x2='19' y2='12'%3E%3C/line%3E%3C/svg%3E");
    background-size: contain;
}

.faq__question[aria-expanded="true"] .faq__icon {
    transform: rotate(45deg);
}

.faq__answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
}

.faq__answer p {
    padding: 0 0 20px 0;
    color: var(--color-text-muted);
}


/* ======================= FOOTER ======================= */
.footer {
    background-color: var(--color-dark);
    color: var(--color-light);
    padding: 30px 0;
    text-align: center;
}

.footer__container p {
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.footer a {
    color: inherit;
    text-decoration: none;
}
.footer a:hover {
    text-decoration: underline;
}

/* ======================= BANNER DE COOKIES ======================= */
/* ======================= BANNER DE COOKIES (FIX DEFINITIVO) ======================= */
.cookie-banner {
    /* --- Posicionamiento y Visibilidad --- */
    position: fixed; /* LA CLAVE: Fija el banner a la ventana del navegador */
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 2000; /* Lo pone por encima de todo lo demás */
    
    /* --- Estilos Visuales --- */
    background-color: var(--color-dark);
    color: var(--color-white);
    padding: 20px;
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.2);
    
    /* --- Animación de Entrada/Salida --- */
    transform: translateY(0);
    transition: transform 0.4s ease-in-out;
}

/* --- Estado Oculto --- */
.cookie-banner.hidden {
    transform: translateY(100%); /* Desliza el banner hacia abajo para ocultarlo */
    pointer-events: none; /* Evita que se pueda interactuar con él cuando está oculto */
}

.cookie-banner__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.cookie-banner__text {
    font-size: 0.9rem;
    line-height: 1.5;
}

.cookie-banner__actions {
    display: flex;
    gap: 15px;
    flex-shrink: 0; /* Evita que los botones se encojan en pantallas pequeñas */
}

.footer__link {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    text-decoration: underline;
    cursor: pointer;
}
.footer__link:hover {
    color: var(--color-white);
}

@media (min-width: 768px) {
    .cookie-banner__content {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
    .cookie-banner__text {
        font-size: 1rem;
    }
}

.footer__link {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    text-decoration: underline;
    cursor: pointer;
}
.footer__link:hover {
    color: var(--color-white);
}

@media (min-width: 768px) {
    .cookie-banner__content {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
    .cookie-banner__text {
        font-size: 1rem;
    }
}
/* ======================= MEDIA QUERIES (DESKTOP) ======================= */

@media (max-width: 768px) {
    /* Estilos para que la tabla sea responsive en móvil */
    .solutions-table thead {
        display: none;
    }
    .solutions-table tr {
        display: block;
        margin-bottom: 20px;
        border: 1px solid #ddd;
        border-radius: var(--border-radius);
    }
    .solutions-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: right;
        border-bottom: 1px solid #eee;
    }
    .solutions-table td::before {
        display: inline-block; /* Mostramos el label */
        text-align: left;
        color: var(--color-dark);
    }
    .solutions-table td:last-child {
        border-bottom: none;
    }
}


@media (min-width: 768px) {
    .section-title {
        font-size: 2.5rem;
    }

    .hero__title {
        font-size: 3.5rem;
    }

    .problems__grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .testimonials__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .contact__container {
        grid-template-columns: 1fr 1fr;
    }
}


@media (min-width: 992px) {
    .problems__grid {
        grid-template-columns: repeat(3, 1fr);
    }
}