/* Termómetro de presupuesto y mapa · Viajario 0.5.0 */
.trip-budget-thermometer {
  margin: 18px 0 16px;
  padding: clamp(23px, 4vw, 34px);
  color: #fff;
  background:
    radial-gradient(circle at 93% -10%, rgba(235, 98, 85, 0.44), transparent 16rem),
    linear-gradient(125deg, #061857, #10296f);
  border-radius: 24px;
  box-shadow: 0 18px 50px rgba(6, 24, 87, 0.12);
}

.trip-budget-thermometer.is-over {
  background:
    radial-gradient(circle at 93% -10%, rgba(255, 172, 164, 0.36), transparent 16rem),
    linear-gradient(125deg, #541d2c, #9f3841);
}

.trip-budget-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.trip-budget-heading .eyebrow {
  color: #ffaaa2;
}

.trip-budget-heading h2 {
  margin: 6px 0 0;
  color: #fff;
  font-size: clamp(24px, 4vw, 34px);
  letter-spacing: -0.035em;
}

.budget-manage-button {
  flex: 0 0 auto;
  color: #061857;
  background: #fff;
}

.budget-manage-button:hover {
  color: #fff;
  background: #eb6255;
}

.budget-not-configured {
  margin-top: 25px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 17px;
}

.budget-empty-gauge {
  flex: 0 0 auto;
  width: 78px;
  height: 13px;
  padding: 3px;
  background: rgba(255, 255, 255, 0.19);
  border-radius: 99px;
}

.budget-empty-gauge i {
  width: 24%;
  height: 100%;
  display: block;
  background: rgba(255, 255, 255, 0.48);
  border-radius: inherit;
}

.budget-not-configured strong,
.budget-not-configured p {
  display: block;
}

.budget-not-configured p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
}

.trip-budget-numbers {
  margin-top: 27px;
  display: grid;
  grid-template-columns: 1.45fr repeat(3, 1fr);
  gap: 0;
}

.trip-budget-numbers > div {
  min-width: 0;
  padding: 4px 20px;
  border-left: 1px solid rgba(255, 255, 255, 0.15);
}

.trip-budget-numbers > div:first-child {
  padding-left: 0;
  border-left: 0;
}

.trip-budget-numbers small,
.trip-budget-numbers strong {
  display: block;
}

.trip-budget-numbers small {
  color: rgba(255, 255, 255, 0.58);
  font-size: 11px;
  font-weight: 700;
}

.trip-budget-numbers strong {
  margin-top: 6px;
  overflow-wrap: anywhere;
  color: #fff;
  font-size: clamp(19px, 3vw, 27px);
  letter-spacing: -0.025em;
}

.trip-budget-numbers .trip-budget-total strong {
  font-size: clamp(24px, 4vw, 38px);
}

.trip-budget-numbers strong.negative,
.trip-budget-legend .negative {
  color: #ffd0cb;
}

.trip-budget-gauge {
  height: 16px;
  margin-top: 25px;
  display: flex;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.15);
  border: 3px solid rgba(255, 255, 255, 0.09);
  border-radius: 99px;
}

.trip-budget-gauge span {
  height: 100%;
  display: block;
}

