/* ═══════════════════════════════════════════════════════════════
   IRON ROUTE GPS — BUTTON TOGGLE STATES (T6.5/T2)
   Global pressed/unpressed state visibility for all map toggles.
   Targets: aria-pressed="true" + .is-pressed + .active toggle buttons.
   Brand B: navy + gold accent.
   ═══════════════════════════════════════════════════════════════ */

/* ── 1. Universal pressed visual state ───────────────────────────── */
button[aria-pressed="true"],
.is-pressed,
.toggle-on {
  background: linear-gradient(135deg, #D4A84B, #B89438) !important;
  color: #030D1C !important;
  box-shadow:
    inset 0 0 0 2px rgba(212,168,75,0.85),
    0 0 14px rgba(212,168,75,0.35) !important;
  position: relative;
  transition: background .15s ease-out,
              box-shadow .15s ease-out,
              transform .15s ease-out !important;
}

/* Checkmark badge for pressed buttons (top-right corner) */
button[aria-pressed="true"]::after,
.is-pressed::after,
.toggle-on::after {
  content: "\2713";   /* ✓ */
  position: absolute;
  top: 2px; right: 2px;
  width: 14px; height: 14px;
  background: #030D1C;
  color: #D4A84B;
  font-size: 10px; font-weight: 700;
  line-height: 14px;
  text-align: center;
  border-radius: 50%;
  border: 1px solid #D4A84B;
  pointer-events: none;
  font-family: system-ui, sans-serif;
}

/* ── 2. Map control buttons (right side stack) ───────────────────── */
.map-ctrl-btn[aria-pressed="true"] {
  border: 2px solid #D4A84B !important;
}
.map-ctrl-btn:active {
  transform: scale(0.92);
  transition: transform 0.08s ease-out !important;
}

/* ── 3. Theme + Lang + Unit pickers (settings) ───────────────────── */
.theme-option.active,
.lang-option.active,
.theme-option[aria-checked="true"],
.lang-option[aria-checked="true"] {
  background: linear-gradient(135deg, #D4A84B, #B89438) !important;
  color: #030D1C !important;
  font-weight: 700 !important;
  box-shadow: inset 0 0 0 2px rgba(212,168,75,0.85) !important;
}

/* ── 4. Bottom-nav active tab (clear pressed state) ──────────────── */
.nav-tab.active,
.nav-tab[aria-selected="true"] {
  color: #D4A84B !important;
  position: relative;
}
.nav-tab.active::before,
.nav-tab[aria-selected="true"]::before {
  content: "";
  position: absolute;
  top: 0; left: 50%; transform: translateX(-50%);
  width: 32px; height: 3px;
  background: #D4A84B;
  border-radius: 0 0 3px 3px;
  pointer-events: none;
}

/* ── 5. Trip planner toggle options (avoid tolls/highways) ───────── */
.toggle-option input[type="checkbox"]:checked + .toggle-slider {
  background: #D4A84B !important;
  box-shadow: 0 0 8px rgba(212,168,75,0.45) !important;
}

/* ── 6. Quick tile pressed feedback ──────────────────────────────── */
.tile:active {
  transform: scale(0.92);
  transition: transform 0.08s ease-out !important;
}
.tile[aria-pressed="true"] {
  background: rgba(212,168,75,0.15) !important;
  border: 2px solid #D4A84B !important;
}

/* ── 7. Voice / traffic / compass (R2 floating buttons) ──────────── */
.ir-traffic-btn[aria-pressed="true"],
.ir-compass-btn[aria-pressed="true"] {
  background: linear-gradient(135deg, #D4A84B, #B89438) !important;
  color: #030D1C !important;
}

/* ── 8. Generic .active fallback for any toggle-able button ──────── */
button.active:not(.btn-primary):not(.fab):not(.tile) {
  background: linear-gradient(135deg, #D4A84B, #B89438);
  color: #030D1C;
}

/* ── 9. Remove sticky :hover state on touch devices (iOS Safari fix) */
@media (hover: none) and (pointer: coarse) {
  button:hover {
    background: inherit !important;
    transform: none !important;
  }
  button:active {
    transition: transform 0.06s ease-out !important;
    transform: scale(0.94) !important;
  }
}

/* ── 10. Reduced motion respect ──────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  button[aria-pressed="true"],
  .is-pressed,
  .toggle-on {
    transition: none !important;
  }
}
