/* ====================================================================================
   1. RESET Y CONFIGURACIÓN GLOBAL
   ==================================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #f4f4f9;
    display: flex;                 /* Para que el footer quede al final */
    flex-direction: column;
    min-height: 100vh;
}

/* ====================================================================================
   2. HEADER Y NAVEGACIÓN PRINCIPAL
   ==================================================================================== */

/* ----- Header fijo ----- */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: #8c52ff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 15px 20px;
}

/* ----- Contenedor nav ----- */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

/* ----- Logo ----- */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo img {
    height: 60px;
    transition: transform 0.6s ease;
    transform-style: preserve-3d;
}

.logo img:hover {
    transform: rotateY(360deg);
}

/* ====================================================================================
   3. MENÚ PRINCIPAL
   ==================================================================================== */
.menu {
    display: flex;
    align-items: center;
    gap: 30px;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 20px;
    position: relative;
}

.nav-links li {
    position: relative;
}

/* Links principales */
.nav-links li a {
    padding: 8px 15px;
    text-decoration: none;
    color: #fff;
    font-weight: bold;
    border-radius: 5px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Hover en enlaces normales (excepto con logo) */
.nav-links li a:hover:not(.logo-item) {
    background-color: #fff;
    color: #8c52ff;
}

/* ====================================================================================
   4. MENÚ DESPLEGABLE (Dropdown)
   ==================================================================================== */

/* Contenedores de submenús */
.dropdown-menu,
.dropdown-submenu {
    display: none;
    position: absolute;
    background-color: #ffffff;
    border-radius: 5px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    top: 100%;
    left: 0;
    list-style: none;
    padding: 5px 0;
    z-index: 10;
}

/* Mostrar menú al pasar el ratón */
.dropdown:hover > .dropdown-menu {
    display: block;
}

/* Mostrar submenú al pasar el ratón */
.dropdown-menu li:hover > .dropdown-submenu {
    display: block;
}

/* Submenú alineado a la derecha */
.dropdown-submenu {
    top: 0;
    left: 100%;
}

.dropdown-menu li {
    padding: 5px 20px;
}

.dropdown-menu li a {
    text-decoration: none;
    color: #333;
    display: block;
    padding: 8px 15px;
    border-radius: 5px;
}

.dropdown-menu li a:hover {
    background-color: #8c52ff;
    color: white;
}

/* ====================================================================================
   5. ELEMENTOS CON LOGOS (Menú y Submenú)
   ==================================================================================== */

.menu-logo {
    height: 40px;
    width: auto;
    margin: 5px;
    border-radius: 5px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.submenu-logo {
    height: 30px;
    width: auto;
    margin: 5px;
    border-radius: 5px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.menu-logo:hover,
.submenu-logo:hover {
    transform: scale(1.05);
    box-shadow: 0 0 8px #8c52ff;
}

/* Enlaces con logo no cambian de fondo en hover */
.nav-links li a.logo-item:hover,
.dropdown-menu li a.logo-item:hover {
    background-color: transparent;
}

/* Centrado de imágenes en desplegables */
.dropdown-menu img,
.dropdown-submenu img {
    margin: 5px auto;
    display: block;
}

/* ====================================================================================
   6. BARRA DE BÚSQUEDA
   ==================================================================================== */
.search-bar {
    position: relative;
    display: flex;
    align-items: center;
    width: 200px;
}

.search-bar input {
    display: block;
    width: 100%;
    height: 40px;
    padding: 8px;
    border: 2px solid #ccc;
    outline: none;
    box-sizing: border-box;
    text-align: left;
    border-radius: 5px;
}

.search-bar input:focus {
    border-color: #8c52ff;
}

/* Sugerencias desplegables */
.suggestions {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 5px;
    max-height: 120px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.suggestion-item {
    padding: 4px 8px;
    cursor: pointer;
    color: #333;
    transition: background-color 0.2s ease;
}

.suggestion-item:hover {
    background-color: #8c52ff;
    color: #fff;
}

/* ====================================================================================
   7. SELECTOR DE IDIOMA
   ==================================================================================== */
.language-selector {
    position: relative;
    display: inline-block;
}

#lang-btn {
    border: none;
    background: none;
    font-weight: bold;
    font-size: 14px;
    color: #fff;
    cursor: pointer;
    padding: 5px;
    transition: color 0.2s ease;
}

#lang-btn:hover {
    color: #fff;
}

/* Menú de idiomas */
.lang-menu {
    display: none;
    position: absolute;
    right: 50%;
    transform: translateX(50%);
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-radius: 5px;
    padding: 5px;
}

.lang-menu li {
    list-style: none;
    padding: 5px;
}

.lang-menu li a {
    text-decoration: none;
    font-size: 14px;
    font-weight: bold;
    color: #333;
    padding: 5px;
    display: block;
    transition: color 0.2s ease;
}

.lang-menu li a:hover {
    color: #8c52ff;
}

/* Mostrar menú al pasar el ratón */
.language-selector:hover .lang-menu {
    display: block;
}

/* ====================================================================================
   8. MENÚ HAMBURGUESA (Responsive)
   ==================================================================================== */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
}

.hamburger .bar {
    width: 25px;
    height: 4px;
    background-color: #fff;
}

/* ====================================================================================
   9. MAIN Y SECCIÓN CONTACTO
   ==================================================================================== */
main {
    flex: 1;
    padding-top: 90px;
    margin: auto;
    max-width: 1600px;
    width: 95%;
}

.contact-section {
    display: flex;
    justify-content: center;
    padding: 30px;
    gap: 40px;
}

/* ----- Tarjetas ----- */
.contact-card {
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 25px;
    width: 50%;
}

/* Imágenes perfil */
.image-container.duo {
    display: flex;
    gap: 40px;
    justify-content: center;
    margin-bottom: 20px;
}

.profile {
    position: relative;
    width: 50%;
    overflow: hidden;
    height: 300px;
}

.profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    opacity: 0.95;
    transition: opacity 0.3s ease;
    display: block;
}

