/**
 * Language Switcher - Styles
 *
 * CSS per il selettore lingua - Versione ufficiale
 *
 * @package Fedemodel
 * @version 2.0
 * @date 2025-10-09
 */

/* ============================================
   LANGUAGE SWITCHER CONTAINER
   ============================================ */

.bz-language-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 15px;
    padding: 5px 12px;
    background: rgba(243, 187, 39, 0.08);
    border-radius: 20px;
    transition: all 0.3s ease;
}

.bz-language-switcher:hover {
    background: rgba(243, 187, 39, 0.12);
}

/* ============================================
   LANGUAGE LINKS (FLAGS)
   ============================================ */

.bz-language-switcher .lang-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 22px;
    line-height: 1;
    text-decoration: none;
    transition: all 0.25s ease;
    position: relative;
}

.bz-language-switcher .flag-icon {
    width: 24px;
    height: 18px;
    display: block;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    opacity: 0.6;
    filter: grayscale(50%);
    transition: all 0.25s ease;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.bz-language-switcher .lang-link:hover .flag-icon {
    opacity: 1;
    filter: grayscale(0%) brightness(1.05);
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.bz-language-switcher .lang-link.active .flag-icon {
    opacity: 1;
    filter: grayscale(0%);
    transform: translate(-50%, -50%) scale(1.15);
    box-shadow: 0 2px 8px rgba(243, 187, 39, 0.4);
    border: 2px solid #f3bb27;
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */

/* Nasconde intera topbar su mobile (allineato con breakpoint standard) */
@media (max-width: 767px) {
    .bz-topbar-area-2 {
        display: none !important;
    }
}

@media (max-width: 991px) {
    /* Su tablet/mobile, nascondi lo switcher nell'header */
    /* Apparirà solo nel menu mobile (aside.php) */
    .bz-language-switcher {
        display: none;
    }
}

@media (max-width: 575px) {
    /* Mobile molto piccolo - bandiere compatte */
    .bz-language-switcher {
        gap: 6px;
        padding: 4px 8px;
        margin-left: 8px;
    }

    .bz-language-switcher .flag-icon {
        width: 20px;
        height: 15px;
    }
}

/* ============================================
   VERSIONE SIDEBAR MOBILE (per aside.php)
   ============================================ */

/* Language switcher nel menu mobile laterale */
.bz-sidebar-language-switcher {
    padding: 20px 30px;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    margin: 15px 0;
}

.bz-sidebar-language-switcher .lang-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bz-sidebar-language-switcher .lang-title span {
    font-size: 18px;
}

.bz-sidebar-language-switcher .lang-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.bz-sidebar-language-switcher .lang-link {
    flex: 1;
    min-width: 60px;
    padding: 12px;
    text-align: center;
    line-height: 1;
    text-decoration: none;
    background: #f8f8f8;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bz-sidebar-language-switcher .flag-icon {
    width: 48px;
    height: 36px;
    display: block;
    border-radius: 4px;
    opacity: 0.6;
    filter: grayscale(50%);
    transition: all 0.3s ease;
}

.bz-sidebar-language-switcher .lang-link:hover {
    border-color: #f3bb27;
    background: rgba(243, 187, 39, 0.08);
    transform: scale(1.05);
}

.bz-sidebar-language-switcher .lang-link:hover .flag-icon {
    opacity: 1;
    filter: grayscale(0%);
}

.bz-sidebar-language-switcher .lang-link.active {
    background: rgba(243, 187, 39, 0.15);
    border-color: #f3bb27;
    border-width: 3px;
    box-shadow: 0 3px 8px rgba(243, 187, 39, 0.3);
}

.bz-sidebar-language-switcher .lang-link.active .flag-icon {
    opacity: 1;
    filter: grayscale(0%);
}

/* ============================================
   ACCOUNT SECTION MOBILE (per aside.php)
   ============================================ */

.bz-sidebar-account-section {
    padding: 20px 30px;
    border-bottom: 1px solid #eee;
}

.bz-sidebar-account-section .account-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bz-sidebar-account-section .account-title i {
    font-size: 16px;
    color: #f3bb27;
}

.bz-sidebar-account-section .account-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bz-sidebar-account-section .account-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: #f8f8f8;
    border: 1px solid #eee;
    border-radius: 6px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
}

.bz-sidebar-account-section .account-link:hover {
    background: rgba(243, 187, 39, 0.15);
    border-color: #f3bb27;
    color: #333;
}

.bz-sidebar-account-section .account-link i {
    font-size: 16px;
    color: #f3bb27;
}

/* ============================================
   ANIMATION
   ============================================ */

/* Animazione fade-in al caricamento */
.bz-language-switcher {
    animation: fadeInLangSwitcher 0.3s ease-in;
}

@keyframes fadeInLangSwitcher {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

/* Focus per navigazione tastiera */
.bz-language-switcher .lang-link:focus {
    outline: 2px solid #f3bb27;
    outline-offset: 2px;
}

.bz-language-switcher .lang-link:focus:not(:focus-visible) {
    outline: none;
}

/* ============================================
   TOOLTIP (opzionale)
   ============================================ */

.bz-language-switcher .lang-link[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-size: 11px;
    white-space: nowrap;
    border-radius: 4px;
    pointer-events: none;
    z-index: 1000;
}

/* ============================================
   VARIANT V1 - ENHANCED VISIBILITY
   ============================================ */

/* Per homepage-v1, miglioriamo la visibilità dello switcher */
.homepage-v1 .bz-language-switcher {
    background: linear-gradient(135deg, rgba(243, 187, 39, 0.15) 0%, rgba(240, 165, 33, 0.15) 100%);
    border: 1px solid rgba(243, 187, 39, 0.3);
    padding: 6px 12px;
}

.homepage-v1 .bz-language-switcher:hover {
    background: linear-gradient(135deg, rgba(243, 187, 39, 0.25) 0%, rgba(240, 165, 33, 0.25) 100%);
    border-color: rgba(243, 187, 39, 0.5);
    box-shadow: 0 2px 8px rgba(243, 187, 39, 0.2);
}

.homepage-v1 .bz-language-switcher .lang-link {
    padding: 4px 8px;
    font-size: 13px;
}

.homepage-v1 .bz-language-switcher .lang-link.active {
    box-shadow: 0 3px 8px rgba(243, 187, 39, 0.4);
    transform: scale(1.05);
}

.homepage-v1 .bz-language-switcher .lang-label {
    font-size: 18px;
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .bz-language-switcher,
    .bz-sidebar-language-switcher {
        display: none !important;
    }
}

/* ============================================
   DARK MODE (per future implementazioni)
   ============================================ */

/*
@media (prefers-color-scheme: dark) {
    .bz-language-switcher {
        background: rgba(243, 187, 39, 0.2);
    }

    .bz-language-switcher .lang-link {
        color: #ccc;
    }

    .bz-language-switcher .lang-link:hover {
        color: #f3bb27;
    }

    .bz-language-switcher .separator {
        color: #555;
    }
}
*/

/* ============================================
   FIX LAYOUT SHIFT ON LANGUAGE SWITCH
   ============================================ */

/* Previene il movimento degli elementi quando cambio lingua */
.bz-topbar-right-item-link {
    white-space: nowrap;
}

/* Fisso la larghezza del topbar per evitare layout shift */
.bz-topbar-right-2 {
    min-width: 0;
    flex-shrink: 0;
}

.bz-topbar-right-item {
    flex-shrink: 0;
}

/* Garantisco che il language switcher sia fisso */
.bz-language-switcher {
    flex-shrink: 0;
    min-width: fit-content;
}

/* Fix anche per il bottom header */
.bz-bottom-right-2 {
    min-width: 0;
}

.bz-bottom-right-account-info-2 {
    min-width: 0;
}

.bz-bottom-right-account-info-2 a {
    white-space: nowrap;
}

/* Evito che l'area right si espanda troppo */
.bz-right-wrap-2 {
    flex-shrink: 0;
}

/* Fix specifico per la sezione icone (carrello + wishlist) */
.bz-bottom-right-social-2.myloginheadericon {
    flex-shrink: 0;
    min-width: 80px; /* Larghezza minima fissa per 2 icone */
    display: flex;
    gap: 10px;
}

/* Assicuro che le icone non si spostino */
.bz-bottom-right-social-2.myloginheadericon a {
    flex-shrink: 0;
}

/* Fix per la sezione account (login/logout) */
.bz-bottom-right-account-2 {
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
}

/* Line height per testo su 2 righe */
.bz-bottom-right-account-info-2 a {
    line-height: 1.3;
    display: inline-block;
}
