body,
html {
    margin: 0;
    padding: 0;
    font-family: 'Poppins', Arial, sans-serif;
    background: #fff;
    box-sizing: border-box;
}

*,
*::before,
*::after {
    box-sizing: inherit;
}

/* --- HEADER Y NAVEGACIÓN --- */
.hero {
    min-height: 85vh;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    z-index: 1;
}

.index-hero {
    background: url('../img/fondos/foto_inici.jpg') center center/cover no-repeat;
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1;
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2rem 2.5rem;
    background: rgba(0, 0, 0, 0.65);
    position: relative;
    z-index: 100;
}

.logo {
    height: 120px;
    /* Tamaño por defecto para Desktop */
    width: auto;
}

.logo-link-movil {
    display: none;
}

.nav-menu {
    list-style: none;
    display: flex;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

.nav-menu li a {
    color: #fff;
    text-decoration: none;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    padding: 10px 15px;
    transition: all 0.3s ease;
    position: relative;
}

/* Ocultar el logo del menú en desktop */
.nav-menu-logo {
    display: none;
}

.nav-menu li a:hover {
    border-bottom: 2px solid #e75480;
    color: #e75480;
}

.nav-menu li a.active {
    color: #e75480;
    border-bottom: 2px solid #e75480;
}


.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1002;
    /* Higher than menu to be clickable */
    padding: 10px;
    transition: all 0.3s ease;
}

.nav-toggle .bar {
    display: block;
    width: 28px;
    height: 3px;
    background: #e75480;
    border-radius: 2px;
    transition: all 0.3s ease-in-out;
}

/* Estado Activo (X) */
.nav-toggle.active .bar:nth-child(1) {
    transform: translateY(4.5px) rotate(45deg);
}

.nav-toggle.active .bar:nth-child(2) {
    transform: translateY(-4.5px) rotate(-45deg);
}

.hero-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    z-index: 2;
    margin-top: 2.5rem;
}

/* --- HERO CARDS Y CTA (Solo Index) --- */

.hero-cards {
    display: flex;
    gap: 2.5rem;
    justify-content: center;
    align-items: stretch;
    margin: 2.5rem 0 2rem 0;
    flex-wrap: wrap;
    z-index: 2;
}

.hero-card {
    background: rgba(30, 30, 30, 0.45);
    border-radius: 18px;
    padding: 2rem 1.5rem 1.5rem 1.5rem;
    min-width: 220px;
    max-width: 260px;
    text-align: center;
    color: #fff;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    transition: transform 0.25s, box-shadow 0.25s;
    opacity: 0;
    transform: translateY(40px);
    animation: fadeInUp 1s forwards;
}

.hero-card:hover {
    transform: translateY(-8px) scale(1.04);
    box-shadow: 0 8px 32px rgba(231, 84, 128, 0.18);
    background: rgba(231, 84, 128, 0.15);
}

.hero-card-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.7rem;
}

.hero-card-icon i {
    color: #e75480;
    font-size: 2.5rem;
}

.hero-card h2 {
    margin: 0;
    font-size: 1.25rem;
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Animación fadeInUp */
@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fadein {
    opacity: 0;
    animation: fadeInUp 1s forwards;
}

/* Botón CTA */
.btn {
    display: inline-block;
    background: #e75480;
    color: white;
    padding: 14px 36px;
    border-radius: 30px;
    font-family: 'Montserrat', sans-serif;
    font-weight: bold;
    font-size: 1.1rem;
    margin-top: 1.5rem;
    text-decoration: none;
    box-shadow: 0 2px 12px rgba(231, 84, 128, 0.10);
    transition: 0.3s;
    border: none;
    cursor: pointer;
}

.btn:hover {
    background: #ff6699;
    transform: scale(1.05);
}


/* --- FOOTER OPTIMIZADO --- */

footer {
    background: #181818;
    color: #fff;
    text-align: center;
    /* QUITAMOS EL PADDING DE AQUÍ */
}

/* Estilo por defecto (Móvil) */
.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem 1rem;
    /* Padding general para móvil */
}

