/* =========================================================
   PAQARI INMOBILIARIA — Estilos Principales
   Mapa Competitivo – Proyecto Samay
   ========================================================= */

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  height: 100%;
}

body {
  font-family: var(--font-primary);
  font-weight: var(--font-weight-regular);
  color: var(--paqari-charcoal);
  background-color: var(--paqari-background);
  line-height: 1.5;
  overflow: hidden;
  overflow-x: hidden;
  /* 100% evita la barra horizontal fantasma que provoca 100vw
     cuando el navegador muestra scrollbar clásico. */
  height: 100%;
  width: 100%;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  font-size: inherit;
}

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

a:hover {
  color: var(--paqari-orange-dark);
}

/* ── App Layout ──────────────────────────────────────────── */
.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  /* dvh: compensa la barra de URL dinámica en iOS/Android */
  height: 100dvh;
  width: 100%;
  overflow: hidden;
}

.app__body {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

/* ── Header ──────────────────────────────────────────────── */
.header {
  display: flex;
  align-items: center;
  height: var(--header-height);
  padding: 0 var(--space-lg);
  background: var(--paqari-charcoal);
  color: var(--white);
  z-index: var(--z-header);
  flex-shrink: 0;
}

.header__logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-right: var(--space-xl);
  flex-shrink: 0;
}

.header__logo-img {
  height: 40px;
  width: auto;
  object-fit: contain;
}

.header__logo-fallback {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.header__logo-name {
  font-size: var(--text-md);
  font-weight: var(--font-weight-bold);
  color: var(--paqari-orange);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.header__logo-tagline {
  font-size: var(--text-xs);
  font-weight: var(--font-weight-medium);
  color: var(--paqari-gray-light);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.header__info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.header__title {
  font-size: var(--text-lg);
  font-weight: var(--font-weight-semibold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.3px;
}

.header__subtitle {
  font-size: var(--text-sm);
  color: var(--paqari-gray-light);
  font-weight: var(--font-weight-regular);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Map Container ───────────────────────────────────────── */
.map-wrapper {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

#map {
  width: 100%;
  height: 100%;
  z-index: var(--z-map);
  background-color: var(--paqari-light-gray);
}

.map-error {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  padding: var(--space-xl);
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-map-controls);
}

.map-error__icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-md);
}

.map-error__title {
  font-size: var(--text-lg);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--space-xs);
}

.map-error__message {
  font-size: var(--text-base);
  color: var(--paqari-gray);
}

/* ── Panel de Proyectos ──────────────────────────────────── */
.panel {
  position: absolute;
  top: var(--space-md);
  left: var(--space-md);
  width: var(--panel-width);
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-panel);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  /* Siempre visible sin importar la altura del viewport */
  max-height: calc(100vh - var(--header-height) - var(--space-xl));
  transition: transform var(--transition-base), opacity var(--transition-base);
}

.panel__header {
  padding: var(--space-md) var(--space-md) var(--space-sm);
  border-bottom: 1px solid var(--paqari-light-gray);
  flex-shrink: 0;
}

.panel__title {
  font-size: var(--text-sm);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--paqari-gray);
}

.panel__body {
  padding: var(--space-xs) var(--space-md);
  overflow-y: auto;
  flex: 0 0 auto; /* No crecer: alto fijo según contenido (5 items) */
}

.panel__footer {
  padding: var(--space-sm) var(--space-md) var(--space-md);
  border-top: 1px solid var(--paqari-light-gray);
  flex-shrink: 0;
}

/* ── Leyenda integrada en el panel ───────────────────────── */
.panel__legend {
  border-top: 1px solid var(--paqari-light-gray);
  flex: 1;          /* Ocupa el espacio disponible entre body y footer */
  min-height: 0;    /* Permite que flex reduzca la sección si poco espacio */
  overflow-y: auto;
}

.panel__legend-title {
  font-size: var(--text-xs);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--paqari-gray);
  padding: var(--space-sm) var(--space-md) var(--space-2xs);
}

.panel__legend-body {
  padding: 0 var(--space-md) var(--space-xs);
}

.panel__legend-body .legend__item {
  padding: var(--space-xs) 0;
}

