/* ==========================================================================
   Routify — Pasajero Portal Styles
   Map-Centric Interface, Floating Action Cards, Autocomplete, SOS Modal
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  --bg-dark: #070a13;
  --bg-card: rgba(13, 18, 34, 0.88);
  --bg-card-hover: rgba(22, 30, 56, 0.95);
  --gold: #f59e0b;
  --gold-glow: rgba(245, 158, 11, 0.4);
  --emerald: #10b981;
  --emerald-glow: rgba(16, 185, 129, 0.4);
  --rose: #f43f5e;
  --rose-glow: rgba(244, 63, 94, 0.4);
  --border: rgba(255, 255, 255, 0.1);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 9999px;
  --shadow-float: 0 20px 45px rgba(0, 0, 0, 0.7);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
}

.routify-guarded {
  opacity: 0;
  visibility: hidden;
  height: 100%;
  width: 100%;
  transition: opacity 0.3s ease;
}

.routify-guarded.routify-active {
  opacity: 1;
  visibility: visible;
}

/* Map Container Fullscreen */
#map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* Top Floating Header */
.top-nav {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.top-nav > * {
  pointer-events: auto;
}

.company-badge-box {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 8px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-float);
}

.company-badge-logo {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.company-badge-name {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
}

.user-auth-box {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-float);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--gold);
}

/* Floating Booking Panel */
.booking-panel {
  position: absolute;
  bottom: 24px;
  left: 20px;
  width: 440px;
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  background: var(--bg-card);
  backdrop-filter: blur(25px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  z-index: 10;
  box-shadow: var(--shadow-float);
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.panel-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.gps-radar-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
}

.radar-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 6px #34d399;
}

/* Location Fields */
.location-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}

.input-row {
  position: relative;
  display: flex;
  align-items: center;
}

.input-label-tag {
  position: absolute;
  left: 12px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  pointer-events: none;
}

.input-label-tag.origin {
  color: #34d399;
  background: rgba(16, 185, 129, 0.15);
}

.input-label-tag.dest {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.15);
}

.input-label-tag.note {
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.05);
}

.input-field {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 42px 12px 76px;
  font-family: inherit;
  font-size: 0.95rem;
  color: #fff;
  outline: none;
  transition: all 0.2s ease;
}

.input-field:focus {
  border-color: var(--gold);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 12px var(--gold-glow);
}

.input-field::placeholder {
  color: var(--text-muted);
}

.btn-locate-me {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--gold);
  cursor: pointer;
  padding: 4px;
  font-size: 1.1rem;
}

/* Autocomplete Dropdown (Nominatim Simplificado 10km) */
.nav-back-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-pill);
  transition: all 0.2s ease;
}
.nav-back-link:hover {
  color: #fff;
  background: rgba(245, 158, 11, 0.2);
}

.autocomplete-box {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: rgba(13, 18, 34, 0.98);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-md);
  max-height: 250px;
  overflow-y: auto;
  z-index: 200;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.9), 0 0 15px rgba(245, 158, 11, 0.15);
  display: none;
}

.autocomplete-box.active {
  display: block;
}

.autocomplete-box::-webkit-scrollbar {
  width: 6px;
}
.autocomplete-box::-webkit-scrollbar-thumb {
  background: rgba(245, 158, 11, 0.4);
  border-radius: 999px;
}

.autocomplete-item {
  padding: 11px 14px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.18s ease;
}

.autocomplete-item:last-child {
  border-bottom: none;
}

.autocomplete-item:hover {
  background: rgba(245, 158, 11, 0.16);
  transform: translateX(3px);
}

.autocomplete-icon-col {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--gold);
}

.autocomplete-text-col {
  flex-grow: 1;
  min-width: 0;
  overflow: hidden;
}

.addr-title {
  font-weight: 600;
  color: #fff;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.addr-subtitle {
  color: var(--text-muted);
  font-size: 0.76rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.autocomplete-dist {
  color: var(--gold);
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.25);
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 0.72rem;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

/* Vehicle Selector & Fare */
.fare-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fare-info h4 {
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  margin-bottom: 2px;
}

.fare-info p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.fare-amount {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--gold);
}

/* Action Buttons */
.btn-request {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--gold), #d97706);
  border: none;
  border-radius: var(--radius-pill);
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: #070a13;
  cursor: pointer;
  box-shadow: 0 8px 25px var(--gold-glow);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-request:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(245, 158, 11, 0.5);
}