.footer-img {
    width: 80px;
    /* Tamaño para móvil */
    height: auto;
    display: block;
}

/* Enlace de Contacto (Botón) */
/* Información de Contacto */
.footer-contact-info {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
}

.footer-contact-info h3 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1.3rem;
    margin: 0 0 0.4rem 0;
    color: #e75480;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-contact-info p {
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    margin: 0;
    color: #f0f0f0;
    font-weight: 300;
}

/* Iconos Sociales */
.socials a {
    color: #e75480;
    font-size: 2rem;
    /* Tamaño adecuado para el footer */
    margin: 0 0.7rem;
    transition: color 0.2s;
}

.socials a:hover {
    color: #fff;
}

/* --- MEDIA QUERIES RESPONSIVAS --- */

/* Ajustes para tabletas y pantallas medianas (Menú aún horizontal) */
@media (max-width: 900px) {
    .navbar {
        padding: 0.5rem;
    }

    .logo-link {
        display: none;
    }

    .logo-link-movil {
        display: flex;
        align-items: center;
        /* Ensure image is centered vertically if needed */
        height: 2.5rem;
        width: auto;
        /* Ensure it doesn't take more space than needed */
        flex: 0 1 auto;
    }

    .logo-movil {
        height: 100%;
        width: auto;
        max-height: 40px;
        /* Force a reasonable max size */
    }

    .nav-menu {
        gap: 1rem;
    }

    .hero-cards {
        gap: 1.2rem;
    }

    .hero-card {
        min-width: 160px;
        max-width: 90vw;
    }
}

/* Punto de quiebre para MENU HAMBURGUESA y Footer Horizontal */
@media (min-width: 768px) {

    /* Footer Horizontal (Desktop) */
    .footer-content {
        flex-direction: row;
        justify-content: space-around;
        align-items: center;
        max-width: 1200px;
        margin: 0 auto;
        padding: 3rem 2rem;
        /* Más aire en desktop */
    }

    .footer-img {
        width: 100px;
        /* Tamaño de logo en desktop */
    }

    .footer-contact-info {
        align-items: center;
        text-align: center;
    }
}

