/* =========================================
   🏠 BIENVENIDA Y HOME (ESTILO UNIFICADO)
   ========================================= */



.user_home {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
  margin-bottom: 5px;
}

/* 🗺️ MAPA (EFECTO ELEVADO) */
#map {
  height: clamp(280px, 38vh, 430px);
  min-height: 280px;
  display: block;
  border-radius: 22px;
  margin: calc(var(--header-height, 76px) + env(safe-area-inset-top) + 18px) 16px 20px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background-color: var(--bg-card);
  
  /* Sombra de elevación para el mapa */
  box-shadow: 
    10px 10px 20px rgba(0, 0, 0, 0.5), 
    -5px -5px 15px rgba(255, 255, 255, 0.02);
  
  overflow: hidden;
  z-index: 1;
  touch-action: pan-x pan-y;
}

#map .leaflet-control-container {
  z-index: 20;
}

#map .leaflet-top,
#map .leaflet-bottom {
  z-index: 25;
}

#map.hidden {
  display: none !important;
}

/* 🔍 INPUT PRINCIPAL (ESTILO HUECO/INSET) */
.inicio {
  width: 100%;
  background: var(--bg-card);
  border: none;
  color: var(--text-main);
  padding: 18px 20px;
  border-radius: 20px;
  font-size: 16px;
  font-weight: 500;
  outline: none;
  
  /* Efecto hundido para indicar que es un campo de escritura */
  box-shadow: 
    inset 6px 6px 12px rgba(0, 0, 0, 0.8), 
    inset -4px -4px 10px rgba(255, 255, 255, 0.02);
  
  margin-bottom: 25px;
  transition: all 0.3s ease;
}

/* =============================================
   🎯 TARJETA DE BÚSQUEDA (NEUMÓRFICA)
   ============================================= */
.busqueda {
  background: var(--bg-card);
  margin: 0 16px;
  padding: 24px;
  border-radius: 32px;
  border: 1px solid rgba(255, 255, 255, 0.02);
  position: relative;
  display: grid;
  gap: 14px;
  
  /* Sombra de bloque sólido */
  box-shadow: 
    15px 15px 30px rgba(0, 0, 0, 0.6), 
    -5px -5px 15px rgba(255, 255, 255, 0.02);
}

@media (max-width: 380px) {
  #map {
    height: 280px;
    margin-left: 12px;
    margin-right: 12px;
  }

  .busqueda {
    margin-left: 12px;
    margin-right: 12px;
    padding: 18px;
    border-radius: 22px;
  }
}

.desde, .hacia {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  z-index: 2;
}

.desde {
  width: 100%;
  background: rgba(0, 0, 0, 0.2); /* Más oscuro para resaltar el hueco */
  border: none;
  color: var(--text-main);
  padding: 16px 18px;
  border-radius: 16px;
  font-size: 15px;
  outline: none;
  transition: all 0.3s ease;
  
  /* Efecto hueco profundo */
  box-shadow: 
  inset 4px 4px 8px rgba(0, 0, 0, 0.9), 
  inset -2px -2px 6px rgba(255, 255, 255, 0.01);
}

/* Decoración de ruta (Línea conectora) */
.desde::before {
  content: "";
  position: absolute;
  left: -18px;
  top: 38px;
  width: 10px;
  height: 10px;
  background: var(--secondary);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--secondary);
}

.desde::after {
  content: "";
  position: absolute;
  left: -14px;
  top: 52px;
  width: 2px;
  height: 45px;
  background: repeating-linear-gradient(to bottom, var(--muted) 0, var(--muted) 4px, transparent 4px, transparent 8px);
  opacity: 0.3;
}

.hacia::before {
  content: "";
  position: absolute;
  left: -18px;
  top: 42px;
  width: 10px;
  height: 10px;
  background: var(--success);
  border-radius: 3px;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}



/* 🔘 BOTÓN UBICACIÓN ACTUAL (ESTILO BOTÓN FÍSICO) */
#btnUbicacion {
  all: unset;
  cursor: pointer;
  background: var(--bg-card);
  color: var(--secondary);
  padding: 14px 30px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  
  /* Efecto salido */
  box-shadow: 
    5px 5px 10px rgba(0, 0, 0, 0.5), 
    -3px -3px 8px rgba(255, 255, 255, 0.03);
}

