/* =============================================
   DC Lang Switcher — Floating
   ============================================= */

#dc-lang-switcher {
    position: fixed;
    z-index: 99999;
    user-select: none;
}

/* --- Toggle button --- */
.dc-lang-switcher__toggle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: #fff;
    box-shadow: 0 3px 14px rgba(0,0,0,.18);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .2s ease, box-shadow .2s ease;
    padding: 0;
    outline: none;
}

.dc-lang-switcher__toggle:hover,
.dc-lang-switcher--open .dc-lang-switcher__toggle {
    transform: scale(1.1);
    box-shadow: 0 5px 18px rgba(0,0,0,.26);
}

.dc-lang-switcher__flag-img {
    display: block;
    width: 26px;
    height: 26px;
    object-fit: contain;
    flex-shrink: 0;
}

.dc-lang-switcher__option .dc-lang-switcher__flag-img {
    width: 20px;
    height: 20px;
}

/* --- Dropdown menu --- */
.dc-lang-switcher__menu {
    position: absolute;
    top: calc(100% + 8px);
    bottom: auto;
    right: 0;
    left: auto;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 6px 24px rgba(0,0,0,.13);
    min-width: 165px;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .22s ease, transform .22s ease, visibility .22s;
    pointer-events: none;
}

.dc-lang-switcher--open .dc-lang-switcher__menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* Ouverture vers le HAUT */
.dc-lang-switcher--menu-up .dc-lang-switcher__menu {
    top: auto;
    bottom: calc(100% + 8px);
    transform: translateY(6px);
}

.dc-lang-switcher--menu-up.dc-lang-switcher--open .dc-lang-switcher__menu {
    transform: translateY(0);
}

/* Alignement horizontal géré directement par JS (.css()) */

/* --- Language options --- */
.dc-lang-switcher__option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    color: #222;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background .15s ease, padding-left .15s ease;
    border-left: 3px solid transparent;
}

.dc-lang-switcher__option:hover {
    background: #f4f4f4;
    padding-left: 20px;
    color: #222;
    text-decoration: none;
}

.dc-lang-switcher__option.is-active {
    background: #edf4ff;
    border-left-color: #2271b1;
    color: #2271b1;
    font-weight: 600;
}

.dc-lang-switcher__option .dc-lang-switcher__flag {
    font-size: 20px;
    flex-shrink: 0;
}

.dc-lang-switcher__name {
    white-space: nowrap;
}

/* --- Tour page — décalé vers le haut (mobile seulement) --- */
@media (max-width: 768px) {
    .is-tour-page .dc-lang-switcher--tour-page {
        transform: translateY(-65px);
    }

    /* Z-index du bouton de réservation hotel sur page croisière mobile */
    .is-tour-page #st-content-wrapper .hotel-target-book-mobile {
        z-index: 9999;
    }
}

/* --- Admin hover hint --- */
.dc-lang-switcher--admin:hover {
    outline: 2px dashed #2271b1;
    outline-offset: 6px;
    border-radius: 28px;
}

/* =============================================
   Popup de positionnement (admin)
   ============================================= */

.dc-ls-popup {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dc-ls-popup[hidden] {
    display: none;
}

.dc-ls-popup__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.45);
    backdrop-filter: blur(3px);
}

.dc-ls-popup__box {
    position: relative;
    background: #fff;
    border-radius: 14px;
    padding: 28px 28px 22px;
    width: 380px;
    max-width: calc(100vw - 40px);
    box-shadow: 0 20px 60px rgba(0,0,0,.22);
    display: flex;
    flex-direction: column;
    gap: 18px;
    animation: dcLsPopupIn .18s ease;
    margin: 0 auto;
}

@keyframes dcLsPopupIn {
    from { opacity: 0; transform: scale(.93) translateY(6px); }
    to   { opacity: 1; transform: scale(1)   translateY(0);   }
}