@media (max-width: 700px) {

    /* Ajuste de Navbar en móvil: Logo más pequeño */
    .navbar {
        position: fixed;
        width: 100%;
        top: 0;
        z-index: 1001;
        /* Higher than menu to be clickable */
        background: rgba(0, 0, 0, 0.85);
        /* Dark background for visibility */
        backdrop-filter: blur(10px);
    }

    .logo {
        height: 60px;
        /* Reduced specific mobile height */
    }

    /* Configuración del menú hamburguesa */
    .nav-menu {
        position: absolute;
        top: 70px;
        right: 0;
        background: rgba(0, 0, 0, 0.97);
        flex-direction: column;
        width: 200px;
        padding: 1.5rem 0;
        gap: 1.5rem;
        align-items: flex-start;
        transform: translateX(100%);
        transition: transform 0.3s;
        z-index: 100;
    }

    .nav-menu.nav-menu_visible {
        transform: translateX(0);
    }

    /* Ajuste en el logo y el toggle para que se vean bien encima del menú */
    /* Fixed positioning removed from here, now handled by .navbar */
    .nav-toggle {
        display: flex;
    }

    /* Responsive para títulos de historia */
    .page-title {
        font-size: 2rem;
    }

    .section-heading {
        font-size: 1.8rem;
    }

    /* MODIFICACIÓN PARA ESTILO APPLE/iOS */
    .nav-menu {
        position: fixed;
        top: 0;
        right: 0;

        /* Fondo Negro Semi-Transparente y Desenfocado */
        background: rgba(10, 10, 10, 0.9);
        /* Más transparente que antes (0.9 vs 0.95) */
        backdrop-filter: blur(16px);
        /* Aumentamos el desenfoque (blur) para el efecto iOS */
        -webkit-backdrop-filter: blur(16px);

        flex-direction: column;
        width: 100%;
        /* Ocupará todo el ancho para una sensación de "pantalla completa" */
        height: 100vh;

        /* Aumentamos el padding para centrar visualmente los elementos */
        padding: 5rem 2rem 2rem 2rem;

        gap: 3rem;
        /* Más separación vertical entre enlaces (estilo minimalista) */
        align-items: center;
        /* Volvemos a centrar los enlaces horizontalmente */
        justify-content: flex-start;
        /* Alineamos verticalmente arriba */

        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.7, 0, 0.3, 1);
        /* Transición más fluida (estilo iOS) */
        z-index: 1000;
        overflow-y: auto;
    }

    /* MODIFICACIÓN: Ajuste de los enlaces para el centrado */
    .nav-menu li {
        width: 100%;
    }

    /* Mostrar el logo en el menú móvil y ajustarlo */
    /* Mostrar el logo en el menú móvil y ajustarlo */
    .nav-menu li.nav-menu-logo {
        display: block;
        position: absolute;
        /* Sacamos del flujo normal */
        top: 0rem;
        left: 0rem;
        margin: 0;
        width: auto;
        /* Override 100% width from generic li */
    }

    .nav-menu-logo img {
        width: 80px;
        height: auto;
    }

    /* MODIFICACIÓN: Estilo de los enlaces */
    .nav-menu li a {
        font-size: 1.8rem;
        /* Aún más grandes para un toque moderno y legible */
        font-weight: 700;

        display: block;
        /* Asegura que la línea de abajo ocupe todo el ancho si quieres añadirla */
    }

    /* Ajuste en el logo y el toggle para que se vean bien encima del menú */
    /* Cleaning up old positioning for logo/toggle */
    .logo {
        position: static;
        z-index: auto;
    }

    .nav-toggle {
        position: relative;
        z-index: 1002;
        /* Higher than menu (1000) */
    }

    .logo {
        /* Reset hacks */
        margin: 0;
    }

    .nav-toggle {
        /* Reset hacks */
        margin: 0;
    }

    /* ... el resto de reglas que ya tenías ... */
}

@media (max-width: 600px) {
    .hero-cards {
        flex-direction: column;
        gap: 1.2rem;
        margin: 1.5rem 0;
    }
}

/* --- ESTILOS ESPECÍFICOS PARA LA PÁGINA DE HISTORIA --- */

.history-hero {
    min-height: 40vh;
    justify-content: center;
    background: url('../img/fondos/foto_historia.jpg') center center/cover no-repeat;
}

.history-hero .hero-content {
    margin-top: 0;
}

/* Ocultar elementos de index en páginas internas */
.history-hero .hero-cards,
.history-hero .btn {
    display: none;
}

/* Estilo del título de la página */
.page-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 3rem;
    color: white;
    margin-top: 1rem;
    position: relative;
    z-index: 2;
    padding: 0 1rem;
}

/* 2. Sección principal del contenido de la historia */
.history-section {
    padding: 3rem 5%;
    max-width: 1000px;
    margin: 0 auto;
    text-align: justify;
    line-height: 1.8;
    color: #333;
}

.section-heading {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 2.2rem;
    color: #e75480;
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.history-timeline p {
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
    font-weight: 300;
}

.history-timeline p strong {
    font-weight: 600;
    color: #444;
}

/* Estilo para el párrafo final */
.final-paragraph {
    font-style: italic;
    padding-top: 1rem;
    border-top: 1px dashed #ccc;
    text-align: center;
}

/* --- FOOTER LEGAL SECTION --- */
.footer-legal {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    font-size: 0.85rem;
    background: #111;
    /* Slightly darker than main footer */
    color: #bbb;
}

.footer-legal .copyright {
    margin: 0;
    text-align: center;
}

.footer-legal .legal-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    align-items: center;
}

.footer-legal a {
    color: #bbb;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-legal a:hover {
    color: #e75480;
}

