/* =============================================
   FUELRADAR - Main Styles
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Exo+2:wght@300;400;500;600;700;800;900&family=DM+Sans:wght@300;400;500;600;700&display=swap');

/* ---- Base ---- */
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  transition: background 0.3s ease, color 0.3s ease;
}

/* ---- Header ---- */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
  flex-shrink: 0;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.header__brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header__logo {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.header__title {
  font-family: 'Exo 2', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.header__title span:first-child {
  color: var(--text-primary);
}

.header__title span:last-child {
  color: var(--color-primary);
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Theme toggle */
.theme-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--bg-toggle);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  transition: background 0.3s;
}

.theme-toggle__input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.theme-toggle__slider {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: var(--color-primary);
  border-radius: 50%;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}

.theme-toggle__input:checked + .theme-toggle__slider {
  transform: translateX(20px);
}

/* Favorites button */
.btn-favorites {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  transition: all 0.2s;
  position: relative;
}

.btn-favorites:hover,
.btn-favorites.active {
  color: var(--color-accent);
  border-color: var(--color-accent);
}

.btn-favorites__count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--color-accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ---- Search Panel ---- */
.search-panel {
  padding: 10px 16px;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
  z-index: 999;
}

.search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.search-bar__input-wrapper {
  flex: 1;
  position: relative;
}

.search-bar__icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 16px;
  pointer-events: none;
}

.search-bar__input {
  width: 100%;
  padding: 10px 12px 10px 38px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-bar__input::placeholder {
  color: var(--text-muted);
}

.search-bar__input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-alpha);
}

.search-bar__gps {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 18px;
  transition: all 0.2s;
}

.search-bar__gps:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.search-bar__gps.locating {
  color: var(--color-primary);
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Radius selector */
.search-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.radius-selector {
  display: flex;
  gap: 4px;
  flex: 1;
}

.radius-btn {
  flex: 1;
  padding: 6px 4px;
  background: var(--bg-chip);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 500;
  transition: all 0.2s;
  text-align: center;
}

.radius-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.radius-btn.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-primary-text);
  font-weight: 600;
}

.radius-custom-wrapper {
  flex: 1;
  min-width: 0;
}

.radius-custom-wrapper.active .radius-custom-input {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary-alpha);
}

.radius-custom-input {
  width: 100%;
  padding: 6px 4px;
  background: var(--bg-chip);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.75rem;
  font-weight: 500;
  text-align: center;
  transition: all 0.2s;
  -moz-appearance: textfield;
}

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

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

.search-btn {
  padding: 6px 16px;
  background: var(--color-primary);
  color: var(--color-primary-text);
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.2s;
  white-space: nowrap;
}

.search-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.search-btn:active {
  transform: translateY(0);
}

/* ---- Filters Bar ---- */
.filters-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
  flex-shrink: 0;
  z-index: 998;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.filters-bar::-webkit-scrollbar {
  display: none;
}

.fuel-chip {
  padding: 5px 12px;
  background: var(--bg-chip);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  color: var(--text-secondary);
  transition: all 0.2s;
  flex-shrink: 0;
}

.fuel-chip:hover {
  border-color: var(--color-primary);
}

.fuel-chip.active {
  background: var(--color-primary-alpha);
  border-color: var(--color-primary);
  color: var(--color-primary);
  font-weight: 600;
}

/* ---- Filter Modal Trigger Buttons ---- */
.filter-modal-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--bg-chip);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  color: var(--text-secondary);
  transition: all 0.2s;
  flex-shrink: 0;
  cursor: pointer;
}

.filter-modal-btn:hover {
  border-color: var(--color-primary);
  color: var(--text-primary);
}

.filter-modal-btn.active {
  background: var(--color-primary-alpha);
  border-color: var(--color-primary);
  color: var(--color-primary);
  font-weight: 600;
}

/* ---- Filter Modals ---- */
.filter-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 2000;
  backdrop-filter: blur(2px);
}

.filter-modal-backdrop.open {
  display: block;
}

.filter-modal {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-radius: 20px 20px 0 0;
  z-index: 2001;
  max-height: 75vh;
  max-width: 520px;
  margin: 0 auto;
  flex-direction: column;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.2);
  overflow: hidden;
}