.dc-ls-popup__title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #1d2327;
    line-height: 1.3;
}

/* Grille des 4 inputs */
.dc-ls-popup__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 12px;
}

.dc-ls-popup__group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dc-ls-popup__label {
    font-size: 12px;
    font-weight: 600;
    color: #50575e;
    margin: 0;
}

.dc-ls-popup__input-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dc-ls-popup__input {
    flex: 1;
    padding: 8px 10px;
    border: 2px solid #dcdcde;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    color: #1d2327;
    transition: border-color .15s ease;
    box-sizing: border-box;
    -moz-appearance: textfield;
}

.dc-ls-popup__input::-webkit-inner-spin-button,
.dc-ls-popup__input::-webkit-outer-spin-button {
    opacity: 1;
    height: 18px;
}

.dc-ls-popup__input:focus {
    border-color: #2271b1;
    outline: none;
    box-shadow: 0 0 0 3px rgba(34,113,177,.15);
}

.dc-ls-popup__unit {
    font-size: 11px;
    font-weight: 600;
    color: #8c8f94;
    white-space: nowrap;
}

/* Boutons d'action */
.dc-ls-popup__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 6px;
}

.dc-ls-popup__btn {
    padding: 9px 20px;
    border-radius: 7px;
    border: none;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background .15s ease, opacity .15s ease;
}

.dc-ls-popup__btn--cancel {
    background: #f0f0f1;
    color: #50575e;
}

.dc-ls-popup__btn--cancel:hover {
    background: #dcdcde;
}

.dc-ls-popup__btn--save {
    background: #2271b1;
    color: #fff;
}

.dc-ls-popup__btn--save:hover {
    background: #135e96;
}

.dc-ls-popup__btn:disabled {
    opacity: .6;
    cursor: not-allowed;
}

/* --- RTL support (Hebrew) --- */
html[dir="rtl"] .dc-lang-switcher__option {
    border-left: none;
    border-right: 3px solid transparent;
    flex-direction: row-reverse;
}

html[dir="rtl"] .dc-lang-switcher__option:hover {
    padding-left: 16px;
    padding-right: 20px;
}

html[dir="rtl"] .dc-lang-switcher__option.is-active {
    border-right-color: #2271b1;
}

/* RTL Popup */
html[dir="rtl"] .dc-ls-popup__box {
    width: 380px;
    margin: 0 auto;
}

html[dir="rtl"] .dc-ls-popup__label {
    text-align: right;
}

html[dir="rtl"] .dc-ls-popup__input-wrapper {
    flex-direction: row-reverse;
}

html[dir="rtl"] .dc-ls-popup__grid {
    text-align: right;
}

/* --- Responsive --- */
@media (max-width: 480px) {
    .dc-lang-switcher__toggle {
        width: 42px;
        height: 42px;
    }

    .dc-lang-switcher__toggle .dc-lang-switcher__flag {
        font-size: 22px;
    }

    .dc-lang-switcher__option {
        padding: 10px 14px;
        font-size: 13px;
    }

    .dc-ls-popup__box {
        width: 90vw;
        padding: 22px 20px 18px;
    }

    .dc-ls-popup__grid {
        grid-template-columns: 1fr;
        gap: 12px 0;
    }
}

/* =============================================
   DC WhatsApp Floating Button
   ============================================= */
