/* ============================
   PANEL DE FILTROS (MODAL CENTRADO ELEGANTE)
============================ */
.filter-card {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 420px;

  height: 50vh;         /* 🔹 fijo a la mitad de la pantalla */
  max-height: 50vh;     /* 🔹 asegura que no crezca más */
  overflow-y: auto;     /* 🔹 scroll si hay muchos filtros */

  /* 🎨 Glassmorphism */
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  color: var(--text);
  border-radius: 20px 20px 0 0;
  padding: 20px 18px 50px; /* espacio para botón */
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.25);

  animation: slideUp 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  transition: background 0.3s, color 0.3s;
}

/* 🌑 Versión oscura */
body.dark .filter-card {
  background: rgba(20, 20, 20, 0.85);
  color: var(--text-dark);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.9);
}

/* ============================
   ANIMACIÓN SOLO VERTICAL
============================ */
@keyframes slideUp {
  from { transform: translate(-50%, 100%); }  /* 👈 mantiene centrado en X */
  to   { transform: translate(-50%, 0); }     /* 👈 ya centrado */
}
/* ============================
   CABECERA
============================ */
.drag-indicator {
  width: 50px;
  height: 5px;
  background: rgba(0,0,0,0.25);
  border-radius: 4px;
  margin: 10px auto 16px;
}
body.dark .drag-indicator {
  background: rgba(255,255,255,0.25);
}

.filter-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}
.filter-card h3::before {
  content: "✨";
  font-size: 18px;
}

/* ============================
   FILAS DE FILTRO
============================ */
.filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 12px;
  margin-bottom: 12px;
  transition: background 0.2s, border 0.2s;
}
body.dark .filter-row {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border-dark);
}
.filter-row:hover {
  background: rgba(255, 152, 0, 0.1);
  border-color: var(--primary);
}

.filter-row .icon {
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  padding: 8px;
  border-radius: 10px;
}

/* 🔹 Fix para selects */
.filter-row select {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  padding: 6px 8px;
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text);
  appearance: none; /* quitar estilo nativo */
}
body.dark .filter-row select {
  background: var(--bg-input-dark);
  color: var(--text-dark);
}

/* Opciones internas */
.filter-row select option {
  background: #fff;
  color: #000;
}
body.dark .filter-row select option {
  background: #1e1e1e;
  color: #f5f5f5;
}

/* ============================
   BUSCADOR
============================ */
.filter-search {
  display: flex;
  align-items: center;
  margin: 14px 0 20px;
}
.filter-search input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 12px;
  border: 2px solid var(--primary);
  background: var(--bg-input);
  color: var(--text);
  transition: 0.3s;
}
body.dark .filter-search input {
  background: var(--bg-input-dark);
  color: var(--text-dark);
}
.filter-search input:focus {
  border-color: var(--primary-dark);
  box-shadow: 0 0 6px rgba(255,152,0,0.4);
}
.filter-search button {
  margin-left: 8px;
  padding: 10px 14px;
  border: none;
  border-radius: 12px;
  background: var(--primary-dark);
  color: #fff;
  cursor: pointer;
  transition: 0.3s;
}
.filter-search button:hover {
  background: var(--primary);
}

/* ============================
   BOTÓN APLICAR
============================ */
.apply-btn {
  display: none;
  position: fixed;
  bottom: 0;
  left: 50%;                     /* lo centra */
  transform: translateX(-50%);   /* corrección al centro */
  width: 90%;                    /* ancho relativo al modal */
  max-width: 420px;              /* igual que el modal */
  
  padding: 16px;
  font-size: 16px;
  font-weight: bold;
  border: none;
  background: linear-gradient(135deg, var(--success), var(--success-dark));
  color: white;
  cursor: pointer;
  z-index: 3000;
  border-radius: 0 0 12px 12px;   /* esquinas redondeadas abajo */
  box-shadow: 0 -4px 14px rgba(0,0,0,0.4);
  transition: background 0.3s;
}
.apply-btn:hover {
  background: linear-gradient(135deg, #66bb6a, #388e3c);
}

.filter-card.active + .apply-btn {
  display: block; /* aparece cuando el modal está activo */
}

/* ============================
   MÁS FILTROS (sticky dentro del modal)
============================ */
.more-filters {
  position: sticky;              
  bottom: 0;               
  margin-top: 5px;              
  left: 0;
  width: 100%;
  text-align: center;
  font-size: 13px;
  font-weight: bold;
  color: var(--primary);
  background: linear-gradient(to top, rgba(0,0,0,0.08) 60%, transparent);
  padding: 8px 0;
  cursor: pointer;
  transition: opacity 0.3s;
  z-index: 2;
}

.more-filters.hidden {
  opacity: 0;
  pointer-events: none;
}