.btn-request:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Floating SOS Button */
.btn-sos-floating {
  position: absolute;
  top: 80px;
  right: 20px;
  z-index: 10;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--rose);
  border: 2px solid #fff;
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  font-family: 'Outfit', sans-serif;
  cursor: pointer;
  box-shadow: 0 0 20px var(--rose-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
  animation: pulseSos 2s infinite;
}

.btn-sos-floating:hover {
  transform: scale(1.1);
}

@keyframes pulseSos {
  0% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.7); }
  70% { box-shadow: 0 0 0 16px rgba(244, 63, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0); }
}

/* Active Service Live Tracking Modal */
.active-trip-card {
  display: none;
  flex-direction: column;
  gap: 14px;
}

.active-trip-card.active {
  display: flex;
}

.trip-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid var(--gold);
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gold);
  width: fit-content;
}

.driver-detail-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-cancel {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid var(--rose);
  color: #fda4af;
  padding: 10px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}

/* Modal SOS Confirmation */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  background: #0f172a;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 440px;
  width: 100%;
  text-align: center;
}

.modal-box.danger {
  border-color: var(--rose);
  box-shadow: 0 0 35px var(--rose-glow);
}

.modal-box h3 {
  font-size: 1.5rem;
  margin-bottom: 8px;
  font-family: 'Outfit', sans-serif;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 20px;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  color: #fff;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  cursor: pointer;
}

.btn-danger {
  background: var(--rose);
  border: none;
  color: #fff;
  font-weight: 700;
  padding: 10px 24px;
  border-radius: var(--radius-pill);
  cursor: pointer;
}

@media (max-width: 600px) {
  .booking-panel {
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 20px;
  }
}

/* Route Planner Box (Punto A a B) */
.route-planner-box {
  display: flex;
  align-items: stretch;
  gap: 12px;
  position: relative;
}

.route-connector-line {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  width: 14px;
}

.dot-a {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.7);
}

.line-track {
  flex-grow: 1;
  width: 2px;
  background: repeating-linear-gradient(to bottom, #94a3b8 0, #94a3b8 4px, transparent 4px, transparent 8px);
  margin: 4px 0;
}

.dot-b {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.7);
}

.route-inputs-col {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Fleet Types Grid (Autocab365) */
.fleet-types-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.fleet-type-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fleet-type-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(245, 158, 11, 0.4);
}

.fleet-type-card.active {
  background: rgba(245, 158, 11, 0.12);
  border-color: #f59e0b;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.2);
}

.fleet-icon {
  font-size: 1.4rem;
  margin-bottom: 4px;
}

.fleet-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
}

.fleet-sub {
  font-size: 0.68rem;
  color: #94a3b8;
}

/* Distance Matrix Pill */
.fare-matrix-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 10px;
  margin-bottom: 8px;
}

.matrix-pill {
  display: flex;
  flex-direction: column;
}

.matrix-label {
  font-size: 0.65rem;
  color: #94a3b8;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.fare-breakdown-sub {
  font-size: 0.78rem;
  color: #94a3b8;
  line-height: 1.4;
}

/* Active Trip & Driver Profile (Autocab365) */
.active-trip-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.trip-status-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.radar-ping-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f59e0b;
  position: relative;
  animation: radarPulse 1.6s infinite;
}