.trip-budget-gauge .gauge-paid {
  background: linear-gradient(90deg, #eb6255, #ff8c81);
}

.trip-budget-gauge .gauge-pending {
  background: rgba(255, 255, 255, 0.48);
}

.trip-budget-legend {
  margin-top: 11px;
  display: flex;
  align-items: center;
  gap: 12px 22px;
  color: rgba(255, 255, 255, 0.67);
  font-size: 11px;
}

.trip-budget-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.trip-budget-legend i {
  width: 9px;
  height: 9px;
  display: inline-block;
  border-radius: 50%;
}

.trip-budget-legend i.paid {
  background: #eb6255;
}

.trip-budget-legend i.pending {
  background: rgba(255, 255, 255, 0.58);
}

.trip-budget-legend .projected {
  margin-left: auto;
}

.trip-budget-legend strong {
  color: #fff;
}

#resumen.stats-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

/* Mapa */
.map-hero {
  min-height: 210px;
  padding: clamp(30px, 5vw, 50px);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  color: #fff;
  background:
    radial-gradient(circle at 88% -20%, rgba(235, 98, 85, 0.42), transparent 18rem),
    linear-gradient(125deg, #061857, #10296f);
  border-radius: 28px;
}

.map-hero .eyebrow {
  color: #ffaaa2;
}

.map-hero h1 {
  margin: 7px 0 8px;
  color: #fff;
  font-size: clamp(40px, 6vw, 62px);
  line-height: 1;
  letter-spacing: -0.05em;
}

.map-hero p {
  max-width: 620px;
  margin: 0;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.6;
}

.trip-map-switcher {
  flex: 0 0 min(320px, 38%);
  padding: 13px 15px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
}

.trip-map-switcher label {
  display: block;
  margin-bottom: 6px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.trip-map-switcher select {
  width: 100%;
  padding: 5px 28px 5px 0;
  color: #fff;
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 14px;
  font-weight: 750;
}

.trip-map-switcher option {
  color: #061857;
  background: #fff;
}

.map-empty-state {
  margin-top: 20px;
}

.map-workspace {
  margin-top: 28px;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(290px, 0.7fr);
  gap: 23px;
  align-items: start;
}

.map-column,
.places-column {
  min-width: 0;
}

.map-toolbar {
  min-height: 52px;
  margin-bottom: 14px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.map-toolbar h2,
.places-heading h2 {
  margin: 4px 0 0;
  font-size: clamp(24px, 4vw, 32px);
  letter-spacing: -0.035em;
}

.trip-map {
  height: 610px;
  position: relative;
  overflow: hidden;
  background: #e9edf4;
  border: 6px solid #fff;
  border-radius: 24px;
  box-shadow: 0 16px 45px rgba(6, 24, 87, 0.1);
}

.trip-map.is-picking {
  border-color: #eb6255;
  cursor: crosshair;
  box-shadow: 0 0 0 4px rgba(235, 98, 85, 0.18), 0 16px 45px rgba(6, 24, 87, 0.1);
}

.map-loading,
.map-unavailable {
  height: 100%;
  display: grid;
  place-items: center;
  color: #69738f;
  text-align: center;
}

.map-help {
  margin: 10px 5px 0;
  color: #69738f;
  font-size: 11px;
}

.leaflet-control-container,
.leaflet-pane {
  font-family: inherit;
}

.viajario-map-marker-wrap {
  background: transparent;
  border: 0;
}

.viajario-map-marker {
  --marker-color: #eb6255;
  width: 34px;
  height: 34px;
  position: relative;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--marker-color);
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 7px 17px rgba(6, 24, 87, 0.24);
  font-size: 15px;
  font-weight: 900;
}

.viajario-map-marker::after {
  width: 0;
  height: 0;
  position: absolute;
  bottom: -8px;
  left: 50%;
  content: "";
  border-top: 10px solid var(--marker-color);
  border-right: 6px solid transparent;
  border-left: 6px solid transparent;
  transform: translateX(-50%);
}

.viajario-map-marker.category-accommodation {
  --marker-color: #765092;
}

.viajario-map-marker.category-food {
  --marker-color: #d58a2d;
}

.viajario-map-marker.category-transport {
  --marker-color: #3c6ca8;
}

.viajario-map-marker.category-essential {
  --marker-color: #c43f3f;
}

.map-popup {
  min-width: 170px;
}

.map-popup small,
.map-popup strong,
.map-popup span,
.map-popup a {
  display: block;
}

.map-popup small {
  color: #eb6255;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.map-popup strong {
  margin-top: 3px;
  color: #061857;
  font-size: 14px;
}

.map-popup span {
  margin-top: 4px;
  color: #69738f;
  font-size: 11px;
}

.map-popup a {
  margin-top: 9px;
  color: #eb6255;
  font-size: 11px;
  font-weight: 750;
  text-decoration: none;
}

.places-heading {
  min-height: 66px;
  margin-bottom: 14px;
}

.place-card {
  margin-bottom: 10px;
  padding: 16px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  box-shadow: none;
}

.place-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: #eb6255;
  background: #fff0ee;
  border-radius: 12px;
  font-size: 17px;
  font-weight: 900;
}

.place-icon.category-accommodation {
  color: #765092;
  background: #f0e8f7;
}

.place-icon.category-food {
  color: #995b14;
  background: #fff0d7;
}

.place-icon.category-transport {
  color: #3c5d8f;
  background: #e7eef9;
}

.place-icon.category-essential {
  color: #a72f38;
  background: #f9e2e2;
}

.place-copy {
  min-width: 0;
}

.place-copy > span {
  color: #eb6255;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.place-copy h3 {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
  font-size: 16px;
}

.place-copy p,
.place-copy small {
  display: block;
  margin: 5px 0 0;
  overflow-wrap: anywhere;
  color: #69738f;
  font-size: 11px;
  line-height: 1.45;
}

.place-actions {
  margin-top: 9px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 10px;
}

.place-actions a {
  color: #061857;
  font-weight: 800;
  text-decoration: none;
}

.place-actions span {
  color: #9a7253;
}

.place-panel {
  width: min(590px, calc(100vw - 44px));
}

.place-form .field {
  margin-bottom: 0;
}

.coordinate-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.coordinate-fields.full,
.coordinate-actions.full {
  grid-column: 1 / -1;
}

.coordinate-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 11px;
}

.coordinate-actions > span {
  color: #69738f;
  font-size: 10px;
}

.map-list-empty {
  padding: 20px;
}

@media (max-width: 980px) {
  #resumen.stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .map-workspace {
    grid-template-columns: 1fr;
  }

  .trip-map {
    height: 520px;
  }

  .places-column {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .places-heading {
    grid-column: 1 / -1;
  }

  .place-card {
    margin-bottom: 0;
  }
}

@media (max-width: 760px) {
  .trip-budget-thermometer {
    margin-top: 13px;
    padding: 22px 19px;
    border-radius: 20px;
  }

  .trip-budget-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .budget-manage-button {
    width: 100%;
  }

  .budget-not-configured {
    align-items: flex-start;
    padding: 15px;
  }

  .budget-empty-gauge {
    width: 54px;
  }

  .trip-budget-numbers {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 0;
  }

  .trip-budget-numbers > div,
  .trip-budget-numbers > div:first-child {
    padding: 0 13px;
    border-left: 1px solid rgba(255, 255, 255, 0.15);
  }

  .trip-budget-numbers > div:nth-child(odd) {
    padding-left: 0;
    border-left: 0;
  }

  .trip-budget-numbers strong,
  .trip-budget-numbers .trip-budget-total strong {
    font-size: 21px;
  }

  .trip-budget-legend {
    align-items: flex-start;
    flex-direction: column;
  }

  .trip-budget-legend .projected {
    margin-left: 0;
  }

  #resumen.stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .map-hero {
    min-height: 0;
    padding: 27px 22px;
    align-items: stretch;
    flex-direction: column;
    border-radius: 22px;
  }

  .map-hero h1 {
    font-size: 41px;
  }

  .trip-map-switcher {
    flex-basis: auto;
  }

  .map-workspace {
    margin-top: 21px;
  }

  .map-toolbar {
    align-items: flex-end;
  }

  .map-toolbar h2 {
    max-width: 52vw;
    overflow: hidden;
    font-size: 24px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .map-toolbar .button {
    min-height: 41px;
    padding: 11px 13px;
    font-size: 12px;
  }

  .trip-map {
    height: 430px;
    border-width: 4px;
    border-radius: 19px;
  }

  .places-column {
    grid-template-columns: 1fr;
  }

  .coordinate-fields {
    grid-template-columns: 1fr;
  }

  .coordinate-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .coordinate-actions .button {
    width: 100%;
  }

  .place-panel {
    position: fixed;
    top: 76px;
    right: 14px;
    left: 14px;
    width: auto;
    max-height: calc(100vh - 160px);
    overflow-y: auto;
  }
}
