/* ============================================================
   PHARMA FÈS — Design System & Complete Styles
   ============================================================ */

/* ---------- CSS Variables ---------- */
:root {
  --primary: #16a34a;
  --primary-light: #22c55e;
  --primary-dark: #15803d;
  --primary-bg: #f0fdf4;
  --accent: #3b82f6;
  --accent-light: #60a5fa;
  --bg: #f8fafb;
  --surface: #ffffff;
  --text: #1e293b;
  --text-secondary: #64748b;
  --text-light: #94a3b8;
  --border: #e2e8f0;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
  --radius: 16px;
  --radius-sm: 8px;
  --radius-full: 9999px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- CSS Reset ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--primary);
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

input {
  font-family: inherit;
}

ul, ol {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

/* ---------- App Header ---------- */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.5);
}

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

.app-logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.3);
}

.app-logo .material-icons-round {
  color: #fff;
  font-size: 20px;
}

.app-title {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--primary-dark);
  letter-spacing: -0.02em;
}

.header-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: var(--transition);
}

.header-btn:hover {
  background: var(--primary-bg);
  color: var(--primary);
}

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

/* ---------- Search Bar ---------- */
.search-container {
  position: fixed;
  top: 68px;
  left: 0;
  right: 0;
  z-index: 999;
  padding: 0 16px;
}

.search-bar {
  position: relative;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  border: 1px solid rgba(226, 232, 240, 0.6);
  transition: var(--transition);
}

.search-bar:focus-within {
  border-color: var(--primary-light);
  box-shadow: var(--shadow), 0 0 0 3px rgba(22, 197, 94, 0.12);
}

.search-icon {
  position: absolute;
  left: 14px;
  color: var(--text-light);
  font-size: 22px;
  pointer-events: none;
}

.search-bar input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  padding: 12px 44px 12px 44px;
  font-size: 0.95rem;
  color: var(--text);
}

.search-bar input::placeholder {
  color: var(--text-light);
}

.search-clear {
  position: absolute;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  transition: var(--transition);
}

.search-clear:hover {
  background: var(--border);
  color: var(--text-secondary);
}

/* Search Results Dropdown */
.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-height: 300px;
  overflow-y: auto;
  z-index: 1001;
  border: 1px solid var(--border);
  animation: fadeIn 0.2s ease;
}

.search-results::-webkit-scrollbar {
  width: 4px;
}

.search-results::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.search-result-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: var(--transition);
}

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

.search-result-item:hover {
  background: var(--primary-bg);
}

.search-result-item:active {
  background: #dcfce7;
}

.search-result-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.search-result-icon .material-icons-round {
  font-size: 18px;
  color: var(--primary);
}

.search-result-text {
  flex: 1;
  min-width: 0;
}

.search-result-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-address {
  font-size: 0.78rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Map ---------- */
#map {
  position: fixed;
  inset: 0;
  z-index: 1;
}

/* Custom marker overrides */
.custom-marker {
  background: transparent !important;
  border: none !important;
}

.marker-bounce {
  animation: bounceIn 0.5s ease;
}

/* User position marker */
.user-marker {
  width: 18px;
  height: 18px;
  background: var(--accent);
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
  animation: userPulse 2s infinite;
}

/* Leaflet popup overrides */
.leaflet-popup-content-wrapper {
  border-radius: var(--radius) !important;
  box-shadow: var(--shadow-lg) !important;
  padding: 0 !important;
}

.leaflet-popup-content {
  margin: 0 !important;
  font-family: 'Inter', sans-serif !important;
  min-width: 220px;
}

.leaflet-popup-tip {
  box-shadow: none !important;
}

.popup-content {
  padding: 14px 16px;
}

.popup-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 4px;
}

.popup-address {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.popup-address .material-icons-round {
  font-size: 14px;
}

.popup-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.popup-distance {
  font-size: 0.78rem;
  color: var(--text-light);
}

.popup-btn {
  padding: 6px 14px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.popup-btn:hover {
  background: var(--primary-dark);
}

.popup-status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.68rem;
  font-weight: 600;
  margin-bottom: 6px;
}

/* ---------- FAB Buttons ---------- */
.fab-container {
  position: fixed;
  bottom: 100px;
  right: 16px;
  z-index: 998;
  display: flex;
  flex-direction: column-reverse;
  gap: 12px;
}

.fab-button {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--surface);
  border: none;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.fab-button .material-icons-round {
  font-size: 24px;
  color: var(--primary);
  transition: var(--transition);
}

.fab-button:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.16);
}

.fab-button:active {
  transform: scale(0.95);
}

.fab-button.active {
  background: var(--primary);
}

.fab-button.active .material-icons-round {
  color: #fff;
}

.fab-label {
  position: absolute;
  right: 60px;
  background: var(--surface);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateX(8px);
  transition: var(--transition);
  color: var(--text);
}

.fab-button:hover .fab-label {
  opacity: 1;
  transform: translateX(0);
}

/* ---------- Bottom Sheet ---------- */
.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.1);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateY(calc(100% - 80px));
  will-change: transform;
}

