/* =========================================
   SIDEBAR DE FILTROS (por marca)
   Usa las mismas variables de color que style.css:
   --brand-dark, --brand-blue, --brand-accent
   ========================================= */

.catalogo-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 30px;
  width: 100%;
  align-items: start;
}

/* --- TARJETA DE LA SIDEBAR --- */
.sidebar-filtros {
  background-color: #ffffff;
  border-radius: 20px;
  padding: 25px 20px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  border: 1px solid #f0f0f0;
  position: sticky;
  top: 20px;
}

.sidebar-filtros-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #f0f0f0;
}

.sidebar-filtros-header h3 {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--brand-dark);
  margin: 0;
}

.btn-limpiar-filtros {
  background: none;
  border: none;
  color: var(--brand-blue);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  opacity: 0.75;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.btn-limpiar-filtros:hover {
  opacity: 1;
  color: var(--brand-accent);
}

/* --- LISTA DE MARCAS --- */
.lista-checkboxes-marca {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 6px;
}

.lista-checkboxes-marca::-webkit-scrollbar {
  width: 5px;
}
.lista-checkboxes-marca::-webkit-scrollbar-thumb {
  background-color: var(--brand-accent);
  border-radius: 10px;
}
.lista-checkboxes-marca::-webkit-scrollbar-track {
  background: transparent;
}

.checkbox-marca {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  user-select: none;
}

.checkbox-marca:hover {
  background-color: #f6f6f6;
}

/* Ocultamos el checkbox nativo, armamos uno propio con el mismo estilo del sitio */
.checkbox-marca input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkbox-custom {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 2px solid #ddd;
  background-color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.checkbox-custom::after {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background-color: var(--brand-accent);
  transform: scale(0);
  transition: transform 0.15s ease;
}

.checkbox-marca input[type="checkbox"]:checked + .checkbox-custom {
  border-color: var(--brand-accent);
}

.checkbox-marca input[type="checkbox"]:checked + .checkbox-custom::after {
  transform: scale(1);
}

.checkbox-marca input[type="checkbox"]:focus-visible + .checkbox-custom {
  box-shadow: 0 0 0 3px rgba(255, 152, 0, 0.25);
}

.checkbox-label-text {
  font-size: 0.9rem;
  color: #333;
  line-height: 1.3;
}

/* --- BOTÓN "FILTROS" (solo mobile) --- */
.btn-toggle-filtros-mobile {
  display: none;
  align-items: center;
  gap: 8px;
  background-color: var(--brand-dark);
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 30px;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 20px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.btn-toggle-filtros-mobile:hover {
  background-color: var(--brand-blue);
}

.filtros-badge-count {
  background-color: var(--brand-accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

.filtros-badge-count.visible {
  display: inline-flex;
}

/* --- MENSAJE "SIN RESULTADOS" --- */
.sin-resultados {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: #888;
  font-size: 1rem;
}

/* --- BARRA DE ORDEN (por precio) --- */
.catalogo-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 20px;
}

.catalogo-toolbar label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #555;
}

.orden-precio {
  padding: 8px 14px;
  border-radius: 30px;
  border: 1px solid #ddd;
  background-color: #fff;
  color: var(--brand-dark);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.orden-precio:hover,
.orden-precio:focus {
  border-color: var(--brand-accent);
  outline: none;
}

/* =========================================
   RESPONSIVE MOBILE: la sidebar se convierte
   en un panel deslizable desde la izquierda
   ========================================= */
@media (max-width: 900px) {
  .catalogo-layout {
    grid-template-columns: 1fr;
    padding: 0 15px;
  }

  .btn-toggle-filtros-mobile {
    display: inline-flex;
  }

  .sidebar-filtros {
    position: fixed;
    top: 0;
    left: -100%;
    height: 100vh;
    width: 82%;
    max-width: 320px;
    z-index: 1100;
    border-radius: 0;
    overflow-y: auto;
    transition: left 0.3s ease;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.25);
  }

  .sidebar-filtros.active {
    left: 0;
  }

  .sidebar-filtros-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1099;
  }

  .sidebar-filtros-overlay.active {
    display: block;
  }

  .lista-checkboxes-marca {
    max-height: none;
  }
}