/**
 * Sélecteur de langue - La Capitane
 * Position : Header, à droite du bouton Réserver
 */

/* Container du sélecteur */
.lang-selector {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 0.75rem;
}

/* Bouton principal (langue actuelle) */
.lang-current {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: 1px solid rgba(30, 58, 95, 0.2);
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Lato', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--bleu-marine, #1E3A5F);
    transition: all 0.2s ease;
}

.lang-current:hover {
    background: var(--sable, #F5F0E8);
    border-color: var(--bleu-marine, #1E3A5F);
}

/* Drapeau emoji */
.lang-flag {
    font-size: 1.1rem;
    line-height: 1;
}

/* Code langue (FR, EN, etc.) */
.lang-code {
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* Flèche dropdown */
.lang-arrow {
    transition: transform 0.2s ease;
    opacity: 0.7;
}

.lang-selector.open .lang-arrow {
    transform: rotate(180deg);
}

/* Dropdown menu */
.lang-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 160px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
    overflow: hidden;
}

.lang-selector.open .lang-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Option de langue */
.lang-option {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 1rem;
    color: var(--bleu-marine, #1E3A5F);
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.15s ease;
}

.lang-option:hover {
    background: var(--sable, #F5F0E8);
}

.lang-option.active {
    background: var(--bleu-marine, #1E3A5F);
    color: #fff;
}

.lang-option .lang-flag {
    font-size: 1.2rem;
}

.lang-option .lang-name {
    font-weight: 500;
}

/* Header scrolled - ajustements */
#header.scrolled .lang-current {
    padding: 0.4rem 0.6rem;
}

/* =====================
   RESPONSIVE
   ===================== */

/* Tablette */
@media (max-width: 1024px) {
    .lang-selector {
        margin-left: 0.5rem;
    }
    
    .lang-code {
        display: none;
    }
    
    .lang-current {
        padding: 0.45rem 0.6rem;
    }
}

/* Mobile - sélecteur visible à côté du menu hamburger */
@media (max-width: 768px) {
    /* Cacher le sélecteur dans le menu nav */
    .nav-links .lang-selector {
        display: none;
    }
    
    /* Sélecteur mobile visible dans le header */
    .lang-selector-mobile {
        display: flex !important;
        position: relative;
        margin-right: 12px;
    }
    
    .lang-selector-mobile .lang-current {
        padding: 0.4rem 0.5rem;
        background: transparent;
        border: 1px solid rgba(30, 58, 95, 0.3);
        border-radius: 6px;
        gap: 0.25rem;
    }
    
    .lang-selector-mobile .lang-code {
        display: inline;
        font-size: 0.8rem;
    }
    
    .lang-selector-mobile .lang-flag {
        font-size: 1rem;
    }
    
    .lang-selector-mobile .lang-arrow {
        width: 10px;
        height: 10px;
    }
    
    .lang-selector-mobile .lang-dropdown {
        position: absolute;
        top: calc(100% + 0.5rem);
        right: 0;
        left: auto;
        min-width: 140px;
        background: #fff;
        border-radius: 8px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: all 0.2s ease;
        z-index: 1001;
        max-height: none;
        overflow: visible;
    }
    
    .lang-selector-mobile.open .lang-dropdown {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    
    .lang-selector-mobile .lang-option {
        background: transparent;
        margin-bottom: 0;
        border-radius: 0;
        justify-content: flex-start;
        padding: 0.6rem 0.8rem;
    }
    
    .lang-selector-mobile .lang-option:first-child {
        border-radius: 8px 8px 0 0;
    }
    
    .lang-selector-mobile .lang-option:last-child {
        border-radius: 0 0 8px 8px;
    }
}

/* Desktop - cacher le sélecteur mobile */
@media (min-width: 769px) {
    .lang-selector-mobile {
        display: none !important;
    }
}

/* Animation du clic */
@keyframes langPulse {
    0% { transform: scale(1); }
    50% { transform: scale(0.97); }
    100% { transform: scale(1); }
}

.lang-current:active {
    animation: langPulse 0.15s ease;
}