.dc-whatsapp-float {
    position: fixed;
    z-index: 99998;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #25D366;
    box-shadow: 0 3px 14px rgba(0,0,0,.18);
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.dc-whatsapp-float:hover,
.dc-whatsapp-float:focus {
    transform: scale(1.1);
    box-shadow: 0 5px 18px rgba(0,0,0,.26);
    background: #1ebe5d;
}
.dc-whatsapp-float svg { display: block; }

html[dir="rtl"] .dc-whatsapp-float { direction: ltr; }

/* =============================================
   DC Header Lang Switcher — inline (.st-list)
   ============================================= */
#main-menu,
.main-menu { white-space: nowrap; }
#main-menu > li.dc-header-lang,
.main-menu > li.dc-header-lang {
    position: relative;
    list-style: none;
    display: inline-block !important;
    float: none !important;
    clear: none !important;
    width: auto !important;
    vertical-align: middle;
    white-space: nowrap;
}
#main-menu > li.dc-header-lang,
.main-menu > li.dc-header-lang { background: transparent !important; border: 0 !important; box-shadow: none !important; border-radius: 0 !important; }
.dc-header-lang .dc-header-lang__toggle {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center;
    gap: 8px;
    padding: 35px 10px !important;
    margin: 0 !important;
    line-height: 20px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    cursor: pointer;
    text-decoration: none !important;
    line-height: 1 !important;
    height: auto !important;
    width: auto !important;
    background: transparent !important;
    color: inherit !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}
.dc-header-lang .dc-header-lang__toggle:hover,
.dc-header-lang.is-open .dc-header-lang__toggle {
    background: transparent !important;
    box-shadow: none !important;
}
.dc-header-lang .dc-header-lang__toggle .dc-lang-switcher__flag-img {
    width: 26px;
    height: auto;
    display: block;
    border-radius: 0;
    object-fit: contain;
    box-shadow: none;
    clip-path: none;
    transform: none;
    vertical-align: middle;
}
.dc-header-lang,
.dc-header-lang .dc-header-lang__toggle { align-self: center; }
.dc-header-lang__current {
    font-weight: 700;
    font-size: 12px;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: inherit;
}
.dc-header-lang .dc-header-lang__toggle .fa-angle-down {
    font-size: 12px;
    margin-left: 2px;
    opacity: .6;
    transition: transform .2s ease;
}
.dc-header-lang.is-open .dc-header-lang__toggle .fa-angle-down {
    transform: rotate(180deg);
}
.dc-header-lang__menu {
    position: absolute;
    top: 100%;
    right: 0;
    left: auto;
    min-width: 160px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 6px 24px rgba(0,0,0,.13);
    list-style: none;
    margin: 6px 0 0;
    padding: 6px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s;
    z-index: 9999;
}
.dc-header-lang.is-open .dc-header-lang__menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.dc-header-lang__option a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 18px 9px 22px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
}
html[dir="rtl"] .dc-header-lang__option a,
body.dc-lang-he .dc-header-lang__option a {
    padding: 9px 22px 9px 18px;
    flex-direction: row-reverse;
}
.dc-header-lang__option a:hover { background: #f5f7fa; }
.dc-header-lang__option.is-active a { font-weight: 700; }
.dc-header-lang__option .dc-lang-switcher__flag-img { width: 20px; height: 20px; display: block; }

/* RTL — flip dropdown anchor */
html[dir="rtl"] .dc-header-lang__menu,
body.dc-lang-he .dc-header-lang__menu {
    right: auto;
    left: 0;
}

/* WhatsApp — décalage mobile sur pages croisière pour ne pas chevaucher la bande de réservation */
@media (max-width: 768px) {
    .is-tour-page .dc-whatsapp-float--tour-page {
        transform: translateY(-65px);
    }
}

/* =============================================
   Header — compact (override theme padding)
   ============================================= */
.header.header-sticky-menu { min-height: 0; }
.header__center #st-main-menu .main-menu > li > a { padding: 18px 20px !important; }
.dc-header-lang .dc-header-lang__toggle { padding: 18px 12px !important; }
.header .logo { display: inline-flex; align-items: center; }
.header .logo img { max-height: 54px; width: auto; height: auto; margin: 0; vertical-align: middle; }
@media (max-width: 991px) {
    .header__center #st-main-menu .main-menu > li > a { padding: 14px 14px !important; }
    .dc-header-lang .dc-header-lang__toggle { padding: 14px 10px !important; }
    .header .logo img { max-height: 44px; }
}