.profile-image:hover {
    opacity: 1;
}

/* Overlay sobre imágenes */
.overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 8px;
    font-size: 14px;
    text-align: center;
    border-radius: 0 0 10px 10px;
}

/* Texto bienvenida */
.welcome-title {
    text-align: center;
    color: #8c52ff;
    margin: 40px 0;
    font-size: 1.5rem;
    line-height: 1.2;
}

.contact-card.left .intro-text {
    font-size: 16px;
    line-height: 1.6;
    color: #555;
    margin-bottom: 20px;
}

.contact-card.left .intro-text a {
    color: #8c52ff;
    text-decoration: none;
    font-weight: bold;
}

.contact-card.left .intro-text a:hover {
    text-decoration: underline;
}

.contact-card.left .motto {
    width: 100%;
    text-align: center;
    font-weight: bold;
    color: #8c52ff;
    margin-top: 20px;
}

/* ====================================================================================
   10. FORMULARIO DE CONTACTO
   ==================================================================================== */
.contact-card.right h2 {
    text-align: center;
    margin-bottom: 20px;
}

form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

label {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 4px;
}

.contact-card.right form input,
.contact-card.right form select,
.contact-card.right form textarea {
    font-size: 18px;
    padding: 12px;
    border: 2px solid #ccc;
    border-radius: 10px;
    outline: none;
    transition: border-color 0.3s ease;
    margin-bottom: 12px;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #8c52ff;
}

button {
    background-color: #8c52ff;
    color: white;
    padding: 14px 22px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 18px;
    transition: background-color 0.3s ease;
    margin-top: 10px;
}

button:hover {
    background-color: #6a3db0;
}

