/* mistercountry – popup sélection pays */

#mct-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: mctFadeIn .2s ease;
}

#mct-popup {
    background: #fff;
    border-radius: 8px;
    width: 100%;
    max-width: 440px;
    padding: 32px 28px 24px;
    position: relative;
    box-shadow: 0 8px 40px rgba(0,0,0,.18);
    animation: mctSlideUp .22s ease;
    font-family: inherit;
}

#mct-popup .mct-logo {
    font-size: 28px;
    font-weight: 900;
    color: #0000a0;
    margin-bottom: 6px;
    letter-spacing: -1px;
}

#mct-popup h2 {
    font-size: 17px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 4px;
}

#mct-popup .mct-subtitle {
    font-size: 13px;
    color: #666;
    margin-bottom: 20px;
}

#mct-popup .mct-section-title {
    font-size: 13px;
    font-weight: 700;
    color: #1a1a1a;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 10px;
    border-bottom: 1px solid #e8e8e8;
    padding-bottom: 6px;
}

#mct-popup .mct-country-list {
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#mct-popup .mct-country-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    user-select: none;
}

#mct-popup .mct-country-item:hover {
    border-color: #0000a0;
    background: #f0f0ff;
}

#mct-popup .mct-country-item.mct-suggested {
    border-color: #0000a0;
    background: #f5f5ff;
}

#mct-popup .mct-country-item .mct-radio {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: border-color .15s;
}

#mct-popup .mct-country-item.mct-selected .mct-radio {
    border-color: #0000a0;
    background: #0000a0;
}

#mct-popup .mct-country-item.mct-selected .mct-radio::after {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
}

#mct-popup .mct-flag {
    font-size: 22px;
    line-height: 1;
}

#mct-popup .mct-country-name {
    font-size: 15px;
    font-weight: 500;
    color: #1a1a1a;
    flex: 1;
}

#mct-popup .mct-badge-suggested {
    font-size: 11px;
    background: #e8f0fe;
    color: #0000a0;
    border-radius: 20px;
    padding: 2px 8px;
    font-weight: 600;
}

#mct-popup .mct-btn-continue {
    display: block;
    width: 100%;
    padding: 13px;
    background: #0000a0;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    transition: background .15s, opacity .15s;
}

#mct-popup .mct-btn-continue:hover {
    background: #000080;
}

#mct-popup .mct-btn-continue:disabled {
    opacity: .5;
    cursor: not-allowed;
}

#mct-popup .mct-notice {
    font-size: 11px;
    color: #999;
    text-align: center;
    margin-top: 12px;
    line-height: 1.4;
}

#mct-popup .mct-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}

#mct-popup .mct-close:hover {
    color: #333;
}

@keyframes mctFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes mctSlideUp {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* Barre preview admin */
#mct-preview-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background: #e74c3c;
    color: #fff;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

#mct-preview-bar a {
    color: #fff;
    text-decoration: underline;
    font-size: 12px;
}

@media (max-width: 480px) {
    #mct-popup {
        margin: 16px;
        padding: 24px 16px 20px;
        max-width: calc(100vw - 32px);
    }
}

/* =============================================
   Sélecteur de pays – barre de navigation header
   ============================================= */

/* Wrapper principal :
   order: 3 pour s'insérer après header-nav-links (order:0 par défaut)
   et avant language-selector (order:0 aussi, mais notre ordre HTML le place après).
   On utilise order pour se glisser entre les deux dans le flex row du header-nav. */
#mct-country-selector {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: relative;
    order: 3;
    margin-left: auto;
}

/* Pousser le language-selector encore plus loin à droite + séparateur */
.header-nav .container .language-selector,
.header-nav .language-selector {
    order: 4 !important;
    margin-left: 10px !important;
    padding-left: 14px !important;
    border-left: 1px solid rgba(255,255,255,.3) !important;
}

/* Retirer le mr-auto de header-nav-links pour libérer l'espace */
.header-nav .header-nav-links {
    margin-right: 0 !important;
}

#mct-country-selector .mct-cs-label {
    white-space: nowrap;
    color: inherit;
}

/* Zone dropdown */
.mct-cs-dropdown {
    position: relative;
}

/* Trigger cliquable */
.mct-cs-trigger {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
}
.mct-cs-trigger:hover { opacity: .8; }

.mct-cs-flag img,
.mct-cs-trigger img {
    vertical-align: middle;
    border-radius: 1px;
}

.mct-cs-name {
    font-weight: 400 !important;
    letter-spacing: .02em;
}

/* Menu déroulant – fermé par défaut */
.mct-cs-menu {
    display: none;
    position: fixed;
    min-width: 230px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 6px 24px rgba(0,0,0,.18);
    z-index: 999999;
    flex-direction: column;
    max-height: 340px;
    overflow: hidden;
}

/* Ouvert */
.mct-cs-dropdown.mct-open .mct-cs-menu {
    display: flex;
}

/* Champ de recherche */
.mct-cs-search-wrap {
    padding: 8px 10px 6px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}
.mct-cs-search {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 5px 9px;
    font-size: 12px;
    outline: none;
    color: #333;
}
.mct-cs-search:focus { border-color: #e8a000; }

/* Liste des pays */
#mct-cs-list {
    list-style: none;
    margin: 0;
    padding: 4px 0;
    overflow-y: auto;
    flex: 1;
}
#mct-cs-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 13px;
    color: #333;
}
#mct-cs-list li:hover { background: #f5f5f5; }
#mct-cs-list li.mct-cs-active { font-weight: 700; color: #e8a000; background: #fff8e1; }
#mct-cs-list li.mct-cs-hidden { display: none; }

@media (max-width: 767px) {
    #mct-country-selector .mct-cs-label { display: none; }
    .mct-cs-name { display: none; }
}