.panel__legend-body .legend__item + .legend__item {
  border-top: 1px solid rgba(0,0,0,0.04);
}

.panel__legend-body .legend__number {
  width: 20px;
  height: 20px;
  font-size: 0.625rem;
}

.panel__legend-body .legend__name {
  font-size: var(--text-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--paqari-charcoal);
  line-height: 1.3;
}

.panel__legend-body .legend__name--reference {
  color: var(--paqari-orange-dark);
}

.panel__legend-body .legend__address {
  font-size: 0.6875rem;
  color: var(--paqari-gray);
  line-height: 1.4;
}

/* ── Checkbox Projects ───────────────────────────────────── */
.project-check {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) 0;
  cursor: pointer;
  transition: background-color var(--transition-fast);
  border-radius: var(--radius-sm);
  margin: 0 calc(-1 * var(--space-xs));
  padding-left: var(--space-xs);
  padding-right: var(--space-xs);
}

.project-check:hover {
  background-color: var(--paqari-orange-bg);
}

.project-check__input {
  width: 0;
  height: 0;
  opacity: 0;
  position: absolute;
}

.project-check__marker {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: var(--font-weight-bold);
  color: var(--white);
  flex-shrink: 0;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.project-check__marker--reference {
  background: var(--paqari-orange);
  box-shadow: 0 0 0 2px var(--white), 0 0 0 4px var(--paqari-orange-40);
}

.project-check__marker--competitor {
  background: var(--color-competitor);
  box-shadow: 0 0 0 2px var(--white);
}

.project-check__input:checked ~ .project-check__marker {
  transform: scale(1.05);
}

.project-check__input:not(:checked) ~ .project-check__marker {
  opacity: 0.4;
}

.project-check__input:not(:checked) ~ .project-check__label {
  opacity: 0.5;
  text-decoration: line-through;
  text-decoration-color: var(--paqari-gray-light);
}

.project-check__label {
  font-size: var(--text-base);
  font-weight: var(--font-weight-medium);
  color: var(--paqari-charcoal);
  cursor: pointer;
  transition: opacity var(--transition-fast);
  user-select: none;
  line-height: 1.3;
}

.project-check__label--reference {
  font-weight: var(--font-weight-semibold);
  color: var(--paqari-orange-dark);
}

/* ── Panel Buttons ───────────────────────────────────────── */
.panel__actions {
  display: flex;
  gap: var(--space-xs);
  flex-wrap: wrap;
  margin-bottom: var(--space-sm);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xs) var(--space-sm);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  min-height: 36px;
  gap: var(--space-2xs);
}

.btn--primary {
  background: var(--paqari-orange);
  color: var(--white);
}

.btn--primary:hover {
  background: var(--paqari-orange-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

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

.btn--secondary {
  background: var(--paqari-light-gray);
  color: var(--paqari-charcoal);
}

.btn--secondary:hover {
  background: #ddd9d3;
  transform: translateY(-1px);
}

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

.btn--outline {
  border: 1px solid var(--paqari-light-gray);
  color: var(--paqari-gray);
  background: var(--white);
}

.btn--outline:hover {
  border-color: var(--paqari-orange);
  color: var(--paqari-orange);
}

.btn--sm {
  padding: var(--space-2xs) var(--space-xs);
  font-size: var(--text-xs);
  min-height: 28px;
}

.btn--full {
  width: 100%;
}

.btn--icon {
  width: 36px;
  padding: 0;
}

/* ── Distance Toggle ─────────────────────────────────────── */
.distance-toggle {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) 0;
  cursor: pointer;
  margin-top: var(--space-2xs);
}

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

.distance-toggle__switch {
  width: 36px;
  height: 20px;
  border-radius: var(--radius-full);
  background: var(--paqari-light-gray);
  position: relative;
  transition: background var(--transition-fast);
  flex-shrink: 0;
}

.distance-toggle__switch::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: var(--radius-full);
  background: var(--white);
  top: 2px;
  left: 2px;
  transition: transform var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.distance-toggle__input:checked ~ .distance-toggle__switch {
  background: var(--paqari-orange);
}

.distance-toggle__input:checked ~ .distance-toggle__switch::after {
  transform: translateX(16px);
}

.distance-toggle__label {
  font-size: var(--text-sm);
  color: var(--paqari-gray);
  cursor: pointer;
  user-select: none;
}

/* ── Comparison Bar ──────────────────────────────────────── */
.comparison-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  height: var(--comparison-bar-height);
  padding: 0 var(--space-lg);
  background: var(--paqari-charcoal);
  color: var(--white);
  font-size: var(--text-sm);
  z-index: var(--z-comparison-bar);
  flex-shrink: 0;
  overflow: hidden;
  transition: height var(--transition-base), opacity var(--transition-base);
}

