/* ══════════════════════════════════════════════
   TAXI BOOKING PAGE — animations + panel scrollbar + responsive layout
══════════════════════════════════════════════ */
@keyframes taxiSpin    { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes taxiPulse   { 0%,100% { opacity:1; transform:scale(1); } 50% { opacity:0.5; transform:scale(1.4); } }
@keyframes taxiMapPulse{ 0%{transform:scale(0.5);opacity:0.8;} 70%{transform:scale(2.0);opacity:0;} 100%{transform:scale(2.0);opacity:0;} }
@keyframes taxiShimmer { 0%{background-position:200% 0;} 100%{background-position:-200% 0;} }

#taxi-page {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(255, 179, 0, 0.08), transparent 28%),
    linear-gradient(180deg, #f9fafb 0%, #f5f7fb 100%);
  font-family: 'Mulish', sans-serif;
  --taxi-panel-width: 380px;
  --taxi-panel-gap: 24px;
}

#taxi-map-shell {
  position: absolute;
  inset: 0;
  right: 0;
}

#taxi-map-shell .leaflet-container {
  width: 100%;
  height: 100%;
}

.taxi-floating-stack {
  position: absolute;
  top: 104px;
  left: 24px;
  z-index: 900;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.taxi-chip {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 16px;
  padding: 10px 14px;
  backdrop-filter: blur(10px);
}

.taxi-brand-chip {
  background: rgba(255, 179, 0, 0.96);
  color: #fff;
  box-shadow: 0 8px 24px rgba(255, 179, 0, 0.28);
}

.taxi-brand-chip i {
  font-size: 18px;
}

.taxi-gps-chip {
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
  font-size: 11px;
  font-weight: 800;
  color: #16a34a;
}

.taxi-chip-title {
  font-size: 14px;
  line-height: 1.1;
  font-weight: 900;
}

.taxi-chip-subtitle {
  font-size: 10px;
  font-weight: 700;
  opacity: 0.82;
}

#taxi-fare-preview {
  position: absolute;
  bottom: 24px;
  left: 24px;
  z-index: 900;
  pointer-events: none;
}

.taxi-fare-card {
  pointer-events: auto;
  min-width: 128px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-radius: 16px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 179, 0, 0.28);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  text-align: right;
}

.taxi-fare-card-label {
  font-size: 9px;
  font-weight: 800;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.taxi-fare-card-price {
  font-size: 22px;
  font-weight: 900;
  color: #FFB300;
  line-height: 1;
}

.taxi-fare-card-meta {
  margin-top: 2px;
  font-size: 10px;
  font-weight: 700;
  color: #6b7280;
}

.taxi-fare-card-payment {
  margin-top: 4px;
  font-size: 10px;
  font-weight: 800;
  color: #1f2937;
}

/* Pulsing pickup dot on map (matches shop map style) */
.taxi-pickup-dot  { width:12px;height:12px;border-radius:50%;background:#22c55e;border:2px solid #fff;box-shadow:0 0 6px rgba(34,197,94,0.8);z-index:5; }
.taxi-pickup-ring { width:28px;height:28px;border-radius:50%;background:rgba(34,197,94,0.3);position:absolute;z-index:1;animation:taxiMapPulse 1.8s infinite ease-out; }

/* ── Leaflet controls: offset from fixed navbar (104px = navbar height) ── */
#taxi-leaflet-map-element .leaflet-top { top: 104px !important; }
#taxi-leaflet-map-element .leaflet-left { left: 24px !important; }
#taxi-leaflet-map-element .leaflet-right { right: 18px !important; }
#taxi-leaflet-map-element .leaflet-bottom { bottom: 18px !important; }
#taxi-leaflet-map-element .leaflet-control-attribution {
  position: absolute;
  top: 10px;
  right: 10px;
  bottom: auto;
  left: auto;
  margin: 0 !important;
  padding: 3px 8px !important;
  border-radius: 999px !important;
  background: rgba(255,255,255,0.72) !important;
  border: 1px solid rgba(17,24,39,0.08) !important;
  box-shadow: 0 4px 14px rgba(15,23,42,0.08) !important;
  color: rgba(55,65,81,0.72) !important;
  font-size: 9px !important;
  line-height: 1.1 !important;
  backdrop-filter: blur(8px);
  z-index: 500 !important;
}
#taxi-leaflet-map-element .leaflet-control-attribution a {
  color: inherit !important;
}

/* ── Panel scrollbar ── */
#taxi-booking-panel::-webkit-scrollbar { width: 4px; }
#taxi-booking-panel::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 2px; }

#taxi-booking-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 600;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -10px 42px rgba(15, 23, 42, 0.14);
  max-height: 52vh;
  overflow-y: auto;
  transition: transform 0.35s cubic-bezier(0.16,1,0.3,1);
}

#taxi-booking-panel .taxi-panel-handle {
  display: flex;
  justify-content: center;
  padding: 10px 0 4px;
}

#taxi-booking-panel .taxi-panel-handle span {
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: #e5e7eb;
}

.taxi-panel-section {
  padding: 4px 16px 18px;
}

