/* =======================================
   VELVET — ADVANCED MODAL
   ======================================= */

/* Backdrop */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
  z-index: 9998;
}
.modal-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

/* Modal Window */
.advanced-modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) scale(.96);
  width: min(1080px, 94vw);
  height: min(82vh, 740px);
  display: none;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid rgba(212,175,55,.3);
  border-radius: 18px;
  box-shadow: 0 18px 48px rgba(0,0,0,.65),
              inset 0 1px 0 rgba(255,255,255,.04);
  z-index: 9999;
  overflow: hidden;
  transition: all .25s ease;
}
.advanced-modal.show {
  display: flex;
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

/* ===============================
   HEADER & FOOTER
   =============================== */
.advanced-modal .modal-header {
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: .5px;
}
.advanced-modal .modal-header h2 {
  font-size: 1.1rem;
  margin: 0;
}
.advanced-modal .close-btn {
  font-size: 1.6rem;
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  transition: color .2s ease;
}
.advanced-modal .close-btn:hover {
  color: var(--gold);
}

.advanced-modal .modal-footer {
  border-top: 1px solid rgba(255,255,255,.06);
  padding: 12px 18px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}
.advanced-modal .modal-footer button {
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all .25s ease;
}
#clear-all {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
}
#clear-all:hover {
  background: var(--hover);
}
#apply-all {
  border: none;
  background: var(--gold);
  color: var(--black);
  box-shadow: 0 0 0 transparent;
}
#apply-all:hover {
  background: var(--gradient-gold);
  box-shadow: 0 0 12px rgba(212,175,55,.45);
  transform: translateY(-2px);
}

/* ===============================
   BODY & NAVIGATION
   =============================== */
.modal-body {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr;
  min-height: 0;
}

.filter-nav {
  background: var(--surface-2);
  border-right: 1px solid rgba(255,255,255,.06);
  padding: 12px 0;
  overflow-y: auto;
}
.filter-nav ul { margin: 0; padding: 0; list-style: none; }
.filter-nav li {
  padding: 12px 18px;
  cursor: pointer;
  transition: all .2s ease;
  border-radius: 8px;
  margin: 4px 10px;
  color: var(--text);
  font-size: 0.95rem;
}
.filter-nav li:hover {
  background: rgba(212,175,55,.1);
  color: var(--gold);
}
.filter-nav li.active {
  background: var(--gold);
  color: var(--black);
  font-weight: 600;
  width: 130%;
}

.filters-scroll {
  overflow-y: auto;
  padding: 16px 20px;
}
.filter-section {
  padding-bottom: 18px;
  border-bottom: 1px dashed rgba(255,255,255,.08);
  margin-bottom: 20px;
}
.filter-section h3 {
  font-size: 1.05rem;
  color: var(--gold);
  margin-bottom: 10px;
}
.filter-section h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 14px 0 8px;
  color: var(--text-strong);
}

/* ===============================
   FILTER CHIPS
   =============================== */
.filter-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 14px;
  margin: 6px 8px 6px 0;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(212,175,55,.35);
  border-radius: 999px;
  cursor: pointer;
  transition: all .25s ease;
}
.filter-chip:hover {
  background: var(--gold);
  color: var(--black);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(212,175,55,.35);
}
.filter-chip.active {
  background: var(--gradient-gold);
  border-color: var(--gold);
  color: var(--black);
  font-weight: 600;
  transform: scale(1.05);
  box-shadow: 0 0 12px rgba(212,175,55,.45);
}

/* ===============================
   RANGE SLIDERS
   =============================== */
.range-wrap {
  position: relative;
  margin: 10px 0 20px;
}
.range-track {
  position: absolute;
  left: 8px; right: 8px;
  top: 50%;
  height: 4px;
  background: rgba(255,255,255,.1);
  border-radius: 999px;
  transform: translateY(-50%);
}
.range-fill {
  position: absolute;
  top: 50%;
  height: 4px;
  background: var(--gold);
  border-radius: 999px;
  transform: translateY(-50%);
}
.range-values {
  font-size: 0.85rem;
  margin-top: -25px;
  color: var(--text-light);
}

/* ===============================
   RESPONSIVE (MOBILE)
   =============================== */
