:root { 
  --header-h: 64px; /* Altura del navbar */
  --sidebar-w: 280px; 
  --stack-gap: 16px; /* espacio entre navbar y contenido */
  --max-width: 1200px; /* Ancho máximo del contenido */
}

/* ======= Contenedor full-bleed y en 2 columnas: sidebar | contenido ======= */
.jz-catalogo {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  gap: 24px;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  padding: 0 16px;  /* No más margen superior, lo ajustamos más abajo */
  box-sizing: border-box;
  margin-top: var(--header-h); /* Añadimos margen superior igual a la altura del navbar */
}

/* Sidebar pegado + sticky (no pisa footer) */
.jz-sidebar {
  position: sticky;
  top: calc(var(--header-h) + 12px);
  align-self: start;
  max-height: calc(100vh - var(--header-h) - 30px);
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  padding: 14px;
  margin: 0;
}

/* Ocultar barra de scroll, mantener desplazamiento */
.jz-sidebar::-webkit-scrollbar { width: 0; height: 0; }
.jz-sidebar { scrollbar-width: none; -ms-overflow-style: none; }

/* Columna de productos a la derecha */
.jz-content {
  max-width: var(--max-width);
  width: 100%;
  justify-self: center;
  padding-top: 8px;
}

/* UI - Grupo, Títulos y Botones */
.group { margin-bottom: 16px; padding-top: 8px; border-top: 1px dashed #e5e5e5; }
.group:first-child { border-top: none; padding-top: 0; }
h4 { font-size: 15px; margin: 6px 0; }
label { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-size: 14px; cursor: pointer; }
.row { display: flex; align-items: center; gap: 8px; }
input[type="number"] { width: 110px; padding: 6px 8px; border: 1px solid #ddd; border-radius: 6px; }

.btns { display: flex; gap: 8px; margin-top: 12px; }
.btn { border: 1px solid #ddd; background: #fff; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.btn.primary { background: #111; color: #fff; border-color: #111; }
.btn-clear { text-decoration: none; color: #000000; font-weight: 500; }
.btn-clear:hover { text-decoration: underline; }

.muted { color: #888; font-size: 13px; }

.radio-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.radio-pill { background: #f7f7f7; border: 1px solid #eee; border-radius: 999px; padding: 6px 10px; }
.radio-pill input { margin-right: 6px; }
.radio-pill em { font-style: normal; color: #666; }

.or { font-size: 12px; color: #888; margin: 6px 0; }

/* ===== Topbar (count | search | ordenar) ===== */
.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;   /* izquierda: conteo | centro: búsqueda | derecha: ordenar */
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
  padding: 0 4px;
}
.topbar .count { font-size: 14px; color: #555; }

.jz-search { position: relative; }
.jz-search input {
  width: 100%;
  padding: 10px 44px 10px 12px;
  border: 1px solid #ddd;
  border-radius: 12px;
  background: #fff;
}
.jz-search button {
  position: absolute;
  right: 6px; top: 50%; transform: translateY(-50%);
  border: 0;
  border-radius: 8px;
  padding: 8px 10px;
  background: #111; color: #fff; cursor: pointer;
}

/* Select de Ordenar */
.topbar select { padding: 6px 10px; border: 1px solid #ddd; border-radius: 8px; }

/* Evitar scroll horizontal */
html, body { overflow-x: hidden; }

/* ======== RESPONSIVE ======== */

/* Pantallas grandes y tablets: Ajustes */
@media (max-width: 980px) {
  .jz-catalogo { grid-template-columns: 1fr; margin-left: 0; width: 100%; }
  .jz-sidebar { position: static; max-height: none; overflow: visible; margin-bottom: 16px; }
  .jz-content { max-width: 100%; justify-self: stretch; padding: 0 12px; }
  .topbar { grid-template-columns: 1fr; gap: 10px; } /* búsqueda arriba; ordenar abajo */
}

/* Móviles: Ajuste de Sidebar y Contenido */
@media (max-width: 600px) {
  .jz-catalogo {
    padding: 0 12px;
    margin-top: var(--header-h); /* Añadido margen superior para móviles */
  }
  .jz-sidebar {
    position: static;
    margin-bottom: 16px;
    max-height: none;
    overflow: visible;
  }
  .jz-content {
    width: 100%;
    padding: 0 12px;
  }
}

/* Ajustes botones */
.btns { display: flex; gap: 8px; align-items: center; }
.btn, .btn-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  line-height: 1;
  padding: 6px 12px;
}

/* Checkboxes personalizados */
input[type="checkbox"] {
  appearance: none;
  width: 20px; height: 20px;
  border: 2px solid #ddd; border-radius: 4px;
  background-color: #fff;
  transition: background-color .3s, border-color .3s;
  cursor: pointer; position: relative;
}
input[type="checkbox"]:checked { background-color: #000; border-color: #000; }
input[type="checkbox"]:checked::before {
  content: "✔"; color: #fff; display: block; font-size: 14px; text-align: center; line-height: 16px;
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
}

/* Radios personalizados */
input[type="radio"] {
  appearance: none;
  width: 20px; height: 20px;
  border: 2px solid #ddd; border-radius: 50%;
  background-color: #fff; transition: background-color .3s, border-color .3s;
  cursor: pointer; position: relative;
}
input[type="radio"]:checked { background-color: #000; border-color: #000; }

/* Number inputs */
input[type="number"] {
  width: 110px; padding: 6px 8px; border: 1px solid #ddd; border-radius: 6px; background: #fff;
  font-size: 14px; transition: border-color .3s ease, box-shadow .3s ease; outline: none; color: #333;
}
input[type="number"]:focus {
  border-color: #000; box-shadow: 0 0 5px rgba(77, 74, 78, .4); background: #f3f3f3;
}
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }

/* ====== MODO FLOTANTE: el grid no se mueve ====== */
.jz-float .jz-sidebar {
  position: fixed;
  left: 0;
  top: calc(var(--header-h) + 12px);
  width: var(--sidebar-w);
  max-height: calc(100vh - var(--header-h) - 24px);
  overflow-y: auto;
  z-index: 5;
}

.jz-float .with-left-pad {
  padding-left: calc(var(--sidebar-w) + 32px);
}

/* en móviles, volvemos todo normal */
@media (max-width: 980px) {
  .jz-float .jz-sidebar { position: static; width: auto; max-height: none; overflow: visible; }
  .jz-float .with-left-pad { padding-left: 0; }
}