.taxi-panel-section + .taxi-panel-section {
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.taxi-section-title {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 900;
  color: #1f2937;
}

.taxi-subhead {
  font-size: 11px;
  font-weight: 800;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.taxi-surface-card {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
}

.taxi-location-card {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border-radius: 14px;
  border: 1px solid #e5e7eb;
  background: #fff;
}

.taxi-location-card--pickup {
  margin-bottom: 8px;
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.taxi-location-card--destination {
  position: relative;
  padding: 11px 14px;
}

.taxi-location-card-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.taxi-location-card-icon i {
  font-size: 12px;
}

.taxi-location-card-icon--pickup {
  background: #22c55e;
}

.taxi-location-card-icon--pickup i {
  color: #fff;
}

.taxi-location-card-icon--destination {
  background: #fee2e2;
}

.taxi-location-card-icon--destination i {
  color: #ef4444;
}

.taxi-location-card-content {
  flex: 1;
  min-width: 0;
}

.taxi-location-card-label {
  margin-bottom: 1px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  line-height: 1;
}

.taxi-location-card--pickup .taxi-location-card-label {
  color: #16a34a;
}

.taxi-location-card--destination .taxi-location-card-label {
  color: #9ca3af;
}

.taxi-location-card-value,
.taxi-location-card-field {
  display: block;
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  padding: 0;
  font-size: 13px;
  font-weight: 700;
  color: #1f2937;
  line-height: 1.2;
}

.taxi-location-card-value {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.taxi-location-card-field {
  appearance: none;
}

.taxi-location-card-clear {
  cursor: pointer;
  color: #9ca3af;
  padding: 2px;
  flex-shrink: 0;
}

.taxi-location-card-spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(34,197,94,0.2);
  border-top-color: #22c55e;
  animation: taxiSpin 0.8s infinite linear;
  flex-shrink: 0;
}

.taxi-state-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 251, 235, 0.96), rgba(255, 255, 255, 0.98));
  border: 1px solid rgba(255, 179, 0, 0.18);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.taxi-state-banner--search {
  margin-top: 10px;
}

.taxi-state-banner--vehicle {
  margin-bottom: 10px;
}

.taxi-state-banner-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FFB300;
  color: #fff;
}

.taxi-state-banner-label {
  font-size: 10px;
  font-weight: 800;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.taxi-state-banner-title {
  font-size: 13px;
  font-weight: 800;
  color: #1f2937;
  line-height: 1.25;
}

.taxi-state-banner-copy {
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  line-height: 1.35;
  margin-top: 2px;
}

.taxi-helper-line {
  margin-top: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  line-height: 1.35;
}

.taxi-route-summary {
  position: relative;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 9px 40px 9px 12px;
  margin-bottom: 9px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.taxi-route-summary-edit {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #9ca3af;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.08);
}

.taxi-route-summary-edit i {
  font-size: 12px;
}

.taxi-route-summary-track {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
}

.taxi-route-summary-text {
  min-width: 0;
  flex: 1;
}

.taxi-route-summary-pickup,
.taxi-route-summary-destination {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
  font-weight: 700;
  color: #374151;
}

.taxi-route-summary-distance {
  text-align: right;
  flex-shrink: 0;
  min-width: 62px;
}

.taxi-route-summary-km {
  font-size: 15px;
  font-weight: 900;
  color: #1f2937;
  line-height: 1.05;
}

.taxi-route-summary-min {
  font-size: 10px;
  color: #9ca3af;
  font-weight: 600;
  line-height: 1.05;
}

.taxi-ride-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.taxi-ride-card {
  position: relative;
  border: 1.5px solid #e5e7eb;
  border-radius: 14px;
  padding: 10px 12px;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.taxi-ride-card.is-selected {
  background: #fffbeb;
  border-color: #FFB300;
  box-shadow: 0 6px 16px rgba(255, 179, 0, 0.14);
}

.taxi-ride-card-top {
  display: contents;
}

.taxi-ride-card-info {
  min-width: 0;
}

.taxi-ride-card-title {
  font-size: 14px;
  font-weight: 800;
  color: #1f2937;
  line-height: 1.15;
}

.taxi-ride-card-meta {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 600;
  color: #9ca3af;
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  flex-wrap: wrap;
}

.taxi-ride-card-dot {
  color: #e5e7eb;
}

.taxi-ride-card-price {
  text-align: right;
  line-height: 1.05;
  min-width: 74px;
}

.taxi-ride-card-price-value {
  font-size: 18px;
  font-weight: 900;
  color: #1f2937;
}

.taxi-ride-card-price-note {
  margin-top: 2px;
  font-size: 10px;
  font-weight: 600;
  color: #9ca3af;
}

.taxi-payment-section {
  margin-top: 12px;
  margin-bottom: 10px;
}

.taxi-payment-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.taxi-payment-option {
  width: 100%;
}

.taxi-payment-note {
  margin-top: 6px;
}

.taxi-book-cta {
  margin-top: 2px;
}

.taxi-book-button {
  min-height: 48px;
}

.taxi-quick-picks {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.taxi-action-button {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  transition: all 0.25s;
}

.taxi-toast {
  position: absolute;
  z-index: 700;
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  font-size: 13px;
  font-weight: 700;
}

/* ═══════════════════════════════════════════
   RESPONSIVE LAYOUT
   Mobile (default): bottom sheet
   Tablet/Desktop (≥768px): left sidebar
   Wide desktop (≥1200px): wider sidebar
   Landscape mobile (short+narrow): taller panel
═══════════════════════════════════════════ */

/* ── Landscape mobile: phone on its side gives ~360px height ── */
@media (max-height: 520px) and (max-width: 900px) {
  #taxi-booking-panel { max-height: 68vh !important; }
}

/* ── Tablet / Desktop sidebar ── */
@media (min-width: 768px) {
  #taxi-page {
    background:
      radial-gradient(circle at top right, rgba(255, 179, 0, 0.08), transparent 22%),
      linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
  }

  #taxi-map-shell {
    right: calc(var(--taxi-panel-width) + (var(--taxi-panel-gap) * 2));
  }

  /* Panel becomes a right-side booking column on desktop */
  #taxi-booking-panel {
    top: 104px !important;
    bottom: 24px !important;
    right: 24px !important;
    left: auto !important;
    width: var(--taxi-panel-width);
    max-height: none !important;
    border-radius: 24px !important;
    border-top: 1px solid rgba(0,0,0,0.05);
    border: 1px solid rgba(15, 23, 42, 0.07);
    box-shadow: 0 18px 52px rgba(15, 23, 42, 0.11) !important;
  }
  /* Drag handle: pointless on desktop — hide it */
  #taxi-booking-panel .taxi-panel-handle { display: none !important; }

  /* Keep the small status chips visible, but de-emphasized */
  .taxi-floating-stack { left: 24px !important; }

  /* Fare preview: sits in the open map column */
  #taxi-fare-preview {
    left: 24px !important;
    bottom: 24px !important;
    top: auto !important;
  }

  /* Toast: sits above the sidebar content at top-left, not bottom */
  #taxi-toast {
    bottom: auto !important;
    top: 108px !important;
    left: 24px !important;
    right: auto !important;
    width: var(--taxi-panel-width) !important;
  }

  /* Leaflet zoom/scale: keep inside the exposed map column */
  #taxi-leaflet-map-element .leaflet-left { left: 24px !important; }
}

