/**
 * Map page styles
 * Popups, menu drawer, layer bar, and UI components
 */

/* Utility classes */
.hidden {
  display: none !important;
}

/* ==========================================================================
   Popup Styles (MapLibre GL)
   "Wayfinder's Companion" - Bold, high-contrast popups for pilgrims
   ========================================================================== */

.maplibregl-popup-content,
.leaflet-popup-content-wrapper {
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  padding: 0;
  border-radius: 16px;
  border: none;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.2),
    0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  min-width: 200px;
}

.leaflet-popup-content {
  margin: 0;
  width: auto !important;
}

/* Override Leaflet default link color in popup buttons */
.leaflet-popup-content .fountain-popup__btn {
  color: #374151;
}

.leaflet-popup-content .albergue-popup__btn--primary {
  color: black;
}

.leaflet-popup-content .albergue-popup__btn--secondary {
  color: #374151;
}

.leaflet-popup-content .poi-popup__btn--primary {
  color: white;
}

.leaflet-popup-content .poi-popup__btn--secondary {
  color: #4b5563;
}

.maplibregl-popup-close-button,
.leaflet-popup-close-button {
  display: none;
}

.maplibregl-popup-tip,
.leaflet-popup-tip {
  border-top-color: white;
}

/* ==========================================================================
   Fountain Popup - Water is Life
   ========================================================================== */

.fountain-popup {
  text-align: center;
}

.fountain-popup__header {
  padding: 20px 24px 16px;
  position: relative;
}

.fountain-popup__icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.fountain-popup__icon svg {
  width: 28px;
  height: 28px;
}

.fountain-popup__status {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

.fountain-popup__subtitle {
  font-size: 13px;
  color: #4b5563;
  margin-top: 4px;
}

/* Potable - Green with confidence */
.fountain-popup--potable .fountain-popup__header {
  background: #f0fdf4;
}

.fountain-popup--potable .fountain-popup__icon {
  background: #16a34a;
  color: white;
}

.fountain-popup--potable .fountain-popup__status {
  color: #15803d;
}

/* Not Potable - Red warning */
.fountain-popup--not-potable .fountain-popup__header {
  background: #fef2f2;
}

.fountain-popup--not-potable .fountain-popup__icon {
  background: #dc2626;
  color: white;
}

.fountain-popup--not-potable .fountain-popup__status {
  color: #b91c1c;
}

/* Unknown - Neutral caution */
.fountain-popup--unknown .fountain-popup__header {
  background: #f9fafb;
}

.fountain-popup--unknown .fountain-popup__icon {
  background: #6b7280;
  color: white;
}

.fountain-popup--unknown .fountain-popup__status {
  color: #374151;
}

.fountain-popup__actions {
  display: flex;
  border-top: 1px solid #e5e7eb;
}

.fountain-popup__btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 16px;
  background: white;
  color: #374151;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.15s;
  min-height: 48px;
}

.fountain-popup__btn:hover {
  background: #f3f4f6;
}

.fountain-popup__btn + .fountain-popup__btn {
  border-left: 1px solid #e5e7eb;
}

.fountain-popup__btn svg {
  width: 16px;
  height: 16px;
  opacity: 0.7;
}

/* ==========================================================================
   Albergue Popup - Rest for the Weary
   ========================================================================== */

.albergue-popup {
  min-width: 240px;
}

.albergue-popup__image {
  width: 100%;
  height: 100px;
  overflow: hidden;
  background: #f3f4f6;
}

.albergue-popup__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.albergue-popup__header {
  background: #fffbeb;
  padding: 16px 18px;
  border-bottom: 3px solid #d97706;
  position: relative;
}

.albergue-popup__header--leafshell {
  background: #ecfdf5;
  border-bottom-color: #10b981;
}