.footer-legal .separator {
    color: #666;
    user-select: none;
}

/* Responsive adjustments for Legal section */
@media (min-width: 768px) {
    .footer-legal {
        flex-direction: row;
        justify-content: space-between;
        padding: 1.5rem 10%;
        /* More side padding on desktop */
        text-align: left;
    }

    .footer-legal .copyright {
        text-align: left;
    }
}

/* --- LANGUAGE SWITCHER --- */
.lang-switch {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 5px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.lang-switch:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.6);
}

.lang-switch a {
    color: rgba(255, 255, 255, 0.6) !important;
    /* Override nav link color */
    text-decoration: none;
    font-size: 0.95rem !important;
    /* Override nav link size */
    font-weight: 500 !important;
    padding: 0 !important;
    /* Override nav link padding */
    transition: color 0.3s;
    border-bottom: none !important;
    /* Override hover effect */
}

.lang-switch a:hover {
    color: #fff !important;
    background: none !important;
}

.lang-switch a.active {
    color: #e75480 !important;
    font-weight: 700 !important;
}

.lang-separator {
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.9rem;
    margin-top: -2px;
    /* Visual adjustment */
}

/* Mobile Adjustments for Language Switcher */
/* Mobile Adjustments for Language Switcher */
@media (max-width: 700px) {

    /* Show language switcher in mobile menu and position it ABSOLUTELY to match header position */
    /* Show language switcher in mobile menu and position it ABSOLUTELY to match header position */
    /* Show language switcher in mobile menu and position it ABSOLUTELY to match header position */
    .nav-menu .lang-switch {
        display: flex !important;
        position: absolute;
        width: auto;
        /* Override 100% width from .nav-menu li */
        top: 0.8rem;
        /* Moving up from 1.25rem/1.5rem to align better */
        left: 50%;
        transform: translateX(-50%);
        margin: 0;

        border: 1px solid rgba(255, 255, 255, 0.2);
        padding: 4px 12px;
        border-radius: 20px;
        background: rgba(255, 255, 255, 0.05);
        z-index: 1005;
    }

    .lang-switch a {
        font-size: 0.85rem !important;
        /* Keep smaller size as originally requested before revert */
    }
}

/* --- DESKTOP LANGUAGE SWITCHER --- */
.lang-switch-desktop {
    position: absolute;
    top: 180px;
    /* Below navbar (approx 160px height) on large screens */
    right: 2.5rem;
    /* Aligned with navbar padding */
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 5px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.lang-switch-desktop:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.6);
}

.lang-switch-desktop a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.3s;
}

.lang-switch-desktop a:hover {
    color: #fff;
}

.lang-switch-desktop a.active {
    color: #e75480;
    font-weight: 700;
}

.lang-switch-desktop .lang-separator {
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.9rem;
    margin-top: -2px;
}

/* Tablet Adjustment (Between 701px and 900px) */
/* Navbar is much shorter here (approx 60px) because the large logo is hidden */
@media (max-width: 900px) {
    .lang-switch-desktop {
        top: 80px;
    }
}

/* Hide desktop switcher on mobile (matches mobile menu breakpoint at 700px) */
@media (max-width: 700px) {
    .lang-switch-desktop {
        display: none;
    }
}

/* Hide nav menu switcher on desktop (anything above mobile breakpoint) */
@media (min-width: 701px) {
    .nav-menu .lang-switch {
        display: none;
    }
}

/* --- CONTACT PAGE STYLES --- */

/* Reuse history hero background or define a new one */
.contact-hero {
    min-height: 100vh;
    /* Full height */
    background: url('../img/fondos/foto_insc.jpg') center center/cover no-repeat;
    align-items: center;
    justify-content: center;
    display: flex;
}

/* --- LEGAL PAGES STYLES (Privacy Policy & Legal Notice) --- */
.legal-hero {
    min-height: 100vh;
    background: url('../img/fondos/foto_legal.jpg') center center/cover no-repeat;
    align-items: center;
    justify-content: center;
    display: flex;
}

