/**
 * Footer Styles - Tema Xacobeos (Estilo Airbnb + Concha del Camino)
 * 
 * PROPÓSITO:
 * Footer moderno estilo Airbnb con coherencia visual con el header.
 * Utiliza los colores oficiales de la concha del Camino de Santiago.
 */

/* ================================
   VARIABLES CSS - COLORES OFICIALES CONCHA
   ================================ */
:root {
    --camino-blue: #1E4A8C;         /* Azul oficial concha */
    --camino-blue-dark: #162F5A;    /* Azul más oscuro */
    --camino-blue-light: #3B6BB0;   /* Azul más claro para hover */
    --camino-yellow: #FFD700;       /* Amarillo oficial concha */
    --camino-yellow-dark: #E6C200;  /* Amarillo más oscuro para hover */
    --white: #FFFFFF;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --shadow-light: rgba(0, 0, 0, 0.05);
    --shadow-medium: rgba(0, 0, 0, 0.1);
}

/* ================================
   FOOTER PRINCIPAL ESTILO AIRBNB
   ================================ */
.site-footer {
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    margin-top: auto;
    color: var(--gray-700);
}

/* ================================
   SECCIÓN PRINCIPAL DEL FOOTER
   ================================ */
.footer-main {
    padding: 48px 0;
}

.footer-main .site-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 64px;
    align-items: start;
}

/* ================================
   BRANDING Y DESCRIPCIÓN
   ================================ */
.footer-brand {
    max-width: 320px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

/* Logo SVG en footer */
.footer-logo img {
    height: 32px;
    width: auto;
    transition: transform 0.3s ease;
}

.footer-logo a:hover img {
    transform: scale(1.05);
}

.footer-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--camino-blue);
    letter-spacing: -0.02em;
}

.footer-description {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--gray-600);
    margin-bottom: 24px;
    margin-top: 0;
}

/* ================================
   ENLACES SOCIALES ESTILO AIRBNB
   ================================ */
.footer-social {
    display: flex;
    gap: 12px;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: var(--gray-500);
    background: var(--gray-100);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.social-link:hover {
    color: var(--camino-blue);
    background: var(--gray-200);
    transform: translateY(-1px);
}

.social-link svg {
    width: 16px;
    height: 16px;
}

/* ================================
   COLUMNAS DE ENLACES
   ================================ */
.footer-links {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 32px;
}

.footer-column-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 16px;
    margin-top: 0;
    letter-spacing: 0.025em;
}

.footer-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-menu li {
    margin-bottom: 8px;
}

.footer-menu a {
    font-size: 0.875rem;
    color: var(--gray-600);
    text-decoration: none;
    transition: color 0.2s ease;
    display: block;
    padding: 4px 0;
}

.footer-menu a:hover {
    color: var(--camino-blue);
}

/* ================================
   BARRA INFERIOR ESTILO AIRBNB
   ================================ */
.footer-bottom {
    padding: 20px 0;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.footer-bottom .site-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    align-items: center;
}