.comparison-bar--hidden {
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.comparison-bar__label {
  font-weight: var(--font-weight-medium);
  color: var(--paqari-gray-light);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: var(--text-xs);
  flex-shrink: 0;
}

.comparison-bar__projects {
  font-weight: var(--font-weight-semibold);
  color: var(--paqari-orange-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.comparison-bar__distance {
  font-weight: var(--font-weight-medium);
  color: var(--white);
  padding: var(--space-2xs) var(--space-xs);
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  white-space: nowrap;
  flex-shrink: 0;
}

.comparison-bar__arrow {
  color: var(--paqari-orange);
  font-weight: var(--font-weight-bold);
}

/* ── Legend ───────────────────────────────────────────────── */
.legend {
  position: absolute;
  bottom: var(--space-md);
  left: var(--space-md);
  max-width: var(--legend-max-width);
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-legend);
  overflow: hidden;
  max-height: 260px;
  transition: opacity var(--transition-base);
}

.legend__header {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--paqari-light-gray);
}

.legend__title {
  font-size: var(--text-xs);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--paqari-gray);
}

.legend__body {
  padding: var(--space-xs) var(--space-md);
  overflow-y: auto;
  max-height: 200px;
}

.legend__item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-xs);
  padding: var(--space-xs) 0;
}

.legend__item + .legend__item {
  border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.legend__number {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: var(--font-weight-bold);
  color: var(--white);
  flex-shrink: 0;
  margin-top: 1px;
}

.legend__number--reference {
  background: var(--paqari-orange);
}

.legend__number--competitor {
  background: var(--color-competitor);
}

.legend__info {
  min-width: 0;
}

.legend__name {
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--paqari-charcoal);
  line-height: 1.3;
}

.legend__name--reference {
  color: var(--paqari-orange-dark);
}

.legend__address {
  font-size: var(--text-xs);
  color: var(--paqari-gray);
  line-height: 1.4;
}

/* ── Summary Card ────────────────────────────────────────── */
.summary-card {
  position: absolute;
  top: var(--space-md);
  right: var(--space-md);
  width: 220px;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-summary);
  overflow: hidden;
  transition: opacity var(--transition-base), transform var(--transition-base);
}

.summary-card--hidden {
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
}

.summary-card__header {
  padding: var(--space-sm) var(--space-md);
  background: linear-gradient(135deg, var(--paqari-orange), var(--paqari-orange-dark));
  color: var(--white);
}

.summary-card__name {
  font-size: var(--text-base);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.5px;
}

.summary-card__type {
  font-size: var(--text-xs);
  opacity: 0.85;
  margin-top: 2px;
}

.summary-card__body {
  padding: var(--space-sm) var(--space-md);
}

.summary-card__stat {
  padding: var(--space-xs) 0;
}

.summary-card__stat + .summary-card__stat {
  border-top: 1px solid var(--paqari-light-gray);
}

.summary-card__stat-label {
  font-size: var(--text-xs);
  color: var(--paqari-gray);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.summary-card__stat-value {
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--paqari-charcoal);
}

.summary-card__stat-distance {
  font-size: var(--text-xs);
  color: var(--paqari-orange);
  font-weight: var(--font-weight-medium);
}

.summary-card__count {
  font-size: var(--text-sm);
  color: var(--paqari-charcoal);
}

.summary-card__count strong {
  color: var(--paqari-orange);
  font-weight: var(--font-weight-bold);
}