@media (max-width: 768px) {
  .advanced-modal {
    top: auto; left: 0; right: 0; bottom: 0;
    transform: translateY(100%);
    width: 100%;
    height: 90dvh;
    border-radius: 20px 20px 0 0;
  }
  .advanced-modal.show {
    transform: translateY(0);
  }
  .modal-body {
    grid-template-columns:220px 1fr;
    grid-template-rows: auto 1fr;
  }
  .filter-nav {
    display: flex;
    width: 60%;
    flex-direction: row;
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,.06);
  }
  .filter-nav li {
    flex: 1;
    text-align: center;
    margin: 0;
    padding: 12px 6px;
    border-radius: 0;
  }
}

.modal-body {
  flex: 1;
  display: grid;
  grid-template-columns: 0px 1fr; /* sidebar + conteúdo */
  min-height: 0;
}

.filter-nav {
  background: var(--surface-2);
  border-right: 1px solid rgba(255,255,255,.06);
  overflow-y: auto;
}

.filters-scroll {
  overflow-y: auto;
  padding: 16px 20px;
}

/* ==== Dual Range Refinado (Velvet Style) ==== */
.range-wrap {
  position: relative;
  margin: 12px 0 26px;
  height: 32px;
}

.range-track {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: 8px;
  right: 8px;
  height: 5px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(212,175,55,0.25);
  border-radius: 999px;
}

.range-fill {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 5px;
  background: linear-gradient(90deg, rgba(212,175,55,0.6), rgba(255,215,0,0.8));
  border-radius: 999px;
  box-shadow: 0 0 8px rgba(212,175,55,0.4);
}

.range-wrap input[type="range"] {
  -webkit-appearance: none;
  position: absolute;
  width: 100%;
  background: transparent;
  pointer-events: none; /* evita clique entre os thumbs */
}

.range-wrap input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  pointer-events: auto;
  width: 18px;
  height: 18px;
  background: var(--gold);
  border: 2px solid #000;
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(212,175,55,0.6);
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease;
}

.range-wrap input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 0 14px rgba(212,175,55,0.8);
}

.range-values {
  position: relative;
  z-index: 5;                 /* Garante que fique acima do slider */
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gold);
  margin-top: -25px;           /* Aproxima do slider */
  margin-bottom: 4px;
  text-shadow: 0 0 6px rgba(212,175,55,0.6); /* Glow dourado suave para melhor leitura */
}

.toggle-group {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 10px 0 20px;
}

.toggle {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}

.toggle input {
  display: none;
}

.toggle .slider {
  width: 42px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid rgba(212,175,55,.3);
  position: relative;
  transition: all .25s ease;
}

.toggle .slider::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #aaa;
  transition: all .25s ease;
}

.toggle input:checked + .slider {
  background: var(--gold);
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(212,175,55,.5);
}

.toggle input:checked + .slider::after {
  left: 22px;
  background: var(--black);
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  margin: 4px;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 999px;
  border: 1px solid rgba(212, 175, 55, 0.4);
  background: rgba(255, 255, 255, 0.05);
  color: #ddd;
  cursor: pointer;
  transition: all 0.25s ease;
}

.filter-chip:hover {
  background: rgba(212, 175, 55, 0.12);
  border-color: var(--gold);
  box-shadow: 0 0 6px rgba(212, 175, 55, 0.5);
}

.filter-chip.active {
  background: linear-gradient(135deg, #d4af37, #cfa349);
  color: #000;
  border-color: #d4af37;
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.7);
  font-weight: 600;
}

/* Container estilizado */
.filter-search {
  width: 100%;
  border: 1px solid rgba(212,175,55,0.25);
  border-radius: 12px;
  padding: 10px 14px;
  margin: 8px 0 16px;
  background: rgba(255,255,255,0.03);
  display: flex;
  align-items: center;
}

/* Remove completamente o estilo visual do input */
.filter-search input {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  color: var(--gold) !important;
  font-size: 0.95rem;
}

/* Placeholder suave e elegante */
.filter-search input::placeholder {
  color: rgba(212,175,55,0.35) !important;
}
/* Container estilizado */
.filter-search {
  width: 100%;
  border: 1px solid rgba(212,175,55,0.25);
  border-radius: 12px;
  padding: 10px 14px;
  margin: 8px 0 16px;
  background: rgba(255,255,255,0.03);
  display: flex;
  align-items: center;
}

/* Remove completamente o estilo visual do input */
.filter-search input {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  color: var(--gold) !important;
  font-size: 0.95rem;
}

/* Placeholder suave e elegante */
.filter-search input::placeholder {
  color: rgba(212,175,55,0.35) !important;
}
.filter-search {
  width: 100%;
  padding: 12px 16px;
  margin: 10px 0 16px;
  font-size: 0.95rem;
  font-weight: 500;
  color: #f5f5f5;

  /* estilo Velvet */
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(212,175,55,0.35);
  border-radius: 12px;

  /* remove estilo nativo */
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  outline: none;
  transition: all 0.3s ease;
}