.albergue-popup__top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.albergue-popup__ls-badge {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.albergue-popup__info {
  flex: 1;
  min-width: 0;
}

.albergue-popup__name {
  font-size: 17px;
  font-weight: 700;
  color: #1f2937;
  margin: 0;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.albergue-popup__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.albergue-popup__stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: white;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.albergue-popup__stat svg {
  width: 14px;
  height: 14px;
  color: #9ca3af;
}

.albergue-popup__stat--price {
  background: #d97706;
  color: white;
}

.albergue-popup__stat--price svg {
  color: rgba(255, 255, 255, 0.8);
}

.albergue-popup__actions {
  display: flex;
  background: white;
}

.albergue-popup__btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 16px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.15s;
  min-height: 48px;
}

.albergue-popup__btn--primary {
  background: #d97706;
  color: white;
}

.albergue-popup__btn--primary:hover {
  background: #b45309;
}

.albergue-popup__btn--secondary {
  background: #f3f4f6;
  color: #374151;
}

.albergue-popup__btn--secondary:hover {
  background: #e5e7eb;
}

.albergue-popup__btn svg {
  width: 16px;
  height: 16px;
}

/* ==========================================================================
   POI Popup - Points of Discovery
   ========================================================================== */

.poi-popup {
  min-width: 220px;
}

.poi-popup__image {
  width: 100%;
  height: 100px;
  overflow: hidden;
  background: #f3f4f6;
}

.poi-popup__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.poi-popup__header {
  padding: 16px 18px;
  background: white;
  border-bottom: 1px solid #e5e7eb;
}

.poi-popup__top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.poi-popup__icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.poi-popup__icon svg {
  width: 22px;
  height: 22px;
  color: white;
}

.poi-popup__ls-badge {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.poi-popup__info {
  flex: 1;
  min-width: 0;
}

.poi-popup__name {
  font-size: 17px;
  font-weight: 700;
  color: #1f2937;
  margin: 0;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.poi-popup__type {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 4px;
  margin-top: 6px;
}

.poi-popup__diet-pill,
.albergue-popup__diet-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  margin-top: 6px;
  margin-left: 4px;
  background: #dcfce7;
  color: #15803d;
}

.poi-popup__description {
  margin: 10px 0 0;
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1.5;
  color: #374151;
  background: #f3f4f6;
  border-radius: 6px;
}

.poi-popup__meta {
  margin-top: 10px;
  font-size: 13px;
  color: #4b5563;
  line-height: 1.4;
}

.poi-popup__meta-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 4px;
}

.poi-popup__meta-item svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  margin-top: 2px;
  color: #9ca3af;
}

.poi-popup__actions {
  display: flex;
  background: #f9fafb;
}

.poi-popup__btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 16px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.15s;
  min-height: 48px;
}

.poi-popup__btn--primary {
  background: #374151;
  color: white;
}

.poi-popup__btn--primary:hover {
  background: #1f2937;
}

.poi-popup__btn--secondary {
  background: transparent;
  color: #4b5563;
}

.poi-popup__btn--secondary:hover {
  background: #e5e7eb;
}

.poi-popup__btn svg {
  width: 16px;
  height: 16px;
}

/* POI Type Colors */
.poi-popup__icon--monument {
  background: #2563eb;
}
.poi-popup__type--monument {
  background: #dbeafe;
  color: #1e40af;
}

.poi-popup__icon--shop {
  background: #9333ea;
}
.poi-popup__type--shop {
  background: #f3e8ff;
  color: #7e22ce;
}

.poi-popup__icon--food_and_drink {
  background: #ea580c;
}
.poi-popup__type--food_and_drink {
  background: #ffedd5;
  color: #c2410c;
}

.poi-popup__icon--stamp {
  background: #92400e;
}
.poi-popup__type--stamp {
  background: #fef3c7;
  color: #92400e;
}

.poi-popup__icon--museum {
  background: #0d9488;
}
.poi-popup__type--museum {
  background: #ccfbf1;
  color: #0f766e;
}

.poi-popup__icon--church {
  background: #4f46e5;
}
.poi-popup__type--church {
  background: #e0e7ff;
  color: #4338ca;
}

.poi-popup__icon--historical {
  background: #d97706;
}
.poi-popup__type--historical {
  background: #fef3c7;
  color: #b45309;
}

.poi-popup__icon--vista {
  background: #16a34a;
}
.poi-popup__type--vista {
  background: #dcfce7;
  color: #15803d;
}