@keyframes radarPulse {
  0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
  70% { box-shadow: 0 0 0 16px rgba(245, 158, 11, 0); }
  100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

.driver-arrived-alert {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: bounceIn 0.4s ease;
}

@keyframes bounceIn {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.driver-profile-widget {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.driver-avatar-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #1e293b;
  border: 2px solid #f59e0b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
}

.driver-info-meta {
  flex-grow: 1;
}

.driver-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  color: #fff;
}

.driver-plate-pill {
  background: #f59e0b;
  color: #070a13;
  font-weight: 800;
  font-size: 0.72rem;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.driver-movil-row {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-top: 2px;
}

.driver-contact-actions {
  display: flex;
  gap: 8px;
}

.btn-contact-driver {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-phone {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.btn-phone:hover {
  background: rgba(255, 255, 255, 0.2);
}

.btn-wpp {
  background: #25d366;
  color: #fff;
}
.btn-wpp:hover {
  filter: brightness(1.1);
}

/* ==========================================================================
   Mobile-First Phone Optimization (iPhone / Android)
   ========================================================================== */
@media (max-width: 640px) {
  .top-nav {
    top: calc(8px + env(safe-area-inset-top, 0px));
    left: 8px;
    right: 8px;
  }

  .company-badge-box {
    padding: 6px 12px;
    gap: 8px;
  }

  .company-badge-name {
    font-size: 0.8rem;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .nav-back-link {
    font-size: 0.72rem;
    padding: 2px 6px;
  }

  .user-auth-box {
    padding: 4px 10px;
  }

  .btn-sos-floating {
    top: auto;
    bottom: calc(24px + 360px);
    right: 14px;
    width: 44px;
    height: 44px;
    font-size: 0.75rem;
    z-index: 15;
  }

  .booking-panel {
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 100vw;
    border-radius: 24px 24px 0 0;
    padding: 16px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    border-left: none;
    border-right: none;
    border-bottom: none;
    max-height: 82vh;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.8);
  }

  .panel-title {
    font-size: 1.1rem;
  }

  .fleet-types-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }

  .fleet-type-card {
    padding: 8px 6px;
  }

  .fleet-icon svg {
    width: 18px;
    height: 18px;
  }

  .fleet-name {
    font-size: 0.8rem;
  }

  .fleet-sub {
    font-size: 0.65rem;
  }

  .fare-matrix-row {
    flex-direction: row;
    justify-content: space-between;
    gap: 4px;
  }

  .matrix-pill {
    padding: 6px 8px;
  }

  .matrix-label {
    font-size: 0.6rem;
  }

  .matrix-pill strong {
    font-size: 0.85rem;
  }

    .btn-request {
    padding: 14px;
    font-size: 0.95rem;
  }
}

/* ==========================================================================
   Passenger Digital Taximeter HUD
   ========================================================================== */
.passenger-taximeter-box {
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.95), rgba(7, 10, 19, 0.98));
  border: 1.5px solid rgba(245, 158, 11, 0.45);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.6), 0 0 15px rgba(245, 158, 11, 0.15);
  animation: pulseCard 2.5s infinite alternate;
}

@keyframes pulseCard {
  0% { border-color: rgba(245, 158, 11, 0.35); box-shadow: 0 0 10px rgba(245, 158, 11, 0.1); }
  100% { border-color: rgba(245, 158, 11, 0.7); box-shadow: 0 0 20px rgba(245, 158, 11, 0.25); }
}

.pass-taxi-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.taxi-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: livePing 1s infinite;
}