.filter-search::placeholder {
  color: rgba(212,175,55,0.6);
  font-style: italic;
}

.filter-search:focus {
  border-color: var(--gold);
  background: rgba(0,0,0,0.7);
  box-shadow: 0 0 10px rgba(212,175,55,0.5);
}
/* Toggle estilo iOS Velvet Gold */
.filter-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  margin: 6px 0;
  font-size: 0.9rem;
  color: var(--gold-2);
  user-select: none;
}

.filter-toggle input {
  display: none;
}

.toggle-slider {
  position: relative;
  width: 42px;
  height: 22px;
  background: #444;
  border-radius: 999px;
  transition: background 0.3s;
}

.toggle-slider::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #aaa;
  box-shadow: 0 0 6px rgba(0,0,0,0.4);
  transition: transform 0.3s, background 0.3s, box-shadow 0.3s;
}

.filter-toggle input:checked + .toggle-slider {
  background: linear-gradient(135deg, var(--gold-1), var(--gold-3));
  box-shadow: 0 0 8px var(--gold-2);
}

.filter-toggle input:checked + .toggle-slider::before {
  transform: translateX(20px);
  background: #fff8dc;
  box-shadow: 0 0 6px var(--gold-2);
}

/* iOS Gold Toggle */
.filter-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
  cursor: pointer;
  font-size: 0.9rem;
  color: #d4af37; /* dourado */
}

.filter-toggle input {
  display: none;
}

.toggle-slider {
  position: relative;
  width: 40px;
  height: 20px;
  background: #333;
  border-radius: 999px;
  transition: background 0.3s ease;
}

.toggle-slider::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #aaa;
  transition: transform 0.3s, background 0.3s;
}

.filter-toggle input:checked + .toggle-slider {
  background: linear-gradient(135deg, #cfa349, #f0ca32);
}

.filter-toggle input:checked + .toggle-slider::before {
  transform: translateX(20px);
  background: #fff8dc;
}

.filter-toggle input { display:none; }
.filter-toggle .toggle-vis {
  width:32px;height:18px;border-radius:20px;background:#555;position:relative;
  transition:.2s;
}
.filter-toggle.is-on .toggle-vis { background:gold; }
.filter-toggle .toggle-vis::after {
  content:""; position:absolute; top:2px; left:2px;
  width:14px;height:14px;border-radius:50%;background:white;
  transition:.2s;
}
.filter-toggle.is-on .toggle-vis::after { left:16px; }

/* Base toggle container */
.toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

/* Hide the native checkbox */
.toggle input {
  display: none;
}

/* Slider (iOS style) */
.toggle .slider {
  width: 32px;
  height: 18px;
  background: #444;
  border-radius: 20px;
  position: relative;
  transition: background 0.2s ease;
}

/* Knob */
.toggle .slider::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ccc;
  top: 2px;
  left: 2px;
  transition: left 0.2s ease, background 0.2s ease;
}

/* Active state */
.toggle input:checked + .slider {
  background: #d4af37; /* Gold */
}

.toggle input:checked + .slider::after {
  left: 16px;
  background: white;
}

/* Optional: Highlight label when active */
.toggle input:checked ~ span,
.toggle input:checked ~ label {
  color: #d4af37;
}

/* ===== DISTANCE MODAL ===== */
.distance-modal {
  position: fixed;         /* ✅ garante que fica acima de tudo */
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 440px;
  background: #0f0f0f;
  border: 1px solid rgba(212,175,55,0.3);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  z-index: 9999;          /* ✅ garante que fica na frente */
  display: none;
}

.distance-modal.show {
  display: flex;
}

.distance-icon {
  width: 258px;
  height: 258px;

  margin-bottom: 20px;
}

.distance-text {
  font-size: 1rem;
  margin-bottom: 20px;
}

.distance-modal .enable-location {
  background: var(--gold);
  color: #000;
  border: none;
  padding: 12px 20px;
  border-radius: 10px;
  cursor: pointer;
}

/* ✅ MOBILE: vira modal de baixo */
@media (max-width: 768px) {
  .distance-modal {
    width: 100%;
    bottom: 0;
    top: auto;
    left: 0;
    transform: none;
    border-radius: 20px 20px 0 0;
  }
}

.distance-body {
    justify-content: center;
    align-items: center;
    text-align: center;
    display: flex;
    flex-direction: column;
}