.contact-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    /* Slightly darker for better form readability */
    z-index: 1;
}

/* Simplified Navbar for Contact Page */
.contact-navbar {
    position: absolute;
    top: 0;
    width: 100%;
    justify-content: space-between;
    padding: 1.5rem 2.5rem;
    background: transparent;
    /* Transparent header */
}

.btn-back {
    color: #fff;
    text-decoration: none;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: color 0.3s;
    z-index: 10;
}

.btn-back:hover {
    color: #e75480;
}

.btn-back i {
    font-size: 1.2rem;
}

/* Specific lang switcher for contact header */
.contact-lang-switch {
    margin: 0;
    z-index: 10;
}

/* Form Container */
.contact-form-container {
    background: rgba(30, 30, 30, 0.96);
    /* backdrop-filter: blur(16px); REMOVED */
    /* -webkit-backdrop-filter: blur(16px); REMOVED */
    border-radius: 24px;
    padding: 2.5rem 3rem;
    width: 100%;
    max-width: 600px;
    z-index: 2;
    margin-top: 3rem;
    /* Space from top */
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.legal-container {
    background: rgba(25, 25, 25, 0.96);
    /* High opacity instead of blur for maximum performance */
    /* backdrop-filter: blur(10px); REMOVED for performance */
    /* -webkit-backdrop-filter: blur(10px); REMOVED for performance */
    border-radius: 24px;
    padding: 3rem 4rem;
    width: 90%;
    max-width: 1000px;
    z-index: 2;
    margin-top: 5rem;
    margin-bottom: 3rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    /* Simpler shadow */
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: left;
    color: #f0f0f0;
    max-height: 80vh;
    overflow-y: auto;
    transform: translateZ(0);
    /* Force hardware acceleration */
    will-change: transform;
}

/* Custom scrollbar for legal container */
.legal-container::-webkit-scrollbar {
    width: 8px;
}

.legal-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.legal-container::-webkit-scrollbar-thumb {
    background: rgba(231, 84, 128, 0.5);
    border-radius: 4px;
}

.legal-container::-webkit-scrollbar-thumb:hover {
    background: rgba(231, 84, 128, 0.8);
}


.legal-container h1 {
    font-family: 'Montserrat', sans-serif;
    color: #e75480;
    margin-bottom: 1.5rem;
    text-align: center;
}

.legal-container h2 {
    font-family: 'Montserrat', sans-serif;
    color: #fff;
    font-size: 1.4rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 0.5rem;
}

.legal-container h3 {
    font-family: 'Montserrat', sans-serif;
    color: #e75480;
    font-size: 1.1rem;
    margin-top: 1.5rem;
}

.legal-container p,
.legal-container li {
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    color: #ddd;
}

.legal-container ul {
    padding-left: 1.5rem;
}

.legal-container table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.legal-container th,
.legal-container td {
    padding: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.legal-container th {
    background: rgba(231, 84, 128, 0.2);
    color: #fff;
}


.contact-subtitle {
    color: #f0f0f0;
    margin-bottom: 2rem;
    font-weight: 300;
}

/* Form Styles */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    text-align: left;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    color: #fff;
    font-size: 0.95rem;
    font-weight: 500;
    margin-left: 5px;
}

.form-group input,
.form-group textarea {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 12px 16px;
    color: #fff;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: #e75480;
    box-shadow: 0 0 0 3px rgba(231, 84, 128, 0.2);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.btn-submit {
    margin-top: 1rem;
    width: 100%;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

/* Mobile responsive for contact */
@media (max-width: 600px) {
    .contact-navbar {
        padding: 1rem;
        background: rgba(0, 0, 0, 0.4);
    }

    .contact-form-container {
        width: 90%;
        padding: 2rem 1.5rem;
        margin-top: 4rem;
    }

    .page-title {
        font-size: 2.2rem;
        /* Smaller title on mobile */
    }
}