/* ── Custom Leaflet Markers ──────────────────────────────── */
.marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.marker__circle {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  font-weight: var(--font-weight-bold);
  color: var(--white);
  position: relative;
  transition: transform var(--transition-fast);
}

.marker__circle:hover {
  transform: scale(1.12);
}

/* Reference (SAMAY) marker */
.marker--reference .marker__circle {
  width: 40px;
  height: 40px;
  font-size: var(--text-md);
  background: linear-gradient(145deg, var(--paqari-orange), var(--paqari-orange-dark));
  border: 3px solid var(--white);
  box-shadow:
    0 0 0 3px var(--paqari-orange-40),
    0 4px 12px rgba(0, 0, 0, 0.20);
  animation: pulse-reference 2.5s ease-in-out infinite;
}

.marker--reference .marker__label {
  margin-top: 4px;
  font-size: var(--text-xs);
  font-weight: var(--font-weight-bold);
  color: var(--paqari-orange-dark);
  background: rgba(255, 255, 255, 0.92);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  letter-spacing: 0.5px;
  white-space: nowrap;
}

/* Competitor marker */
.marker--competitor .marker__circle {
  width: 30px;
  height: 30px;
  font-size: var(--text-sm);
  background: var(--color-competitor);
  border: 2.5px solid var(--white);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

@keyframes pulse-reference {
  0%, 100% {
    box-shadow:
      0 0 0 3px var(--paqari-orange-40),
      0 4px 12px rgba(0, 0, 0, 0.20);
  }
  50% {
    box-shadow:
      0 0 0 6px var(--paqari-orange-20),
      0 4px 12px rgba(0, 0, 0, 0.20);
  }
}

/* ── Distance Line Labels ────────────────────────────────── */
.distance-label {
  background: var(--color-line-label-bg);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--paqari-charcoal);
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--paqari-light-gray);
  pointer-events: none;
}

/* ── Leaflet Popup Override ──────────────────────────────── */
.leaflet-popup-content-wrapper {
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-xl) !important;
  padding: 0 !important;
  overflow: hidden;
}

.leaflet-popup-content {
  margin: 0 !important;
  min-width: 220px;
  font-family: var(--font-primary) !important;
}

.leaflet-popup-tip {
  box-shadow: var(--shadow-md) !important;
}

.popup {
  padding: 0;
}

.popup__header {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--paqari-light-gray);
}

.popup__header--reference {
  background: linear-gradient(135deg, var(--paqari-orange), var(--paqari-orange-dark));
  color: var(--white);
  border-bottom: none;
}

.popup__name {
  font-size: var(--text-base);
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.3px;
}

.popup__company {
  font-size: var(--text-sm);
  opacity: 0.8;
  margin-top: 2px;
}

.popup__body {
  padding: var(--space-sm) var(--space-md);
}

.popup__address {
  font-size: var(--text-sm);
  color: var(--paqari-gray);
  margin-bottom: var(--space-xs);
  line-height: 1.4;
}

.popup__type {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: var(--font-weight-medium);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-xs);
}

.popup__type--reference {
  background: var(--paqari-orange-bg);
  color: var(--paqari-orange-dark);
}

.popup__type--competitor {
  background: var(--color-competitor-bg);
  color: var(--color-competitor);
}

.popup__distance {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) 0;
  margin-top: var(--space-2xs);
  border-top: 1px solid var(--paqari-light-gray);
}

.popup__distance-label {
  font-size: var(--text-xs);
  color: var(--paqari-gray);
}

.popup__distance-value {
  font-size: var(--text-base);
  font-weight: var(--font-weight-bold);
  color: var(--paqari-orange);
}

.popup__footer {
  padding: var(--space-xs) var(--space-md) var(--space-sm);
}

.popup__gmaps-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  color: var(--paqari-orange);
  transition: color var(--transition-fast);
}

.popup__gmaps-link:hover {
  color: var(--paqari-orange-dark);
}

/* ── Leaflet Tooltip Override ────────────────────────────── */
.leaflet-tooltip {
  font-family: var(--font-primary) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-md) !important;
  padding: var(--space-xs) var(--space-sm) !important;
  border: 1px solid var(--paqari-light-gray) !important;
  font-size: var(--text-sm) !important;
  max-width: 220px;
}

