/* Scoped map UI overrides. Leaflet's coordinate panes remain LTR in both languages. */
.tour-itinerary-map .tour-itinerary-map__preview-image {
  width: 100%;
  height: auto;
  aspect-ratio: auto;
}

.tour-itinerary-map__modal {
  font-family: inherit;
}

.tour-itinerary-map__canvas {
  height: 100%;
  direction: ltr;
}

.tour-itinerary-map .tour-itinerary-map__canvas--light {
  --tour-map-route: var(--tour-map-primary, #091f50);
  background: #d7dbdc;
}

.tour-itinerary-map__filter {
  position: absolute;
}

/* Keep blue water darker than pale land and leave the route layers in full color. */
.tour-itinerary-map__canvas--light .leaflet-tile-pane {
  filter: var(--tour-map-tile-filter, grayscale(0.96) contrast(0.72) brightness(1.2));
}

.tour-itinerary-map .tour-itinerary-route-popup-wrapper .leaflet-popup-content-wrapper {
  padding: 0;
  border: 1px solid rgb(9 31 80 / 10%);
  border-radius: 24px;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 18px 50px rgb(9 31 80 / 18%);
}

.tour-itinerary-map .tour-itinerary-route-popup-wrapper .leaflet-popup-content {
  width: min(260px, calc(100vw - 48px)) !important;
  max-width: calc(100vw - 48px);
  margin: 0;
  overflow-wrap: anywhere;
}

/* Keep the requested popup shell padding-free. Space the three text rows
 * independently so the accent follows the card's complete rounded edge. */
.tour-itinerary-map .tour-itinerary-route-popup {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  box-sizing: border-box;
  min-width: 0;
  padding: 0;
  border-inline-start: 6px solid var(--tour-map-accent, #f06020);
  border-radius: 24px;
  color: var(--tour-map-primary, #091f50);
  background: #fff;
  text-align: start;
}

.tour-itinerary-map .tour-itinerary-route-popup > span {
  display: block;
  margin: 18px 18px 0;
  color: var(--tour-map-accent, #f06020);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.5;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tour-itinerary-map .tour-itinerary-route-popup > h3 {
  margin: 0 18px;
  color: var(--tour-map-primary, #091f50);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
}

.tour-itinerary-map .tour-itinerary-route-popup > p {
  margin: 0 18px 18px;
  color: var(--tour-map-muted, #68605a);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.55;
}

.tour-itinerary-map__modal[dir="rtl"],
.tour-itinerary-map__modal[dir="rtl"] .leaflet-container,
.tour-itinerary-map__modal[dir="rtl"] .tour-itinerary-route-popup,
.tour-itinerary-map__modal[dir="rtl"] .tour-itinerary-city-label {
  font-family: var(--font-family-fa, "Peyda", ui-sans-serif, system-ui, sans-serif);
}

.tour-itinerary-map__modal[dir="rtl"] .tour-itinerary-route-popup,
.tour-itinerary-map__modal[dir="rtl"] .tour-itinerary-city-label {
  direction: rtl;
  text-align: start;
}

.tour-itinerary-map__modal[dir="rtl"] .tour-itinerary-route-popup > span,
.tour-itinerary-map__modal[dir="rtl"] .tour-itinerary-city-label > span {
  letter-spacing: normal;
  text-transform: none;
}

.tour-itinerary-map__modal[dir="rtl"] .tour-itinerary-route-popup > h3 {
  line-height: 1.5;
}

.tour-itinerary-map__modal[dir="rtl"] .tour-itinerary-city-label {
  left: auto;
  right: calc(var(--marker-size) + 4px);
}

/* The close button already uses inline-end. Mirror only the control corners
 * so zoom controls never overlap it; geographic tiles/paths are not mirrored. */
.tour-itinerary-map__modal[dir="rtl"] .leaflet-left {
  left: auto;
  right: 0;
}

.tour-itinerary-map__modal[dir="rtl"] .leaflet-right {
  right: auto;
  left: 0;
}

.tour-itinerary-map__modal[dir="rtl"] .leaflet-left .leaflet-control {
  float: right;
  margin-left: 0;
  margin-right: 10px;
}

.tour-itinerary-map__modal[dir="rtl"] .leaflet-right .leaflet-control {
  float: left;
  margin-right: 0;
  margin-left: 10px;
}

.tour-itinerary-map__modal[dir="rtl"] .leaflet-control-attribution {
  direction: ltr;
  border-radius: 0 999px 0 0;
}