.filter-modal.open {
  display: flex;
}

.filter-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.filter-modal__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.filter-modal__close {
  width: 32px;
  height: 32px;
  background: var(--bg-chip);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  font-size: 1rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-modal__close:hover {
  background: var(--color-error-alpha, rgba(239,68,68,0.1));
  border-color: var(--color-error, #ef4444);
  color: var(--color-error, #ef4444);
}

.filter-modal__body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
  -webkit-overflow-scrolling: touch;
}

.filter-modal__footer {
  padding: 12px 20px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border-color);
  flex-shrink: 0;
}

/* ---- Modal Options (checkboxes) ---- */
.modal-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 20px;
  cursor: pointer;
  transition: background 0.15s;
  user-select: none;
}

.modal-option:hover {
  background: var(--bg-hover, rgba(0,0,0,0.04));
}

.modal-option.active {
  background: var(--color-primary-alpha);
}

.modal-option__check {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-primary);
  flex-shrink: 0;
  transition: all 0.15s;
}

.modal-option.active .modal-option__check {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.modal-option__label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  flex: 1;
}

.modal-option__brand-logo {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.modal-option__brand-initial {
  width: 22px;
  height: 22px;
  background: var(--color-primary-alpha);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1;
  flex-shrink: 0;
}

.modal-option-divider {
  height: 1px;
  background: var(--border-color);
  margin: 4px 20px;
}

.modal-empty {
  padding: 32px 20px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

/* ---- Panel Close Bottom Button ---- */
.panel-close-bottom {
  display: block;
  width: calc(100% - 32px);
  margin: 0 16px;
  padding: 14px;
  background: var(--bg-chip);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: max(16px, env(safe-area-inset-bottom));
  flex-shrink: 0;
}

.panel-close-bottom:hover {
  background: var(--color-error-alpha, rgba(239,68,68,0.1));
  border-color: var(--color-error, #ef4444);
  color: var(--color-error, #ef4444);
}

.filters-divider {
  width: 1px;
  height: 20px;
  background: var(--border-color);
  flex-shrink: 0;
}

.sort-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  background: var(--bg-chip);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  color: var(--text-secondary);
  transition: all 0.2s;
  flex-shrink: 0;
}

.sort-btn:hover {
  border-color: var(--color-accent);
}

.sort-btn.active {
  background: var(--color-accent-alpha);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.sort-btn__arrow {
  font-size: 10px;
  transition: transform 0.2s;
}

.sort-btn__arrow.desc {
  transform: rotate(180deg);
}

/* ---- Main Content (Map + List) ---- */
.main-content {
  flex: 1;
  position: relative;
  overflow: hidden;
}

/* ---- Map ---- */
#map {
  width: 100%;
  height: 100%;
  z-index: 1;
}

.leaflet-control-zoom {
  border: none !important;
  box-shadow: var(--shadow-md) !important;
}

.leaflet-control-zoom a {
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border-color) !important;
  width: 34px !important;
  height: 34px !important;
  line-height: 34px !important;
  font-size: 16px !important;
}

.leaflet-control-zoom a:hover {
  background: var(--bg-card-hover) !important;
}

/* Custom marker */
.station-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 3px solid var(--color-primary);
  background: var(--color-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: all 0.2s;
}

.station-marker.cheap {
  border-color: #16a34a;
  background: #22c55e;
}

.station-marker.mid {
  border-color: #d97706;
  background: #f59e0b;
}

.station-marker.expensive {
  border-color: #dc2626;
  background: #ef4444;
}

.station-marker.favorite {
  box-shadow: 0 0 0 2px var(--color-accent), 0 2px 8px rgba(0,0,0,0.3);
}

.station-marker__inner {
  transform: rotate(45deg);
  width: 23px;
  height: 23px;
  background: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.05);
}

.station-marker__logo {
  width: 20px;
  height: 20px;
  object-fit: contain;
  display: block;
  padding: 1px;
}

.station-marker__fallback {
  width: 23px;
  height: 23px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.station-marker__fallback--pump {
  background: #fff;
}

.station-marker.highlighted {
  width: 44px;
  height: 44px;
  z-index: 1000 !important;
  animation: markerBounce 0.4s ease;
}

.station-marker.highlighted .station-marker__inner {
  width: 29px;
  height: 29px;
}

.station-marker.highlighted .station-marker__logo,
.station-marker.highlighted .station-marker__fallback {
  width: 25px;
  height: 25px;
}

@keyframes markerBounce {
  0%, 100% { transform: rotate(-45deg) translateY(0); }
  50% { transform: rotate(-45deg) translateY(-8px); }
}

/* Map popup */
.map-popup {
  font-family: 'DM Sans', sans-serif;
}

.map-popup__name {
  font-family: 'Exo 2', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.map-popup__address {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.map-popup__prices {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.map-popup__price-tag {
  padding: 2px 8px;
  background: var(--color-primary-alpha);
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
}

.leaflet-popup-content-wrapper {
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
  border-radius: 12px !important;
  box-shadow: var(--shadow-lg) !important;
  border: 1px solid var(--border-color) !important;
}

.leaflet-popup-tip {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-color) !important;
  border-top: none !important;
  border-left: none !important;
}

.leaflet-popup-close-button {
  color: var(--text-secondary) !important;
}

/* ---- Bottom Sheet (Station List) ---- */
.bottom-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 500;
  background: var(--bg-primary);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  max-height: 70vh;
  min-height: 60px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  touch-action: none;
}

.bottom-sheet.collapsed {
  transform: translateY(calc(100% - 60px));
}

.bottom-sheet.expanded {
  transform: translateY(0);
}

.bottom-sheet__handle {
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: grab;
  flex-shrink: 0;
}

.bottom-sheet__handle-bar {
  width: 36px;
  height: 4px;
  background: var(--text-muted);
  border-radius: 2px;
  opacity: 0.5;
}

.bottom-sheet__handle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0 4px;
  margin-top: 4px;
}

.bottom-sheet__summary {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.bottom-sheet__summary strong {
  color: var(--color-primary);
  font-weight: 700;
}

.bottom-sheet__close {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-chip);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.bottom-sheet__close:hover {
  background: var(--bg-card-hover);
  color: var(--color-primary);
  border-color: var(--color-primary);
}

/* Station list */
.station-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 12px 8px;
  -webkit-overflow-scrolling: touch;
}

.station-card {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.station-card:hover {
  border-color: var(--color-primary);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.station-card.highlighted {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px var(--color-primary-alpha);
}

.station-card__rank {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Exo 2', sans-serif;
  font-weight: 800;
  font-size: 0.8rem;
  flex-shrink: 0;
  background: var(--bg-chip);
  color: var(--text-secondary);
}

.station-card__rank.top {
  background: var(--color-primary-alpha);
  color: var(--color-primary);
}

.station-card__info {
  flex: 1;
  min-width: 0;
}

.station-card__name {
  font-family: 'Exo 2', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.station-card__address {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
}

.station-card__prices {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.price-tag {
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--bg-chip);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.price-tag.cheapest {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.3);
}

.price-tag.priciest {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

.station-card__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.station-card__distance {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-primary);
  white-space: nowrap;
}

.station-card__fav {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 14px;
  color: var(--text-muted);
  transition: all 0.2s;
}

.station-card__fav:hover,
.station-card__fav.active {
  color: var(--color-accent);
  background: var(--color-accent-alpha);
}

/* ---- Station Detail Panel ---- */
.detail-panel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.detail-panel.open {
  transform: translateX(0);
}

.detail-panel__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-color);
}

.detail-panel__back {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 18px;
  transition: all 0.2s;
}

.detail-panel__back:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.detail-panel__title {
  font-family: 'Exo 2', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-panel__fav {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  font-size: 16px;
  color: var(--text-muted);
  transition: all 0.2s;
}

.detail-panel__fav.active {
  color: var(--color-accent);
  border-color: var(--color-accent);
  background: var(--color-accent-alpha);
}

.detail-panel__content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.detail-section {
  margin-bottom: 20px;
}

.detail-section__title {
  font-family: 'Exo 2', sans-serif;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.detail-address {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.detail-address__icon {
  font-size: 20px;
  color: var(--color-primary);
  flex-shrink: 0;
  margin-top: 2px;
}

.detail-address__text {
  font-size: 0.85rem;
  line-height: 1.4;
}

.detail-address__distance {
  font-size: 0.75rem;
  color: var(--color-primary);
  font-weight: 600;
  margin-top: 4px;
}

/* Price list */
.detail-prices {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.detail-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  transition: all 0.2s;
}

.detail-price-row__name {
  font-weight: 600;
  font-size: 0.85rem;
}

.detail-price-row__info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.detail-price-row__price {
  font-family: 'Exo 2', sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--color-primary);
}

.detail-price-row__update {
  font-size: 0.65rem;
  color: var(--text-muted);
}

/* Actions */
.detail-actions {
  display: flex;
  gap: 8px;
}

.detail-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.detail-action-btn--primary {
  background: var(--color-primary);
  color: var(--color-primary-text);
}

.detail-action-btn--primary:hover {
  filter: brightness(1.1);
}

.detail-action-btn--secondary {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.detail-action-btn--secondary:hover {
  border-color: var(--color-primary);
}

.detail-action-btn--waze {
  background: #33ccff;
  color: #000;
}

/* ---- Loading Overlay ---- */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(4px);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.loading-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border-color);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ---- Toast ---- */
.toast-container {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 10px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.5s forwards;
  white-space: nowrap;
  pointer-events: auto;
}

.toast--success {
  border-color: #22c55e;
  color: #22c55e;
}

.toast--error {
  border-color: #ef4444;
  color: #ef4444;
}

.toast--info {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

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

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

/* ---- Favorites Panel ---- */
.favorites-panel {
  position: fixed;
  top: 0;
  right: -320px;
  width: 320px;
  max-width: 85vw;
  height: 100%;
  background: var(--bg-primary);
  z-index: 2000;
  border-left: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.favorites-panel.open {
  right: 0;
}

.favorites-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.favorites-backdrop.visible {
  opacity: 1;
  pointer-events: auto;
}

.favorites-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
}

.favorites-panel__title {
  font-family: 'Exo 2', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
}

.favorites-panel__close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.favorites-panel__list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.favorites-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
}

.favorites-empty__icon {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.favorites-empty__text {
  font-size: 0.85rem;
}

/* ---- Empty state ---- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
}

.empty-state__icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.4;
}

.empty-state__title {
  font-family: 'Exo 2', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 4px;
  color: var(--text-secondary);
}

.empty-state__text {
  font-size: 0.8rem;
}

/* ---- Responsive ---- */
@media (min-width: 768px) {
  .bottom-sheet {
    width: 380px;
    right: auto;
    left: 12px;
    bottom: 12px;
    top: auto;
    border-radius: 16px;
    max-height: calc(100% - 24px);
    box-shadow: var(--shadow-lg);
  }

  .bottom-sheet.collapsed {
    transform: translateY(calc(100% - 60px));
  }

  .detail-panel {
    width: 420px;
    right: 0;
    left: auto;
    transform: translateX(100%);
    border-left: 1px solid var(--border-color);
  }

  .detail-panel.open {
    transform: translateX(0);
  }
}

@media (min-width: 1024px) {
  .bottom-sheet {
    width: 400px;
  }
}

/* ---- Leaflet attribution fix ---- */
.leaflet-control-attribution {
  background: var(--bg-card) !important;
  color: var(--text-muted) !important;
  font-size: 10px !important;
  padding: 2px 6px !important;
  border-radius: 4px !important;
}

.leaflet-control-attribution a {
  color: var(--color-primary) !important;
}

/* Fix leaflet tile rendering in dark mode */
.leaflet-container {
  background: var(--bg-primary) !important;
}

/* ---- Autocomplete dropdown ---- */
.search-bar__input-wrapper {
  position: relative;
}

.autocomplete-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  z-index: 9000;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  max-height: 260px;
  overflow-y: auto;
}

.autocomplete-dropdown.open {
  display: block;
}

.autocomplete-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  cursor: pointer;
  transition: background 0.15s ease;
  border-bottom: 1px solid var(--border-color);
}

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

.autocomplete-item:hover,
.autocomplete-item.focused {
  background: var(--bg-hover, rgba(0, 212, 255, 0.08));
}

.autocomplete-item__icon {
  font-size: 0.95rem;
  margin-top: 1px;
  flex-shrink: 0;
}

.autocomplete-item__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.autocomplete-item__main {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.autocomplete-item__sub {
  font-size: 0.76rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}