.tooltip__name {
  font-weight: var(--font-weight-semibold);
  color: var(--paqari-charcoal);
  margin-bottom: 2px;
}

.tooltip__company {
  font-size: var(--text-xs);
  color: var(--paqari-gray);
}

.tooltip__distance {
  font-size: var(--text-xs);
  color: var(--paqari-orange);
  font-weight: var(--font-weight-medium);
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid var(--paqari-light-gray);
}

/* ── Mobile Bottom Sheet ─────────────────────────────────── */
.bottom-sheet-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: calc(var(--z-bottom-sheet) - 1);
  opacity: 0;
  /* Sin esto el overlay invisible sigue capturando los toques
     y el mapa queda muerto en móvil. */
  pointer-events: none;
  transition: opacity var(--transition-base);
}

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

.bottom-sheet {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: var(--z-bottom-sheet);
  background: var(--white);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
  transform: translateY(calc(100% - var(--bottom-sheet-peek)));
  transition: transform var(--transition-slow);
  max-height: 70vh;
}

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

.bottom-sheet__handle {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm) var(--space-md);
  cursor: pointer;
  gap: var(--space-xs);
}

.bottom-sheet__handle-bar {
  width: 36px;
  height: 4px;
  background: var(--paqari-light-gray);
  border-radius: var(--radius-full);
}

.bottom-sheet__handle-text {
  font-size: var(--text-base);
  font-weight: var(--font-weight-semibold);
  color: var(--paqari-charcoal);
}

.bottom-sheet__close {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-md);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  font-size: var(--text-lg);
  color: var(--paqari-gray);
  background: var(--paqari-light-gray);
  transition: background var(--transition-fast);
}

.bottom-sheet__close:hover {
  background: #ddd9d3;
}

.bottom-sheet__content {
  padding: 0 var(--space-md) var(--space-lg);
  overflow-y: auto;
  max-height: calc(70vh - 56px);
}

/* ── Leaflet Controls Override ───────────────────────────── */
.leaflet-control-zoom {
  border: none !important;
  box-shadow: var(--shadow-md) !important;
  border-radius: var(--radius-md) !important;
  overflow: hidden;
}

.leaflet-control-zoom a {
  width: 36px !important;
  height: 36px !important;
  line-height: 36px !important;
  font-size: var(--text-lg) !important;
  color: var(--paqari-charcoal) !important;
  background: var(--white) !important;
  border-bottom: 1px solid var(--paqari-light-gray) !important;
  transition: background var(--transition-fast) !important;
}

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

.leaflet-control-zoom a:last-child {
  border-bottom: none !important;
}

/* ── Scrollbar ───────────────────────────────────────────── */
.panel__body::-webkit-scrollbar,
.legend__body::-webkit-scrollbar,
.bottom-sheet__content::-webkit-scrollbar {
  width: 4px;
}

.panel__body::-webkit-scrollbar-track,
.legend__body::-webkit-scrollbar-track,
.bottom-sheet__content::-webkit-scrollbar-track {
  background: transparent;
}

.panel__body::-webkit-scrollbar-thumb,
.legend__body::-webkit-scrollbar-thumb,
.bottom-sheet__content::-webkit-scrollbar-thumb {
  background: var(--paqari-light-gray);
  border-radius: var(--radius-full);
}

/* ── Foco visible (WCAG 2.4.7) ───────────────────────────── */
:where(button, a, [tabindex]):focus-visible {
  outline: 2px solid var(--paqari-orange);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.header :where(button, a, [tabindex]):focus-visible {
  outline-color: var(--paqari-orange-light);
}

/* Los inputs están visualmente ocultos: el anillo de foco
   se dibuja sobre el <label> contenedor. */
.project-check__input:focus-visible ~ .project-check__marker,
.distance-toggle__input:focus-visible ~ .distance-toggle__switch {
  outline: 2px solid var(--paqari-orange);
  outline-offset: 3px;
}

.project-check:focus-within {
  background-color: var(--paqari-orange-bg);
}

/* ── Utility ─────────────────────────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
