/* Modal mobilité — parcours 2 étapes (origine → destination) */

.country-locale-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 99;
  width: min(520px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  overflow-x: hidden;
  overflow-y: auto;
  margin: 0;
  padding: 0;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(0, 46, 88, 0.2);
  transform: translate(-50%, -46%) scale(0.98);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.22s ease,
    visibility 0.22s ease,
    transform 0.22s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.country-locale-modal[data-state='open'] {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.country-locale-modal__close {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  margin-left: 0.5rem;
  border: 0;
  border-radius: 999px;
  background: rgba(12, 39, 179, 0.08);
  color: #161c24;
  cursor: pointer;
}

.country-locale-modal__close:hover {
  background: rgba(12, 39, 179, 0.14);
}

.country-locale-modal__body {
  padding: 1.75rem 1.5rem 1.5rem;
  overflow-x: hidden;
}

.country-locale-modal__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

/* ——— Stepper ——— */
.country-locale-modal__steps {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}

.country-locale-modal__step-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.65rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #637381;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.country-locale-modal__step-btn:disabled {
  cursor: default;
  opacity: 0.55;
}

.country-locale-modal__step-btn.is-active {
  background: rgba(12, 39, 179, 0.08);
  color: var(--color-primary, #0c27b3);
}

.country-locale-modal__step-btn.is-done {
  color: #161c24;
}

.country-locale-modal__step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  background: rgba(12, 39, 179, 0.1);
  font-size: 0.6875rem;
  font-weight: 800;
}

.country-locale-modal__step-btn.is-active .country-locale-modal__step-num {
  background: var(--color-primary, #0c27b3);
  color: #fff;
}

.country-locale-modal__step-line {
  flex: 1;
  height: 1px;
  background: rgba(12, 39, 179, 0.14);
}

/* ——— Header ——— */
.country-locale-modal__header {
  margin-bottom: 1rem;
}

.country-locale-modal__route {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(12, 39, 179, 0.06);
  font-size: 0.8125rem;
  font-weight: 600;
  color: #161c24;
}

.country-locale-modal__current,
.country-locale-modal__saved {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.55rem 0.75rem;
  border-radius: 0.75rem;
  font-size: 0.8125rem;
}

.country-locale-modal__current {
  border: 1.5px solid var(--color-primary, #0c27b3);
  background: rgba(12, 39, 179, 0.05);
}

.country-locale-modal__saved {
  border: 1px solid rgba(12, 39, 179, 0.12);
  background: #f8fbff;
}

.country-locale-modal__current-label,
.country-locale-modal__saved-label {
  flex-shrink: 0;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #637381;
}

.country-locale-modal__current-label {
  color: var(--color-primary, #0c27b3);
}

.country-locale-modal__current-route,
.country-locale-modal__saved-route {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
  color: #161c24;
}

.country-locale-modal__saved.is-dirty {
  opacity: 0.72;
}

.country-locale-modal__route-arrow {
  opacity: 0.5;
}

.country-locale-modal__header h2 {
  margin: 0 0 0.35rem;
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.25;
  color: #0b1f33;
}

.country-locale-modal__header p {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: #637381;
}

/* ——— Steps panels ——— */
.country-locale-modal__step-panel {
  display: none;
  min-width: 0;
}

.country-locale-modal__step-panel.is-active {
  display: block;
}

.country-locale-modal__hint {
  margin: 0.85rem 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #98a2b3;
}

/* ——— Search ——— */
.country-locale-modal__search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 0.875rem;
  border: 1px solid rgba(12, 39, 179, 0.14);
  border-radius: 0.875rem;
  background: #f8fbff;
}

.country-locale-modal__search .hgi,
.country-locale-modal__search i {
  color: #98a2b3 !important;
  font-size: 1.125rem;
}

.country-locale-modal__search-input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 0.9375rem;
  color: #161c24;
  outline: none;
}

/* ——— Country grids ——— */
.country-locale-modal__grid {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.country-locale-modal__grid--featured {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.country-locale-modal__grid--more,
.country-locale-modal__grid--destination {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.country-locale-modal__country {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1.5px solid rgba(12, 39, 179, 0.1);
  border-radius: 0.75rem;
  background: #fff;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: #161c24;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background-color 0.15s ease,
    box-shadow 0.15s ease;
}

.country-locale-modal__country--featured {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.85rem 0.5rem;
  text-align: center;
}

.country-locale-modal__country--featured .country-locale-modal__country-flag {
  font-size: 1.75rem;
}

.country-locale-modal__country:hover {
  border-color: rgba(12, 39, 179, 0.28);
  background: #f8fbff;
}

.country-locale-modal__country.is-selected,
.country-locale-modal__country[aria-selected='true'] {
  border-color: var(--color-primary, #0c27b3);
  background: rgba(12, 39, 179, 0.05);
  box-shadow: 0 4px 14px rgba(12, 39, 179, 0.1);
}

.country-locale-modal__country-flag {
  font-size: 1.25rem;
  line-height: 1;
}

.country-locale-modal__country-name {
  line-height: 1.25;
}

.country-locale-modal__grid [data-origin-item].is-hidden {
  display: none;
}

/* ——— More countries ——— */
.country-locale-modal__more {
  margin-top: 0.25rem;
}

.country-locale-modal__more-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.5rem;
  padding: 0.35rem 0;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-primary, #0c27b3);
  cursor: pointer;
}

.country-locale-modal__more-toggle .hgi,
.country-locale-modal__more-toggle i {
  font-size: 1rem;
}

.country-locale-modal__more:not(.is-expanded) .country-locale-modal__grid--more {
  display: none;
}

.country-locale-modal__more.is-searching .country-locale-modal__more-toggle {
  display: none;
}

.country-locale-modal__more.is-searching .country-locale-modal__grid--more {
  display: grid;
}

.country-locale-modal__empty {
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
  color: #637381;
}

/* ——— Destination hero (France) ——— */
.country-locale-modal__dest-hero {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 1rem 1rem 1rem 0.875rem;
  border: 1.5px solid rgba(12, 39, 179, 0.12);
  border-radius: 1rem;
  background: #fff;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background-color 0.15s ease,
    box-shadow 0.15s ease;
}

.country-locale-modal__dest-hero:hover {
  border-color: rgba(12, 39, 179, 0.28);
  background: #f8fbff;
  box-shadow: 0 4px 14px rgba(12, 39, 179, 0.08);
}

.country-locale-modal__dest-hero.is-selected,
.country-locale-modal__dest-hero[aria-selected='true'] {
  border-color: var(--color-primary, #0c27b3);
  border-width: 2px;
  background: linear-gradient(135deg, rgba(12, 39, 179, 0.06) 0%, rgba(12, 39, 179, 0.02) 100%);
  box-shadow: 0 8px 28px rgba(12, 39, 179, 0.18);
}

.country-locale-modal__dest-hero-flag {
  font-size: 2rem;
  line-height: 1;
}

.country-locale-modal__dest-hero-body {
  flex: 1;
  min-width: 0;
}

.country-locale-modal__dest-hero-title {
  display: block;
  font-size: 1.0625rem;
  font-weight: 700;
  color: #0b1f33;
}

.country-locale-modal__dest-hero-sub {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: #637381;
}

.country-locale-modal__dest-badge {
  flex-shrink: 0;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: var(--color-primary, #0c27b3);
  font-size: 0.6875rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}

/* ——— Language select ——— */
.country-locale-modal__lang-field {
  margin-top: 1.25rem;
  min-width: 0;
}

.country-locale-modal__lang-label {
  display: block;
  margin-bottom: 0.375rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #637381;
}

.country-locale-modal__lang-select {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-height: 2.75rem;
  padding: 0.65rem 2.5rem 0.65rem 0.875rem;
  border: 1px solid rgba(12, 39, 179, 0.16);
  border-radius: 0.75rem;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23637381' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
  background-size: 1rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.35;
  color: #161c24;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.country-locale-modal__lang-select:hover {
  border-color: rgba(12, 39, 179, 0.28);
}

.country-locale-modal__lang-select:focus {
  outline: none;
  border-color: var(--color-primary, #0c27b3);
  box-shadow: 0 0 0 3px rgba(12, 39, 179, 0.12);
}

/* ——— Footer ——— */
.country-locale-modal__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(12, 39, 179, 0.1);
}

.country-locale-modal__footer-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

.country-locale-modal__back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.65rem;
  border: 0;
  border-radius: 0.5rem;
  background: transparent;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: #637381;
  cursor: pointer;
}

.country-locale-modal__back:hover {
  color: #161c24;
  background: rgba(12, 39, 179, 0.06);
}

.country-locale-modal__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.65rem 1.25rem;
  border: 0;
  border-radius: 999px;
  background: var(--color-primary, #0c27b3);
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: background-color 0.15s ease, opacity 0.15s ease;
}

.country-locale-modal__submit:hover:not(:disabled) {
  background: #0a2199;
}

.country-locale-modal__submit:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.country-locale-modal__submit .hgi,
.country-locale-modal__submit i {
  font-size: 1.125rem;
}

.country-locale-modal__skip {
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: #637381;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.country-locale-modal__skip:hover {
  color: #161c24;
}

.country-locale-modal[data-onboarding='true'] .country-locale-modal__close {
  display: none;
}

@media (max-width: 479px) {
  .country-locale-modal__body {
    padding: 1.35rem 1.15rem 1.15rem;
  }

  .country-locale-modal__grid--featured {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .country-locale-modal__country--featured .country-locale-modal__country-name {
    font-size: 0.75rem;
  }

  .country-locale-modal__dest-badge {
    display: none;
  }

  .country-locale-modal__footer {
    flex-wrap: wrap;
  }

  .country-locale-modal__footer-actions {
    width: 100%;
    justify-content: stretch;
  }

  .country-locale-modal__submit {
    flex: 1;
  }
}