.bottom-sheet.half {
  transform: translateY(50%);
}

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

.bottom-sheet-handle {
  width: 40px;
  height: 4px;
  background: var(--border);
  border-radius: 4px;
  margin: 12px auto;
  cursor: grab;
  transition: var(--transition);
}

.bottom-sheet-handle:hover {
  background: var(--text-light);
  width: 50px;
}

.bottom-sheet-header {
  padding: 0 20px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.bottom-sheet-header h2 {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text);
}

.bottom-sheet-count {
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: var(--primary-bg);
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-weight: 500;
}

.bottom-sheet-content {
  padding: 0 16px 16px;
  overflow-y: auto;
  max-height: calc(100vh - 180px);
  -webkit-overflow-scrolling: touch;
}

.bottom-sheet-content::-webkit-scrollbar {
  width: 4px;
}

.bottom-sheet-content::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

/* ---------- Pharmacy Card ---------- */
.pharmacy-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease both;
}

.pharmacy-card:hover {
  box-shadow: var(--shadow);
  border-color: var(--primary-light);
}

.pharmacy-card:active {
  transform: scale(0.98);
}

.pharmacy-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.pharmacy-card-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text);
  flex: 1;
  min-width: 0;
}

.pharmacy-status {
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.pharmacy-status.open {
  background: #dcfce7;
  color: #16a34a;
}

.pharmacy-status.garde {
  background: #dbeafe;
  color: #3b82f6;
}

.pharmacy-status.closed {
  background: #fee2e2;
  color: #ef4444;
}

.pharmacy-card-address {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin: 6px 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.pharmacy-card-address .material-icons-round {
  font-size: 15px;
  color: var(--text-light);
  flex-shrink: 0;
}

.pharmacy-card-quartier {
  font-size: 0.78rem;
  color: var(--text-light);
  margin-bottom: 8px;
}

.pharmacy-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.pharmacy-card-distance {
  font-size: 0.8rem;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 4px;
}

.pharmacy-card-distance .material-icons-round {
  font-size: 14px;
}

.pharmacy-card-actions {
  display: flex;
  gap: 8px;
}

.pharmacy-card-action {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-bg);
  color: var(--primary);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.pharmacy-card-action .material-icons-round {
  font-size: 18px;
}

.pharmacy-card-action:hover {
  background: var(--primary);
  color: #fff;
}

.pharmacy-card-action:active {
  transform: scale(0.9);
}

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

.detail-modal.active {
  opacity: 1;
  pointer-events: all;
}

.detail-modal-content {
  background: var(--surface);
  border-radius: 24px 24px 0 0;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.detail-modal.active .detail-modal-content {
  transform: translateY(0);
}

.detail-modal-content::-webkit-scrollbar {
  width: 4px;
}

.detail-modal-content::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.detail-header {
  padding: 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--border);
}

.detail-name {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.detail-status {
  display: inline-block;
  padding: 4px 14px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
}

.detail-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.detail-close:hover {
  background: var(--border);
  color: var(--text);
}

.detail-body {
  padding: 4px 0;
}

.detail-info-row {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

.detail-info-row:last-child {
  border-bottom: none;
}

.detail-info-row:hover {
  background: var(--bg);
}

.detail-info-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.detail-info-icon .material-icons-round {
  font-size: 20px;
  color: var(--primary);
}

.detail-info-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.detail-info-label {
  font-size: 0.75rem;
  color: var(--text-light);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.detail-info-value {
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 500;
}

.detail-actions {
  padding: 20px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.detail-action-btn {
  padding: 14px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition);
  border: none;
}

.detail-action-btn .material-icons-round {
  font-size: 20px;
}

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

.detail-action-btn.primary:hover {
  background: var(--primary-dark);
}

.detail-action-btn.primary:active {
  transform: scale(0.97);
}

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

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

.detail-action-btn.secondary:active {
  transform: scale(0.97);
}

/* ---------- About View ---------- */
.about-view {
  position: fixed;
  inset: 0;
  z-index: 1500;
  background: var(--surface);
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.about-view.active {
  transform: translateX(0);
}

.about-header {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  z-index: 10;
}

.about-header h2 {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
}

.about-back {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  cursor: pointer;
  transition: var(--transition);
}

.about-back:hover {
  background: var(--border);
}

.about-content {
  padding: 24px 20px 40px;
  max-width: 560px;
  margin: 0 auto;
}

.about-logo {
  text-align: center;
  margin-bottom: 32px;
  animation: fadeIn 0.5s ease;
}

.about-logo-icon {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  box-shadow: 0 4px 16px rgba(22, 163, 74, 0.3);
}

.about-logo-icon .material-icons-round {
  font-size: 36px;
  color: #fff;
}

.about-logo h3 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
}

.about-logo p {
  color: var(--text-light);
  font-size: 0.85rem;
  margin-top: 2px;
}

.about-section {
  margin-bottom: 28px;
}

.about-section h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--primary-bg);
}

.about-section p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 8px;
}

.about-note {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 0.85rem !important;
  color: #92400e !important;
}

.emergency-card {
  background: var(--bg);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.emergency-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

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

.emergency-item:hover {
  background: var(--primary-bg);
}

.emergency-item .material-icons-round {
  font-size: 24px;
  color: #ef4444;
  width: 40px;
  height: 40px;
  background: #fee2e2;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.emergency-item div {
  display: flex;
  flex-direction: column;
}

.emergency-item strong {
  font-size: 0.9rem;
  color: var(--text);
}

.emergency-item a {
  font-size: 0.85rem;
  color: var(--accent);
  font-weight: 600;
}

.about-footer {
  text-align: center;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.about-footer p {
  font-size: 0.82rem;
  color: var(--text-light);
}

/* ---------- Toast Notification ---------- */
.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  z-index: 3000;
  background: var(--text);
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  max-width: calc(100vw - 48px);
}

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

.toast.success {
  background: var(--primary);
}

.toast.error {
  background: #ef4444;
}

.toast.info {
  background: var(--accent);
}

.toast-icon {
  font-size: 20px;
}

/* ---------- Animations ---------- */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes ripple {
  to { transform: scale(4); opacity: 0; }
}

@keyframes userPulse {
  0% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4); }
  100% { box-shadow: 0 0 0 20px rgba(59, 130, 246, 0); }
}

@keyframes shimmer {
  from { background-position: -200% 0; }
  to { background-position: 200% 0; }
}

@keyframes bounceIn {
  0% { transform: scale(0); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* ---------- Utility Classes ---------- */
.loading-shimmer {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

.hidden {
  display: none !important;
}

.no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}

.no-results .material-icons-round {
  font-size: 48px;
  color: var(--border);
  margin-bottom: 12px;
}

.no-results p {
  color: var(--text-light);
  font-size: 0.9rem;
}

/* ---------- Responsive: Tablet (481–768px) ---------- */
@media (min-width: 481px) {
  .search-container {
    padding: 0 24px;
    max-width: 560px;
    left: 50%;
    transform: translateX(-50%);
  }

  .bottom-sheet-content {
    padding: 0 20px 20px;
  }

  .pharmacy-card {
    padding: 18px;
  }

  .detail-modal-content {
    max-width: 480px;
    margin: 0 auto;
    border-radius: 24px 24px 0 0;
  }
}

/* ---------- Responsive: Desktop (>768px) ---------- */
@media (min-width: 769px) {
  .bottom-sheet {
    width: 380px;
    height: 100vh;
    border-radius: 0;
    left: 0;
    right: auto;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.08);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .bottom-sheet.half,
  .bottom-sheet.full {
    transform: translateX(0);
  }

  .bottom-sheet.peek-desktop {
    transform: translateX(-100%);
  }

  .bottom-sheet-handle {
    display: none;
  }

  .bottom-sheet-header {
    padding: 80px 20px 12px;
  }

  .bottom-sheet-content {
    max-height: calc(100vh - 140px);
  }

  .fab-container {
    right: 24px;
    bottom: 32px;
  }

  .detail-modal {
    align-items: center;
  }

  .detail-modal-content {
    max-width: 480px;
    border-radius: 24px;
    max-height: 80vh;
    margin: 0 auto;
  }

  .search-container {
    max-width: 480px;
    left: 400px;
    transform: none;
    padding: 0 24px;
  }
}

/* ---------- Responsive: Large Desktop (>1024px) ---------- */
@media (min-width: 1025px) {
  .fab-container {
    right: 32px;
  }
}

/* ---------- Print ---------- */
@media print {
  .app-header,
  .search-container,
  .fab-container,
  .bottom-sheet,
  .detail-modal,
  .about-view,
  .toast,
  #map,
  .clear-route-btn {
    display: none !important;
  }
}

/* ---------- Clear Route Floating Button ---------- */
.clear-route-btn {
  position: fixed;
  top: 130px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 0.85rem;
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
  animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.clear-route-btn:hover {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.clear-route-btn:active {
  transform: translateX(-50%) scale(0.95);
}

.clear-route-btn .material-icons-round {
  font-size: 18px;
}

@keyframes slideDown {
  from {
    transform: translateX(-50%) translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

/* ---------- Leaflet Routing Machine Overrides ---------- */
.leaflet-routing-container {
  display: none !important;
}

/* Make sure default geocoder / itinerary container is hidden */
.leaflet-routing-geocoders {
  display: none !important;
}

/* ---------- List Group Headers ---------- */
.list-group-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  margin: 12px 0 10px 0;
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: var(--radius-sm);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.list-group-header.de-garde-header {
  color: var(--accent);
  background: rgba(59, 130, 246, 0.1);
  border-left: 4px solid var(--accent);
}

.list-group-header.other-header {
  color: var(--text-secondary);
  background: rgba(241, 245, 249, 0.95);
  border-left: 4px solid var(--text-secondary);
  margin-top: 20px;
}

.list-group-header .material-icons-round {
  font-size: 16px;
}