@keyframes livePing {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

.pass-taxi-fare-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.pass-taxi-stats {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 8px;
}

/* ==========================================================================
   Passenger Chat Drawer
   ========================================================================== */
.chat-drawer {
  position: absolute;
  bottom: 24px;
  right: 24px;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 440px;
  max-height: calc(100vh - 120px);
  background: rgba(13, 18, 34, 0.96);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow: hidden;
  animation: slideUpChat 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpChat {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-drawer-header {
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
}

.btn-close-chat {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.btn-close-chat:hover {
  color: #fff;
}

.chat-messages-body {
  flex: 1;
  padding: 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-msg-bubble {
  max-width: 80%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 0.84rem;
  line-height: 1.4;
  word-break: break-word;
}

.chat-msg-bubble.mine {
  align-self: flex-end;
  background: #f59e0b;
  color: #070a13;
  font-weight: 600;
  border-bottom-right-radius: 2px;
}

.chat-msg-bubble.other {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  border-bottom-left-radius: 2px;
}

.chat-input-row {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  gap: 8px;
}

.chat-input-row input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 8px 14px;
  color: #fff;
  font-size: 0.85rem;
  outline: none;
}

.chat-input-row input:focus {
  border-color: var(--gold);
}

.btn-send-msg {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gold);
  color: #070a13;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.btn-send-msg:active {
  transform: scale(0.92);
}

.btn-contact-driver.btn-chat {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.btn-contact-driver.btn-chat:hover {
  background: rgba(56, 189, 248, 0.3);
}

@media (max-width: 640px) {
  .chat-drawer {
    right: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    max-width: 100vw;
    height: 60vh;
    border-radius: 20px 20px 0 0;
  }
}

/* ==========================================================================
   Ajuste de Tarifa InDrive para Pasajeros
   ========================================================================== */
.passenger-fare-adjust-box {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fare-adjust-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fare-adjust-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--gold);
  display: block;
}

.fare-adjust-sub {
  font-size: 0.7rem;
  color: #94a3b8;
  display: block;
  margin-top: 2px;
}

.fare-adjust-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.btn-fare-stepper {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-fare-stepper:active {
  transform: scale(0.92);
  background: var(--gold);
  color: #070a13;
}

.fare-display-input-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(7, 10, 19, 0.9);
  border: 1.5px solid var(--gold);
  border-radius: 12px;
  padding: 4px 12px;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.2);
}

.currency-symbol {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--gold);
}

.input-offered-fare {
  width: 110px;
  background: transparent;
  border: none;
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 900;
  color: #fff;
  text-align: center;
  outline: none;
  -moz-appearance: textfield;
}

.input-offered-fare::-webkit-outer-spin-button,
.input-offered-fare::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.currency-code {
  font-size: 0.72rem;
  font-weight: 700;
  color: #94a3b8;
}

.fare-quick-chips {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.fare-chip-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  color: #cbd5e1;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fare-chip-btn:hover, .fare-chip-btn:active {
  background: rgba(245, 158, 11, 0.2);
  border-color: var(--gold);
  color: var(--gold);
}

/* ==========================================================================
   Tarifa Acordada Fija en Viaje Activo
   ========================================================================== */
.passenger-agreed-fare-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1.5px solid rgba(16, 185, 129, 0.4);
  border-radius: 14px;
  padding: 12px 16px;
  margin-top: 10px;
  text-align: center;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
}

.pass-agreed-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.pass-agreed-val {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
}

/* ==========================================================================
   Bottom Sheet Retraible Móvil para Teléfonos (Inspirado en inDrive / Uber)
   ========================================================================== */
.sheet-drag-handle {
  width: 100%;
  padding: 8px 0 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  touch-action: none;
}

.sheet-pill {
  width: 38px;
  height: 4.5px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.25);
  transition: all 0.2s ease;
}

.sheet-drag-handle:active .sheet-pill {
  background: var(--gold);
  width: 48px;
}

.sheet-peek-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px 12px;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 8px;
}

.sheet-peek-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.sheet-peek-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sheet-peek-text strong {
  font-size: 0.88rem;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sheet-peek-text span {
  font-size: 0.72rem;
  color: #94a3b8;
}

.sheet-peek-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.sheet-peek-fare {
  font-family: 'Outfit', sans-serif;
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--gold);
  background: rgba(245, 158, 11, 0.12);
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.btn-sheet-chevron {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.25s ease;
}

/* Estado Retraído en Móvil */
@media (max-width: 768px) {
  .booking-panel.sheet-mobile-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100vw;
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.7);
    transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), max-height 0.32s ease;
    z-index: 50;
    padding: 6px 14px 20px;
    padding-bottom: max(20px, env(safe-area-inset-bottom));
    background: rgba(7, 10, 19, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    max-height: 80vh;
    overflow-y: auto;
  }

  .booking-panel.sheet-mobile-panel.sheet-collapsed {
    max-height: 125px;
    overflow: hidden;
  }

  .booking-panel.sheet-mobile-panel.sheet-collapsed #sheetPeekBar {
    display: flex;
  }

  .booking-panel.sheet-mobile-panel.sheet-collapsed #panelFullHeader,
  .booking-panel.sheet-mobile-panel.sheet-collapsed #fleetCategoryGrid,
  .booking-panel.sheet-mobile-panel.sheet-collapsed #fareCardDetails,
  .booking-panel.sheet-mobile-panel.sheet-collapsed #fareAdjustContainer,
  .booking-panel.sheet-mobile-panel.sheet-collapsed #btnRequestService {
    display: none !important;
  }

  .booking-panel.sheet-mobile-panel.sheet-collapsed .route-planner-box {
    margin-bottom: 0;
  }

  .booking-panel.sheet-mobile-panel.sheet-collapsed .input-row:not(:has(#destinationInput)) {
    display: none;
  }

  .booking-panel.sheet-mobile-panel.sheet-collapsed #sheetChevronIcon {
    transform: rotate(180deg);
  }
}


