/*
 * SR Sélecteur de destination.
 *
 * @author    Soul Rebel Studios
 * @copyright 2026 Soul Rebel Studios
 */

.sr-destination-selector {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.sr-destination-selector__label {
    margin: 0;
    white-space: nowrap;
}

.sr-destination-selector__select {
    max-width: 15rem;
}

.sr-destination-selector__select:disabled {
    cursor: wait;
}

.sr-destination-selector__status {
    font-size: 0.85em;
}

/* ------------------------------------------------------------------
 * SR Sélecteur de destination v1.0.2
 * Sous-zone Royaume-Uni
 * ------------------------------------------------------------------ */

.sr-destination-selector__uk-zone {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.sr-destination-selector__uk-zone--hidden {
    display: none !important;
}

.sr-destination-selector__uk-label {
    margin: 0;
    white-space: nowrap;
}

.sr-destination-selector__uk-select {
    max-width: 22rem;
}

.sr-destination-selector__uk-select:disabled {
    cursor: wait;
}



/* ------------------------------------------------------------------
 * Sélecteur de pays avec recherche intégrée
 * ------------------------------------------------------------------ */

.sr-destination-country-picker {
    position: relative;
    display: inline-block;
    width: 15rem;
    max-width: 100%;
    vertical-align: middle;
}

.sr-destination-modal .sr-destination-country-picker {
    display: block;
    width: 100%;
}

.sr-destination-country-picker__native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.sr-destination-country-picker__toggle {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    width: 100%;
    min-height: 2.6rem;
    padding: 0.45rem 2rem 0.45rem 0.65rem;
    overflow: hidden;
    border: 1px solid #bbcdd2;
    border-radius: 0.25rem;
    background: #fff;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}

.sr-destination-country-picker__toggle::after {
    position: absolute;
    right: 0.7rem;
    content: "▾";
}

.sr-destination-country-picker__toggle:disabled {
    cursor: wait;
    opacity: 0.7;
}

.sr-destination-country-picker__panel {
    position: absolute;
    top: calc(100% + 0.2rem);
    right: 0;
    left: 0;
    z-index: 100020;
    display: none;
    min-width: 16rem;
    border: 1px solid #bbcdd2;
    border-radius: 0.25rem;
    background: #fff;
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.2);
}

.sr-destination-country-picker--open
.sr-destination-country-picker__panel {
    display: block;
}

.sr-destination-country-picker__search {
    display: block;
    width: calc(100% - 1rem);
    margin: 0.5rem;
    padding: 0.5rem 0.6rem;
    border: 1px solid #bbcdd2;
    border-radius: 0.25rem;
}

.sr-destination-country-picker__list {
    max-height: 16rem;
    overflow-y: auto;
}

.sr-destination-country-picker__option {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    width: 100%;
    padding: 0.5rem 0.65rem;
    border: 0;
    background: #fff;
    text-align: left;
    cursor: pointer;
}

.sr-destination-country-picker__option:hover,
.sr-destination-country-picker__option:focus {
    background: #f1f3f5;
    outline: none;
}

.sr-destination-country-picker__option--selected {
    font-weight: 700;
}

.sr-destination-country-picker__empty {
    padding: 0.65rem;
    text-align: center;
}

.sr-destination-country-flag {
    display: block;
    flex: 0 0 auto;
    width: 20px;
    height: 15px;
    object-fit: cover;
    border-radius: 1px;
}

.sr-destination-country-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ------------------------------------------------------------------
 * Fenêtre obligatoire de destination
 * ------------------------------------------------------------------ */

body.sr-destination-modal-open {
    overflow: hidden;
}

.sr-destination-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.58);
}

.sr-destination-modal--visible {
    display: flex;
}

.sr-destination-modal__dialog {
    position: relative;
    width: 100%;
    max-width: 34rem;
    padding: 1.5rem;
    background: #fff;
    border-radius: 0.5rem;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.3);
}

.sr-destination-modal__close {
    position: absolute;
    top: 0.5rem;
    right: 0.65rem;
    padding: 0.25rem 0.5rem;
    border: 0;
    background: transparent;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
}

.sr-destination-modal__title {
    margin: 0 2rem 0.75rem 0;
    font-size: 1.4rem;
    line-height: 1.25;
}

.sr-destination-modal__text {
    margin: 0 0 1.25rem;
}

.sr-destination-modal__label {
    display: block;
    margin: 1rem 0 0.35rem;
    font-weight: 600;
}

.sr-destination-modal__select {
    display: block;
    width: 100%;
    min-height: 2.6rem;
}

.sr-destination-modal__uk {
    display: block;
}

.sr-destination-modal__uk--hidden {
    display: none;
}

.sr-destination-modal__status {
    min-height: 1.4rem;
    margin-top: 0.75rem;
    font-size: 0.9rem;
}

.sr-destination-modal__confirm {
    display: block;
    width: 100%;
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
}

.sr-destination-modal__confirm:disabled {
    cursor: wait;
    opacity: 0.7;
}


@media (max-width: 768px) {
    .sr-destination-modal {
        align-items: flex-start;
        padding: 0.75rem;
    }

    .sr-destination-modal__dialog {
        margin-top: 8vh;
        padding: 1.25rem;
    }

    .sr-destination-modal__title {
        font-size: 1.25rem;
    }

    .sr-destination-selector {
        flex-wrap: wrap;
    }

    .sr-destination-selector__uk-zone {
        flex-wrap: wrap;
    }

    .sr-destination-selector__select,
    .sr-destination-selector__uk-select {
        max-width: 100%;
    }
}