.poi-popup__icon--camping {
  background: #166534;
}
.poi-popup__type--camping {
  background: #dcfce7;
  color: #166534;
}

/* ==========================================================================
   Menu Overlay & Drawer
   ========================================================================== */

.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1100;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.menu-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.menu-drawer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 85vh;
  background: #f5f5f4;
  z-index: 1101;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  border-radius: 20px 20px 0 0;
  transform: translateY(0);
  transition: transform 0.3s ease;
}

.menu-drawer.hidden {
  transform: translateY(100%);
}

/* Header */
.menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: white;
  border-radius: 20px 20px 0 0;
  flex-shrink: 0;
}

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

.menu-header__logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.menu-header__title {
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #1f2937;
}

.menu-close {
  width: 36px;
  height: 36px;
  background: #f3f4f6;
  border: none;
  border-radius: 50%;
  font-size: 24px;
  font-weight: 300;
  color: #6b7280;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.menu-close:active {
  background: #e5e7eb;
}

/* Content */
.menu-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Sections */
.menu-section {
  padding: 16px 16px 0;
}

.menu-section__label {
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
  padding-left: 4px;
}

/* Primary Action Cards */
.menu-primary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.menu-primary__card {
  background: white;
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.menu-primary__card--route {
  background: linear-gradient(135deg, #0d9488 0%, #14b8a6 100%);
  color: white;
}

.menu-primary__card--route .menu-primary__label {
  color: white;
}

.menu-primary__card--leafshell {
  background: linear-gradient(135deg, #84cc16 0%, #a3e635 100%);
}

.menu-primary__header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.menu-primary__icon {
  width: 28px;
  height: 28px;
  color: rgba(255, 255, 255, 0.9);
  flex-shrink: 0;
}

.menu-primary__img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}

.menu-primary__label {
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: #1f2937;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.menu-primary__select {
  width: 100%;
  padding: 8px 10px;
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #0d9488;
  background: rgba(255, 255, 255, 0.95);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  margin-top: auto;
}

.menu-primary__select:focus {
  outline: 2px solid rgba(255, 255, 255, 0.5);
}

.menu-primary__buttons {
  display: flex;
  gap: 6px;
  margin-top: auto;
}

.menu-primary__btn {
  flex: 1;
  padding: 8px 6px;
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #365314;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 6px;
  text-decoration: none;
  text-align: center;
  transition: background 0.15s;
}

.menu-primary__btn:active {
  background: rgba(255, 255, 255, 1);
}

.menu-primary__btn--alt {
  background: rgba(255, 255, 255, 0.6);
}

/* Secondary Grid */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

@media (min-width: 480px) {
  .menu-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.menu-grid__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 6px;
  background: white;
  border-radius: 10px;
  text-decoration: none;
  transition:
    background 0.15s,
    transform 0.1s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.menu-grid__item:active {
  transform: scale(0.97);
  background: #f9fafb;
}

.menu-grid__icon {
  width: 18px;
  height: 18px;
  color: #6b7280;
}

.menu-grid__item span {
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 11px;
  font-weight: 500;
  color: #4b5563;
  text-align: center;
}

.menu-grid__item--amber {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

.menu-grid__item--amber .menu-grid__icon {
  color: #d97706;
}

.menu-grid__item--amber span {
  color: #92400e;
}

/* Footer */
.menu-footer {
  margin-top: auto;
  padding: 12px 16px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  background: white;
  border-top: 1px solid #e5e7eb;
}

.menu-footer__cache {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 10px;
}

.menu-footer__actions {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.menu-footer__btn {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f9fafb;
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 13px;
  color: #4b5563;
  cursor: pointer;
}

.menu-footer__btn:active {
  background: #f3f4f6;
}

.menu-footer__btn--danger {
  color: #dc2626;
  border-color: #fecaca;
  background: #fef2f2;
}

.menu-footer__updates {
  margin-bottom: 0.75rem;
}

.menu-footer__btn--update {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  color: #16a34a;
  border-color: #86efac;
  background: #f0fdf4;
  font-weight: 500;
}

.menu-footer__coffee {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 8px;
  border: 1px solid #fde68a;
  border-radius: 8px;
  background: #fffbeb;
  color: #92400e;
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}

.menu-footer__coffee:hover {
  background: #fef3c7;
}

.menu-footer__coffee:active {
  background: #fde68a;
}

.menu-footer__version {
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 11px;
  color: #9ca3af;
  text-align: center;
}

/* ==========================================================================
   Layer Bar
   ========================================================================== */

.layer-bar {
  position: absolute;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 8px 12px;
  border-radius: 24px;
  display: flex;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

/* Browser mode - safe area works correctly */
@media (display-mode: browser) {
  .layer-bar {
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  }
}

/* PWA standalone mode - safe-area already handled by iOS, just use fixed offset */
@media (display-mode: standalone) {
  .layer-bar {
    bottom: 20px;
  }
}

.layer-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid transparent;
  background: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.layer-btn:active {
  transform: scale(0.95);
}

.layer-btn.active {
  border-color: #d97706;
  background: #fef3c7;
}

.layer-btn.disabled {
  opacity: 0.5;
}

.layer-icon-svg {
  width: 24px;
  height: 24px;
  color: #374151;
}

.layer-btn.active .layer-icon-svg {
  color: #d97706;
}

.layer-icon-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  opacity: 0.7;
}

.layer-btn.active .layer-icon-img {
  opacity: 1;
}

.layer-bar__divider {
  width: 1px;
  height: 28px;
  background: rgba(0, 0, 0, 0.15);
  margin: 0 4px;
  align-self: center;
}

.layer-btn--menu {
  background: rgba(255, 255, 255, 0.95);
}

.layer-btn--menu .layer-icon-img {
  width: 32px;
  height: 32px;
  opacity: 1;
  border-radius: 50%;
}

.layer-btn--menu {
  position: relative;
}

.update-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  background: #16a34a;
  border: 2px solid white;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.update-dot.hidden {
  display: none;
}

/* ==========================================================================
   Status Indicators
   ========================================================================== */

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
}

.status-dot.offline {
  background: #f59e0b;
}

.sw-badge {
  font-size: 10px;
  padding: 2px 5px;
  border-radius: 4px;
  background: #ef4444;
  color: white;
  font-weight: 500;
}

.sw-badge.active {
  background: #22c55e;
}

/* ==========================================================================
   Toast Messages
   ========================================================================== */

.map-toast {
  position: fixed;
  top: 50%;
  left: 16px;
  right: 16px;
  max-width: 400px;
  margin: 0 auto;
  background: #1f2937;
  color: white;
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  z-index: 2000;
  opacity: 0;
  transform: translateY(-50%) scale(0.95);
  transition:
    opacity 0.3s,
    transform 0.3s;
}

.map-toast--visible {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

.map-toast__icon {
  width: 48px;
  height: 48px;
  background: rgba(251, 191, 36, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fbbf24;
}

.map-toast__icon svg {
  width: 28px;
  height: 28px;
}

.map-toast__content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.map-toast__content strong {
  font-size: 17px;
  font-weight: 600;
}

.map-toast__content p {
  margin: 0;
  font-size: 14px;
  color: #9ca3af;
  line-height: 1.4;
}

.map-toast__actions {
  display: flex;
  gap: 12px;
  width: 100%;
}

.map-toast__btn {
  flex: 1;
  padding: 12px 16px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.15s,
    transform 0.1s;
}

.map-toast__btn:active {
  transform: scale(0.97);
}

.map-toast__btn--primary {
  background: #d97706;
  color: white;
}

.map-toast__btn--primary:hover {
  background: #b45309;
}

.map-toast__btn--secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #d1d5db;
}

.map-toast__btn--secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Layer switch toast - lightweight notification */
.layer-toast {
  position: fixed;
  bottom: calc(90px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(31, 41, 55, 0.95);
  color: white;
  padding: 10px 18px;
  border-radius: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  z-index: 1050;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s,
    transform 0.2s;
}

.layer-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.layer-toast__icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.layer-toast__icon svg {
  width: 20px;
  height: 20px;
}

.layer-toast__icon img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

@media (display-mode: standalone) {
  .layer-toast {
    bottom: 90px;
  }
}

/* ==========================================================================
   Leaflet Marker Cluster Styles
   ========================================================================== */

.cluster-marker {
  background: transparent;
}

.cluster-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #1a1a1a;
  border: 2px solid white;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.cluster-icon--fountain {
  background: rgba(37, 99, 235, 0.75);
  color: white;
}

.cluster-icon--albergue {
  background: rgba(245, 158, 11, 0.75);
  color: #1a1a1a;
}

.cluster-icon--poi {
  background: rgba(107, 114, 128, 0.75);
  color: white;
}

.cluster-icon--leafshell {
  background: rgba(22, 163, 74, 0.75);
  color: white;
}

.cluster-icon--camping {
  background: rgba(22, 101, 52, 0.75);
  color: white;
}

/* Leaflet div icon reset */
.fountain-marker,
.albergue-marker,
.poi-marker {
  background: transparent;
  border: none;
}

/* Override default Leaflet marker cluster styles */
.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
  background-color: transparent !important;
}

.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
  background-color: transparent !important;
}

/* ==========================================================================
   Route Selector Control (Leaflet)
   ========================================================================== */

.route-control {
  position: relative;
}

.route-control__btn {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 30px !important;
  height: 30px !important;
  background: white;
  color: #333;
  text-decoration: none;
  line-height: 30px !important;
  padding: 0 !important;
  box-sizing: border-box;
}

.route-control__btn svg {
  width: 18px !important;
  height: 18px !important;
  max-width: none !important;
  display: block;
  flex-shrink: 0;
  margin: 0;
}

.route-control__btn:hover {
  background: #f4f4f4;
}

.route-control__panel {
  display: none;
  position: absolute;
  top: 0;
  right: 36px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  min-width: 180px;
  overflow: hidden;
  z-index: 1000;
}

.route-control.expanded .route-control__panel {
  display: block;
}

.route-control__header {
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #eee;
  background: #fafafa;
}

.route-control__list {
  max-height: 300px;
  overflow-y: auto;
}

.route-control__option {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border: none;
  background: white;
  text-align: left;
  font-size: 14px;
  color: #333;
  cursor: pointer;
  transition: background 0.15s;
}

.route-control__option:hover {
  background: #f5f5f5;
}

.route-control__option.active {
  background: #fef3c7;
  color: #92400e;
  font-weight: 600;
}

.route-control__option + .route-control__option {
  border-top: 1px solid #eee;
}

/* ==========================================================================
   Help Control (Icon Legend)
   ========================================================================== */

.help-control__btn {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 30px !important;
  height: 30px !important;
  background: white;
  color: #666;
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  line-height: 30px !important;
  padding: 0 !important;
  box-sizing: border-box;
}

.help-control__btn:hover {
  background: #f4f4f4;
  color: #333;
}

/* Help Modal Overlay */
.help-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

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

.help-modal {
  width: 80%;
  max-width: 500px;
  height: 80%;
  max-height: 600px;
  background: white;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  transform: scale(0.95);
  transition: transform 0.2s ease;
}

.help-modal-overlay--visible .help-modal {
  transform: scale(1);
}

.help-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.help-modal__title {
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #1f2937;
  margin: 0;
}

.help-modal__close {
  width: 32px;
  height: 32px;
  background: #f3f4f6;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  color: #6b7280;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.help-modal__close:hover {
  background: #e5e7eb;
}

.help-modal__content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  -webkit-overflow-scrolling: touch;
}

.help-modal__section {
  margin-bottom: 24px;
}

.help-modal__section:last-child {
  margin-bottom: 0;
}

.help-modal__section-title {
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 12px 0;
}

.help-modal__item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid #f3f4f6;
}

.help-modal__item:last-child {
  border-bottom: none;
}

.help-modal__icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.help-modal__icon svg {
  width: 28px;
  height: 28px;
}

.help-modal__icon img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.help-modal__icon--small svg {
  width: 24px;
  height: 24px;
}

.help-modal__text {
  flex: 1;
  min-width: 0;
}

.help-modal__label {
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 2px 0;
}

.help-modal__desc {
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 13px;
  color: #6b7280;
  line-height: 1.4;
  margin: 0;
}
