/* ============================================================
   Más Metros Estimador — estilos del formulario
   Basados en la tarjeta original "¿A dónde te mudas?".
   Todo va con el prefijo .mme- para no chocar con el tema.
============================================================ */

.mme-estimador {
  --mme-bg: #1F3860;
  --mme-text: #FFFFFF;
  --mme-muted: #A2B2CB;
  --mme-orange: #FF6200;
  --mme-card-bg: rgba(255, 255, 255, 0.08);
  --mme-card-border: rgba(255, 255, 255, 0.15);
  --mme-input-bg: rgba(255, 255, 255, 0.12);
  --mme-radius: 16px;
  --mme-ease: cubic-bezier(0.25, 1, 0.5, 1);

  font-family: 'Hanken Grotesk', system-ui, -apple-system, sans-serif;
  background-color: var(--mme-bg);
  color: var(--mme-text);
  padding: 40px 0;
}

.mme-estimador *,
.mme-estimador *::before,
.mme-estimador *::after {
  box-sizing: border-box;
}

.mme-estimador .mme-wrap {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 40px;
}

/* ---------- Tarjeta ---------- */
.mme-estimador .mme-card {
  background-color: var(--mme-card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--mme-card-border);
  border-radius: var(--mme-radius);
  padding: 40px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
}

.mme-estimador .mme-header {
  margin-bottom: 35px;
}

.mme-estimador .mme-title {
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 8px;
  color: #fff;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.mme-estimador .mme-subtitle {
  font-size: 14px;
  color: var(--mme-muted);
  margin: 0;
  font-weight: 500;
}

/* ---------- Fila origen / conector / destino ---------- */
.mme-estimador .mme-route {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 35px;
}

.mme-estimador .mme-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.mme-estimador .mme-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--mme-text);
}

.mme-estimador .mme-dot {
  width: 6px;
  height: 6px;
  background-color: #fff;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Ciudad heredada que se muestra en Destino */
.mme-estimador .mme-city-hint {
  font-size: 12px;
  font-weight: 600;
  color: var(--mme-orange);
  letter-spacing: 0.02em;
}

/* ---------- Campo con autocompletado ---------- */
.mme-estimador .mme-field {
  position: relative;
}

.mme-estimador .mme-input {
  width: 100%;
  background: var(--mme-input-bg);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  padding: 18px 24px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  text-align: center;
  transition: border-color 0.2s var(--mme-ease), background 0.2s var(--mme-ease);
  -webkit-appearance: none;
  appearance: none;
}

.mme-estimador .mme-input::placeholder {
  color: rgba(255, 255, 255, 0.55);
  font-weight: 500;
}

.mme-estimador .mme-input:hover:not(:disabled) {
  border-color: rgba(255, 255, 255, 0.4);
}

.mme-estimador .mme-input:focus {
  outline: none;
  border-color: var(--mme-orange);
  background: rgba(255, 255, 255, 0.16);
}

/* Visible para quien navega con teclado */
.mme-estimador .mme-input:focus-visible {
  outline: 2px solid var(--mme-orange);
  outline-offset: 2px;
}

.mme-estimador .mme-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------- Lista de opciones ---------- */
.mme-estimador .mme-options {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #24406B;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.38);
  max-height: 260px;
  overflow-y: auto;
}

.mme-estimador .mme-options[hidden] {
  display: none;
}

.mme-estimador .mme-option {
  padding: 11px 14px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease;
}

.mme-estimador .mme-option:hover,
.mme-estimador .mme-option.is-active {
  background: rgba(255, 98, 0, 0.9);
}

.mme-estimador .mme-option.is-empty {
  color: var(--mme-muted);
  cursor: default;
  font-weight: 500;
}

.mme-estimador .mme-option.is-empty:hover {
  background: transparent;
}

/* ---------- Conector y píldora del resultado ---------- */
.mme-estimador .mme-connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  width: 160px;
  flex-shrink: 0;
  margin-top: 52px;
}

.mme-estimador .mme-pill {
  border: 1px solid var(--mme-orange);
  color: var(--mme-orange);
  background-color: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 12px;
  border-radius: 20px;
  position: absolute;
  top: -26px;
  white-space: nowrap;
  text-align: center;
  transition: opacity 0.25s var(--mme-ease), transform 0.25s var(--mme-ease);
}

/* Estado neutro, antes de que el usuario complete la ruta */
.mme-estimador .mme-pill.is-idle {
  border-color: rgba(255, 255, 255, 0.3);
  color: var(--mme-muted);
}

/* Pequeño rebote cuando aparece un resultado nuevo */
.mme-estimador .mme-pill.is-updating {
  opacity: 0;
  transform: translateY(4px);
}

.mme-estimador .mme-line {
  display: flex;
  align-items: center;
  width: 100%;
}

.mme-estimador .mme-dash {
  flex-grow: 1;
  height: 4px;
  background-image: linear-gradient(to right, rgba(255, 255, 255, 0.5) 50%, transparent 50%);
  background-size: 18px 100%;
}

.mme-estimador .mme-node {
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 12px;
  flex-shrink: 0;
}

.mme-estimador .mme-node::after {
  content: "";
  width: 6px;
  height: 6px;
  background-color: #fff;
  border-radius: 50%;
}

/* ---------- Botón ---------- */
.mme-estimador .mme-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  padding: 0 32px;
  background-color: var(--mme-orange);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  border-radius: 8px;
  text-decoration: none;
  transition: transform 0.3s var(--mme-ease), background-color 0.3s ease;
}

.mme-estimador .mme-btn:hover,
.mme-estimador .mme-btn:focus {
  transform: translateY(-2px);
  background-color: #E55800;
  color: #fff;
  text-decoration: none;
}

.mme-estimador .mme-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

/* ---------- Responsivo ---------- */
@media (max-width: 900px) {
  .mme-estimador .mme-wrap {
    padding: 0 24px;
  }

  .mme-estimador .mme-card {
    padding: 28px 20px;
  }

  .mme-estimador .mme-route {
    flex-direction: column;
    gap: 20px;
  }

  .mme-estimador .mme-connector {
    width: 100%;
    margin-top: 0;
    padding: 26px 0 4px;
  }

  .mme-estimador .mme-pill {
    top: 0;
  }

  .mme-estimador .mme-btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mme-estimador .mme-pill,
  .mme-estimador .mme-btn,
  .mme-estimador .mme-input {
    transition: none;
  }
}

/* ---------- Estimador nacional (v1.1.0) ----------
   Los textos de tiempo son más largos ("12 a 14 horas · 1 día hábil"),
   así que el conector se ensancha un poco en escritorio. */
@media (min-width: 901px) {
  .mme-estimador.mme-is-national .mme-connector {
    width: 240px;
  }
}

@media (max-width: 900px) {
  .mme-estimador.mme-is-national .mme-pill {
    white-space: normal;
    max-width: 100%;
  }
}