#btnUbicacion:active {
  color: #fff;
  /* Efecto hundido al pulsar */
  box-shadow: 
    inset 4px 4px 8px rgba(0, 0, 0, 0.8), 
    inset -3px -3px 8px rgba(255, 255, 255, 0.02);
  transform: scale(0.96);
}

/* ⌨️ INPUT DESTINO (ESTILO HUECO) */
#inputDestino {
  width: 100%;
  background: rgba(0, 0, 0, 0.2); /* Más oscuro para resaltar el hueco */
  border: none;
  color: var(--text-main);
  padding: 16px 18px;
  border-radius: 16px;
  font-size: 15px;
  outline: none;
  transition: all 0.3s ease;
  
  /* Efecto hueco profundo */
  box-shadow: 
    inset 4px 4px 8px rgba(0, 0, 0, 0.9), 
    inset -2px -2px 6px rgba(255, 255, 255, 0.01);
}

#inputDestino:focus {
  box-shadow: 
    inset 4px 4px 10px rgba(0, 0, 0, 1), 
    inset -2px -2px 8px rgba(56, 189, 248, 0.1); /* Brillo sutil azul al enfocar */
}

/* Placeholder */
::placeholder {
  color: var(--muted);
  opacity: 0.5;
}

/* =============================================
   🎯 VISIBILIDAD POR RUTA
   ============================================= */
.center-btn {
  display: none;
}

.route-home .center-btn {
  display: flex;
}

.destinos-fab,
.destinos-panel {
  display: none;
}