/* ── Wide desktop: give sidebar a bit more breathing room ── */
@media (min-width: 1200px) {
  #taxi-page { --taxi-panel-width: 400px; }
  #taxi-toast         { width: var(--taxi-panel-width) !important; }
}

@media (max-width: 767px) {
  #taxi-booking-panel {
    max-height: 56vh;
    border-radius: 22px 22px 18px 18px;
    left: 12px;
    right: 12px;
    bottom: 12px;
  }

  .taxi-floating-stack {
    top: 96px !important;
    left: 14px !important;
    gap: 6px !important;
  }

  .taxi-chip {
    padding: 8px 11px;
    border-radius: 14px;
  }

  .taxi-state-banner {
    padding: 8px 10px;
  }

  .taxi-location-card {
    gap: 8px;
    padding: 8px 10px;
  }

  .taxi-location-card--destination {
    padding: 10px 11px;
  }

  .taxi-location-card-icon {
    width: 26px;
    height: 26px;
  }

  .taxi-state-banner--search {
    margin-top: 8px;
  }

  .taxi-route-summary {
    padding: 8px 10px;
    padding-right: 36px;
    margin-bottom: 8px;
    gap: 8px;
  }

  .taxi-route-summary-edit {
    top: 7px;
    right: 7px;
  }

  .taxi-route-summary-distance {
    min-width: 52px;
  }

  .taxi-ride-grid {
    gap: 7px;
  }

  .taxi-ride-card {
    padding: 9px 10px;
    gap: 8px;
  }

  .taxi-ride-card-price-value {
    font-size: 16px;
  }

  .taxi-payment-section {
    margin-top: 10px;
    margin-bottom: 8px;
  }

  .taxi-payment-toggle {
    gap: 7px;
  }

  .taxi-payment-option {
    padding: 0.72rem 0.8rem !important;
    min-height: 40px !important;
    font-size: 12px !important;
    border-radius: 12px !important;
  }

  .taxi-payment-note {
    padding: 7px 10px !important;
  }

  .taxi-book-cta {
    margin-top: 0;
  }

  .taxi-book-button {
    min-height: 46px;
    padding: 0.8rem 0.9rem !important;
  }

  .taxi-quick-picks {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .taxi-quick-picks::-webkit-scrollbar {
    display: none;
  }

  .taxi-quick-picks > button {
    flex: 0 0 auto;
  }

  #taxi-fare-preview {
    top: auto !important;
    left: 14px !important;
    bottom: calc(56vh + 14px) !important;
  }

  #taxi-leaflet-map-element .leaflet-top { top: 148px !important; }
  #taxi-leaflet-map-element .leaflet-control-attribution {
    font-size: 8px !important;
    padding: 2px 7px !important;
  }

  #taxi-toast {
    left: 12px !important;
    right: 12px !important;
    bottom: calc(56vh + 20px) !important;
  }
}
