/* capas.css — Filters ("Filtros") pill + layers bottom sheet
   Colors come from the central palette in /styles.css (--vv-*). */

/* Pill button — only visible on mobile */
.vv-capas-pill {
  display: none;
}

@media (max-width: 767px) {
  .vv-capas-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 80px;
    left: 10px;
    z-index: 3;
    padding: 8px 14px;
    background: var(--vv-surface);
    border: 2px solid var(--vv-border-control);
    border-radius: 20px;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--vv-text);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    min-height: 40px;
    white-space: nowrap;
  }

  .vv-capas-pill.vv-capas-pill--highlight {
    background: var(--vv-accent);
    border-color: var(--vv-accent);
    color: white;
  }

  /* Hide when search is active or OD planner is open */
  body.vv-search-active-mobile .vv-capas-pill,
  body.vv-od-open .vv-capas-pill {
    opacity: 0;
    pointer-events: none;
  }

  /* Hide on non-map tabs and in planner detalle state */
  body.vv-tab-overlay .vv-capas-pill,
  body.vv-pl-detalle-open .vv-capas-pill {
    display: none;
  }
}

/* Sheet content */
.vv-capas-content {
  padding: 0 0 16px;
}

.vv-capas-header {
  padding: 4px 20px 12px;
  border-bottom: 1px solid var(--vv-border);
}

.vv-capas-title {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--vv-text);
}

.vv-capas-group {
  padding: 12px 0 0;
}

.vv-capas-group-title {
  padding: 0 20px 8px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--vv-text-2);
}

.vv-capas-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  gap: 12px;
  cursor: pointer;
  border-top: 1px solid var(--vv-border);
  position: relative;
}

.vv-capas-row--disabled {
  cursor: default;
  opacity: 0.5;
}

.vv-capas-row-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.vv-capas-row-name {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--vv-text);
}

.vv-capas-row-sub {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 12px;
  color: var(--vv-text-2);
}

.vv-capas-row-soon {
  color: var(--vv-text-2);
}

/* Toggle switch
   DOM order inside label: input → .vv-capas-row-info → .vv-capas-toggle-track
   Use ~ (general sibling) to skip the info div between input and track. */

.vv-capas-toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.vv-capas-toggle-track {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 26px;
  background: var(--vv-muted);
  border-radius: 13px;
  flex-shrink: 0;
  transition: background 0.2s ease;
}

.vv-capas-toggle-track--off {
  background: var(--vv-muted); /* disabled rows — always off color */
}

.vv-capas-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: left 0.2s ease;
}

/* ~ skips the .vv-capas-row-info div between the input and the track */
.vv-capas-toggle-input:checked ~ .vv-capas-toggle-track {
  background: var(--vv-accent);
}

.vv-capas-toggle-input:checked ~ .vv-capas-toggle-track .vv-capas-toggle-thumb {
  left: calc(100% - 23px);
}