.route-home .destinos-fab {
  position: fixed;
  right: 20px;
  top: calc(var(--header-height, 76px) + env(safe-area-inset-top) + 38px);
  z-index: 80;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.3), transparent 16%),
    linear-gradient(135deg, var(--primary, #2563eb), var(--bg-main));
  box-shadow:
    0 16px 30px rgba(0, 0, 0, 0.5),
    0 0 0 7px rgba(37, 99, 235, 0.1),
    inset 0 1px 1px rgba(255, 255, 255, 0.18);
}

.route-home .destinos-fab:active {
  transform: scale(0.94);
}

.route-home .destinos-panel {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: grid;
  align-items: end;
  padding: 16px 14px calc(var(--footer-height, 76px) + env(safe-area-inset-bottom) + 16px);
  background: rgba(2, 6, 23, 0.38);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.route-home .destinos-panel.hidden {
  display: none !important;
}

.destinos-card {
  width: min(100%, 560px);
  margin: 0 auto;
  padding: 14px;
  border-radius: 24px;
  color: var(--text-main);
  background:
    radial-gradient(circle at 14% 0%, rgba(37, 99, 235, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(31, 31, 35, 0.98), rgba(12, 13, 17, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.055);
  box-shadow:
    0 24px 48px rgba(0, 0, 0, 0.62),
    inset 0 1px 1px rgba(255, 255, 255, 0.08),
    inset 0 -12px 20px rgba(0, 0, 0, 0.42);
}

.destinos-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.destinos-head span,
.destinos-msg,
.destino-item small {
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 750;
}

.destinos-head span {
  display: block;
  text-transform: uppercase;
}

.destinos-head strong {
  display: block;
  margin-top: 2px;
  color: #f8fafc;
  font-size: 1.15rem;
  font-weight: 900;
}

.destinos-icon-btn,
.destino-delete {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #d5d7dc;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.13), transparent 18%),
    linear-gradient(180deg, rgba(25, 27, 33, 0.98), rgba(10, 11, 15, 0.98));
  box-shadow:
    0 10px 22px rgba(0, 0, 0, 0.34),
    inset 0 1px 1px rgba(255, 255, 255, 0.08),
    inset 0 -7px 12px rgba(0, 0, 0, 0.34);
}

.destinos-list {
  display: grid;
  gap: 10px;
}

.destinos-empty {
  min-height: 76px;
  padding: 14px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  background: rgba(2, 6, 23, 0.72);
  border: 1px dashed rgba(148, 163, 184, 0.2);
}

.destinos-empty i {
  color: var(--orange);
}

.destino-item {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.destino-select {
  min-width: 0;
  flex: 1 1 auto;
  min-height: 68px;
  padding: 12px;
  border: 0;
  border-radius: 18px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-items: center;
  text-align: left;
  color: var(--text-main);
  background: var(--bg-card);
  box-shadow:
    6px 6px 12px rgba(0, 0, 0, 0.58),
    -3px -3px 10px rgba(255, 255, 255, 0.02);
}

.destino-select i {
  grid-row: 1 / span 2;
  color: var(--secondary);
  font-size: 18px;
}

.destino-select span,
.destino-item small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.destino-select span {
  color: #f8fafc;
  font-size: 0.9rem;
  font-weight: 850;
}

.destino-delete {
  align-self: center;
  color: #fca5a5;
}

.destinos-save {
  width: 100%;
  min-height: 52px;
  margin-top: 12px;
  border: 0;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #fff;
  font-weight: 850;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.24), transparent 16%),
    linear-gradient(135deg, var(--primary, #2563eb), var(--bg-main));
  box-shadow:
    0 14px 26px rgba(37, 99, 235, 0.24),
    inset 0 1px 1px rgba(255, 255, 255, 0.18);
}

.destinos-msg {
  min-height: 18px;
  margin: 9px 4px 0;
  text-align: center;
}

.destinos-msg.ok {
  color: #86efac;
}

.destinos-msg.error {
  color: #fca5a5;
}

.envio-panel {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.envio-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 6px;
  border-radius: 18px;
  background: rgba(2, 6, 23, 0.54);
  box-shadow:
    inset 4px 4px 10px rgba(0, 0, 0, 0.72),
    inset -2px -2px 8px rgba(255, 255, 255, 0.02);
}

.envio-tab {
  min-height: 48px;
  border: 0;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  background: transparent;
  font-weight: 850;
  letter-spacing: 0;
}

.envio-tab.active {
  color: #fff;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.22), transparent 18%),
    linear-gradient(180deg, #1f2937 0%, #0f172a 100%);
  box-shadow:
    7px 7px 14px rgba(0, 0, 0, 0.48),
    -2px -2px 8px rgba(255, 255, 255, 0.03),
    inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

.envio-tab.active[data-servicio="envio"] {
  color: #e0f2fe;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.24), transparent 18%),
    linear-gradient(180deg, #0ea5e9 0%, #0369a1 100%);
}

.envio-form {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.94), rgba(2, 6, 23, 0.94));
  border: 1px solid rgba(56, 189, 248, 0.13);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.04),
    8px 10px 18px rgba(0, 0, 0, 0.34);
}

.envio-form.hidden {
  display: none !important;
}

.envio-weight-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.envio-weight-row label,
.envio-msg {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.envio-weight-control {
  width: 118px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #e0f2fe;
  background: rgba(0, 0, 0, 0.26);
  box-shadow:
    inset 4px 4px 8px rgba(0, 0, 0, 0.72),
    inset -2px -2px 6px rgba(255, 255, 255, 0.02);
}

.envio-weight-control input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  color: #fff;
  background: transparent;
  font: inherit;
  font-weight: 900;
}

.envio-input {
  width: 100%;
  border: 0;
  outline: 0;
  border-radius: 14px;
  padding: 13px 14px;
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.24);
  box-shadow:
    inset 4px 4px 8px rgba(0, 0, 0, 0.72),
    inset -2px -2px 6px rgba(255, 255, 255, 0.02);
}

.envio-textarea {
  resize: none;
  line-height: 1.35;
}

.envio-msg {
  min-height: 18px;
  margin: 0 2px;
  color: #7dd3fc;
}

.envio-msg.error {
  color: #fca5a5;
}

.delivery-code-card {
  margin-top: 14px;
  padding: 14px;
  border-radius: 20px;
  color: #e0f2fe;
  background:
    radial-gradient(circle at 16% 0%, rgba(14, 165, 233, 0.22), transparent 36%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(2, 6, 23, 0.98));
  border: 1px solid rgba(56, 189, 248, 0.18);
  box-shadow:
    0 16px 30px rgba(0, 0, 0, 0.38),
    inset 0 1px 1px rgba(255, 255, 255, 0.06);
}

.delivery-code-card small {
  display: block;
  color: #7dd3fc;
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.delivery-code-card strong {
  display: block;
  margin: 6px 0;
  color: #fff;
  font-size: 2rem;
  letter-spacing: 0.12em;
  font-weight: 950;
}

.delivery-code-card span {
  color: #94a3b8;
  font-size: 0.8rem;
  line-height: 1.35;
}