/* Consentimiento RGPD */
.consent-section {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.consent-section input {
    width: 18px;
    height: 18px;
}

.legal-notice {
    font-size: 12px;
    color: #666;
    text-align: center;
    margin-top: 15px;
}

/* ====================================================================================
   11. FOOTER
   ==================================================================================== */
footer {
    background-color: #8c52ff;
    color: white;
    padding: 40px 20px;
    text-align: center;
    font-family: 'Arial', sans-serif;
    box-shadow: 0px -5px 10px rgba(0, 0, 0, 0.2);
    margin-top: auto;
}

footer a {
    color: #f4f4f9;
    text-decoration: dotted;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer-logo img {
    height: 60px;
    margin-bottom: 15px;
    opacity: 0.9;
}

.footer-socials {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 25px;
}

.footer-socials img {
    width: 30px;
    transition: transform 0.1s ease, opacity 0.3s ease;
}

.footer-socials a:hover img {
    transform: scale(1.2);
    opacity: 0.7;
}

.footer-bottom {
    font-size: 14px;
    opacity: 0.8;
}

/* ====================================================================================
   12. RESPONSIVE DESIGN
   ==================================================================================== */

/* Tablets y pantallas medianas */
@media (max-width: 1024px) {
    .contact-section {
        flex-direction: column;
        align-items: center;
        width: 100%;
        gap: 20px;
        padding: 10px;
    }

    .contact-card {
        width: 100%;
    }

    .image-container.duo {
        flex-direction: column;
        align-items: center;
        gap: 20px;
        margin-bottom: 20px;
    }

    .profile {
        width: 100%;
        height: 250px;
    }
}

/* Móviles y pantallas pequeñas */
@media (max-width: 768px) {
    main {
        padding-top: 80px;
    }

    /* Menú móvil */
    .menu {
        display: none;
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        background-color: #ffffff;
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        padding: 20px;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        z-index: 999;
    }

    .menu.active {
        display: flex;
    }

    .hamburger {
        display: flex;
        position: absolute;
        right: 20px;
        top: 15px;
    }

    .nav-links {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .nav-links li {
        width: 100%;
    }

    .nav-links li a {
        display: block;
        padding: 10px;
        text-align: left;
        width: 100%;
        color: #333;
        background-color: #fff;
        border-radius: 5px;
        margin-bottom: 5px;
        transition: background-color 0.3s ease;
    }

    .nav-links li a:hover {
        background-color: #8c52ff;
        color: #fff;
    }

    /* Dropdown adaptado a móvil */
    .dropdown-menu,
    .dropdown-submenu {
        position: static;
        background-color: #f9f9f9;
        margin-left: 20px;
        padding: 0;
        box-shadow: none;
    }

    .dropdown:hover > .dropdown-menu,
    .dropdown-menu li:hover > .dropdown-submenu {
        display: block;
    }

    .dropdown-menu li,
    .dropdown-submenu li {
        padding: 8px 10px;
    }

    .dropdown-menu li a,
    .dropdown-submenu li a {
        padding: 8px;
        text-align: left;
        color: #333;
    }

    .dropdown-menu li a:hover,
    .dropdown-submenu li a:hover {
        background-color: #8c52ff;
        color: white;
    }

    .nav-links li .dropdown-menu {
        margin-left: 15px;
        background-color: #f0f0f0;
    }

    .dropdown-submenu {
        margin-left: 30px;
        background-color: #d0d0d0;
    }

    .menu-logo,
    .submenu-logo {
        height: 25px;
    }

    .nav-links li a {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    #lang-btn {
        color: #000;
    }
}

/* Teléfonos muy pequeños */
@media (max-width: 480px) {
    .contact-section {
        padding: 15px;
    }

    .contact-card {
        padding: 20px;
    }

    .welcome-title {
        font-size: 1.3rem;
    }

    form label,
    form input,
    form select,
    form textarea,
    form button {
        font-size: 16px;
        padding: 10px;
    }

    #lang-btn {
        color: #000;
    }
}

/* ====================================================================================
   13. CLASES ESPECIALES
   ==================================================================================== */

/* Clase para ocultar elementos visualmente (accesible para screen readers) */
.oculto {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