.footer-bottom-left {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-bottom-left p {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin: 0;
}

.footer-legal-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-legal-links a {
    font-size: 0.875rem;
    color: var(--gray-500);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-legal-links a:hover {
    color: var(--camino-blue);
    text-decoration: underline;
}

.separator {
    color: var(--gray-400);
    font-size: 0.875rem;
}

.footer-bottom-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 24px;
}

/* ================================
   SELECTOR DE IDIOMAS FUNCIONAL (Estilo Header)
   ================================ */
.footer-language-selector {
    position: relative;
    display: flex;
    align-items: center;
    cursor: pointer;
    border: 1px solid #DDDDDD;
    border-radius: 21px;
    padding: 5px 12px 5px 12px;
    background: var(--white);
    transition: box-shadow 0.2s ease;
    height: 42px;
    min-height: 42px;
    user-select: none;
}

.footer-language-selector:hover {
    box-shadow: 0 2px 4px var(--shadow-light);
}

.footer-current-language {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #222222;
}

.footer-lang-flag img {
    border-radius: 2px;
    object-fit: cover;
}

.footer-lang-flag {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    line-height: 1;
    width: 20px;
    height: 15px;
}

.footer-lang-code {
    font-size: 13px;
    font-weight: 600;
}

.footer-dropdown-arrow {
    font-size: 10px;
    color: #717171;
    transition: transform 0.2s ease;
}

.footer-language-selector[aria-expanded="true"] .footer-dropdown-arrow {
    transform: rotate(180deg);
}

/* Dropdown de idiomas - Idéntico al header pero hacia arriba */
.footer-language-dropdown {
    position: absolute;
    bottom: 100%;
    right: 0;
    background: var(--white);
    border: 1px solid #DDDDDD;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    margin-bottom: 8px;
    opacity: 0;
    transform: translateY(8px);
    transition: all 0.2s ease;
    z-index: 1000;
    display: none;
}

.footer-language-dropdown.show {
    opacity: 1;
    transform: translateY(0);
    display: block;
}

.footer-dropdown-content {
    padding: 8px 0;
}

.footer-language-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.footer-language-item:hover {
    background-color: #F7F7F7;
}

.footer-language-item img {
    width: 20px;
    height: 15px;
    object-fit: cover;
    border-radius: 2px;
    flex-shrink: 0;
}

.footer-flag-emoji {
    font-size: 16px;
    line-height: 1;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.footer-lang-name {
    flex: 1;
    font-weight: 500;
}

/* ================================
   CRÉDITOS
   ================================ */
.footer-credits {
    font-size: 0.875rem;
    color: var(--gray-500);
}

.footer-credits a {
    color: var(--camino-blue);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.footer-credits a:hover {
    color: var(--camino-blue-dark);
}

/* ================================
   MEJORAS PARA DISPOSITIVOS TÁCTILES
   ================================ */
.footer-language-selector.touch-device:hover .footer-current-language {
    /* Desactivar hover en dispositivos táctiles */
    border-color: var(--gray-200);
    background: var(--white);
}

.footer-language-selector.touch-device .footer-current-language:active {
    border-color: var(--gray-300);
    background: var(--gray-50);
}

/* ================================
   RESPONSIVE DESIGN
   ================================ */
@media (max-width: 1024px) {
    .footer-main .site-container {
        grid-template-columns: 1fr;
        gap: 48px;
    }
    
    .footer-links {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
    
    .footer-bottom .site-container {
        grid-template-columns: 1fr;
        gap: 16px;
        text-align: center;
    }
    
    .footer-bottom-right {
        justify-content: center;
    }
    
    .footer-legal-links {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .footer-main {
        padding: 32px 0;
    }
    
    .footer-main .site-container {
        padding: 0 var(--padding-container-md);
        gap: 32px;
    }
    
    .footer-links {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .footer-brand {
        max-width: none;
        text-align: center;
    }
    
    .footer-logo {
        justify-content: center;
    }
    
    .footer-social {
        justify-content: center;
    }
    
    .footer-bottom {
        padding: 16px 0;
    }
    
    .footer-bottom .site-container {
        padding: 0 var(--padding-container-md);
    }
    
    .footer-legal-links {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .footer-main .site-container {
        padding: 0 var(--padding-container-sm);
    }
    
    .footer-links {
        gap: 20px;
    }
    
    .footer-column-title {
        font-size: 0.8rem;
        margin-bottom: 12px;
    }
    
    .footer-menu a {
        font-size: 0.8rem;
    }
    
    .footer-legal-links {
        flex-direction: column;
        gap: 4px;
    }
    
    .separator {
        display: none;
    }
    
    .footer-bottom-right {
        flex-direction: column;
        gap: 12px;
    }
}

/* ================================
   ANIMACIONES Y ESTADOS
   ================================ */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.footer-brand,
.footer-column {
    animation: fadeInUp 0.6s ease forwards;
}

.footer-column:nth-child(2) {
    animation-delay: 0.1s;
}

.footer-column:nth-child(3) {
    animation-delay: 0.2s;
}

.footer-column:nth-child(4) {
    animation-delay: 0.3s;
}

/* ================================
   FOCUS STATES PARA ACCESIBILIDAD
   ================================ */
.footer-menu a:focus,
.social-link:focus,
.footer-legal-links a:focus,
.footer-credits a:focus {
    outline: 2px solid var(--camino-blue);
    outline-offset: 2px;
    border-radius: 4px;
}

.footer-current-language:focus {
    outline: 2px solid var(--camino-blue);
    outline-offset: 2px;
    border-radius: 21px;
}

/* ================================
   DARK MODE SUPPORT (OPCIONAL)
   ================================ */
@media (prefers-color-scheme: dark) {
    .site-footer {
        background: var(--gray-900);
        border-top-color: var(--gray-700);
        color: var(--gray-300);
    }
    
    .footer-title {
        color: var(--white);
    }
    
    .footer-description {
        color: var(--gray-400);
    }
    
    .footer-column-title {
        color: var(--gray-200);
    }
    
    .footer-menu a {
        color: var(--gray-400);
    }
    
    .footer-menu a:hover {
        color: var(--camino-yellow);
    }
    
    .footer-bottom {
        background: var(--gray-800);
        border-top-color: var(--gray-700);
    }
    
    .social-link {
        background: var(--gray-700);
        color: var(--gray-400);
    }
    
    .social-link:hover {
        background: var(--gray-600);
        color: var(--camino-yellow);
    }
    
    .footer-language {
        background: var(--gray-800);
        border-color: var(--gray-700);
        color: var(--gray-300);
    }
    
    .footer-language:hover {
        background: var(--gray-700);
        border-color: var(--gray-600);
    }
}