.catalogo__cabecera { padding-top: clamp(140px, 18vw, 220px); padding-bottom: clamp(48px, 6vw, 80px); display: grid; gap: 28px; }
.catalogo__cabecera .lead { margin: 0; }

.filtros {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(243, 238, 231, 0.88);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-top: 1px solid var(--junta);
  border-bottom: 1px solid var(--junta);
  transition: top 0.6s var(--ease);
}
body:has(.nav.solida:not(.oculta)) .filtros { top: 68px; }
.filtros__fila { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 14px; }
.filtros__grupo { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.filtros__grupo::-webkit-scrollbar { display: none; }
.filtros__grupo button {
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px var(--junta);
  transition: all 0.35s var(--ease);
}
.filtros__grupo button small { font-family: var(--mono); font-weight: 400; font-size: 10px; color: var(--humo); margin-left: 4px; }
.filtros__grupo button:hover { box-shadow: inset 0 0 0 1px var(--grafito); }
.filtros__grupo button.activo { background: var(--grafito); color: var(--porcelana); box-shadow: none; }
.filtros__grupo button.activo small { color: var(--brasa); }
.filtros__derecha { display: flex; gap: 8px; align-items: center; }
.filtros__buscar { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--junta); }
.filtros__buscar svg { width: 16px; height: 16px; color: var(--humo); }
.filtros__buscar input { border: 0; background: none; outline: none; width: 150px; font-size: 14px; }
.filtros__select {
  height: 40px;
  padding: 0 32px 0 14px;
  border: 0;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--junta);
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23151311' stroke-width='1.3'/%3E%3C/svg%3E") right 14px center no-repeat;
  appearance: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
@media (max-width: 1100px) {
  .filtros__fila { flex-direction: column; align-items: stretch; gap: 10px; }
  .filtros__derecha { overflow-x: auto; scrollbar-width: none; }
  .filtros__buscar { flex: 1 0 160px; }
  .filtros__buscar input { width: 100%; }
}
@media (max-width: 900px) { body:has(.nav.solida:not(.oculta)) .filtros { top: 64px; } }

.grilla {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: clamp(28px, 3vw, 48px) clamp(16px, 2vw, 28px);
  padding: clamp(40px, 5vw, 72px) 0 clamp(96px, 12vw, 160px);
}
.pieza { display: grid; gap: 14px; position: relative; }
.pieza__img { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: var(--arena); }
/* la pieza sola y, al pasar, la pieza "colocada" con juntas */
.pieza__sola, .pieza__colocada { position: absolute; inset: 0; transition: opacity 0.7s var(--ease), transform 1.2s var(--ease); }
/* centrada con su proporción real (el ancho y el aspect-ratio vienen de los datos) */
.pieza__sola { inset: auto; left: 50%; top: 50%; translate: -50% -46%; background-size: cover; background-position: center; box-shadow: 0 30px 40px -22px rgba(0, 0, 0, 0.45); }
.pieza__colocada { opacity: 0; transform: scale(1.15); background-repeat: repeat; background-color: #8d8780; }
.pieza:hover .pieza__sola { opacity: 0; transform: scale(0.9) rotate(-4deg); }
.pieza:hover .pieza__colocada { opacity: 1; transform: scale(1); }
.pieza__etiqueta { position: absolute; top: 12px; left: 12px; display: flex; gap: 6px; z-index: 2; }
.pieza__etiqueta .chip { background: var(--marfil); height: 24px; font-size: 10px; }
.pieza__3d { position: absolute; right: 12px; bottom: 12px; z-index: 2; height: 32px; padding: 0 12px; border-radius: 99px; background: var(--grafito); color: var(--porcelana); font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; display: flex; align-items: center; transform: translateY(8px); opacity: 0; transition: all 0.5s var(--ease); }
.pieza:hover .pieza__3d { transform: none; opacity: 1; }
.pieza__info { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: baseline; }
.pieza__nombre { font-family: var(--serif); font-size: 30px; line-height: 1; margin: 0; }
.pieza__pei { font-size: 11px; padding: 3px 8px; background: var(--grafito); color: var(--porcelana); white-space: nowrap; align-self: center; }
.pieza__meta { color: var(--humo); grid-column: 1 / -1; }
@media (hover: none) {
  .pieza__3d { opacity: 1; transform: none; }
}
@media (max-width: 560px) {
  .grilla { grid-template-columns: 1fr 1fr; gap: 28px 12px; }
  .pieza__nombre { font-size: 22px; }
  .pieza__info { grid-template-columns: 1fr; }
  .pieza__precio { font-size: 15px; }
  .pieza__etiqueta .chip:not(:first-child) { display: none; }
  .pieza__3d { display: none; }
}

.aviso-catalogo { margin: -60px 0 0; padding-bottom: 120px; color: var(--niebla); font-size: 11px; max-width: 80ch; line-height: 1.6; }
.vacio { text-align: center; padding: 80px 0 160px; color: var(--humo); font-size: 18px; }
.vacio[hidden] { display: none; }
.limpiar { text-decoration: underline; color: var(--fuego); font-weight: 600; }

/* segunda fila: estilos (solo para pisos y revestimientos) */
.filtros__fila:first-child { padding-bottom: 8px; }
.filtros__fila--estilos { padding-top: 0; }
.filtros__fila--estilos .filtros__grupo button { height: 32px; font-size: 13px; padding: 0 12px; }
.filtros__grupo[hidden], .filtros__select[hidden] { display: none; }
.catalogo__cuenta { color: var(--humo); white-space: nowrap; }
.pieza__nombre small { font-family: var(--mono); font-size: 11px; color: var(--humo); letter-spacing: 0.04em; vertical-align: middle; }

/* productos por unidad: grifería, adhesivos, fogoneros */
.pieza--unidad .pieza__img { background: #fff; }
.pieza__foto { position: absolute; inset: 8%; background: center / contain no-repeat; transition: transform 1s var(--ease); }
.pieza--unidad:hover .pieza__foto { transform: scale(1.05); }
.pieza--unidad .pieza__nombre { font-size: 24px; }
.pieza--unidad .pieza__meta { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.mas-wrap { display: flex; justify-content: center; margin: -60px 0 100px; }
.mas[hidden] { display: none; }
.mas span { color: var(--humo); }

/* ficha rápida */
.producto { width: min(880px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 0; background: var(--marfil); color: var(--grafito); display: none; grid-template-columns: 1fr 1fr; overflow: auto; }
.producto[open] { display: grid; }
.producto::backdrop { background: rgba(13, 12, 11, 0.6); backdrop-filter: blur(6px); }
.producto__img { background: #fff; display: grid; place-items: center; padding: 24px; min-height: 280px; }
.producto__img img { max-height: 60vh; object-fit: contain; }
.producto__info { padding: clamp(24px, 4vw, 44px); display: grid; gap: 16px; align-content: start; }
.producto__nombre { font-size: clamp(30px, 3.4vw, 44px); }
.producto__nota { margin: 0; color: var(--humo); }
.producto__nota[hidden] { display: none; }
.producto__cant { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-top: 1px solid var(--junta); border-bottom: 1px solid var(--junta); }
.producto__cant .mono { color: var(--humo); text-transform: uppercase; letter-spacing: 0.12em; font-size: 11px; }
.stepper { display: flex; align-items: center; gap: 4px; }
.stepper button { width: 36px; height: 36px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--junta); font-size: 18px; }
.stepper button:hover { box-shadow: inset 0 0 0 1px var(--grafito); }
.stepper strong { min-width: 32px; text-align: center; font-size: 18px; font-variant-numeric: tabular-nums; }
.producto .btn { justify-content: center; }
.producto__aviso { margin: 0; color: var(--niebla); }
.producto__cerrar { position: absolute; top: 10px; right: 12px; width: 40px; height: 40px; border-radius: 50%; font-size: 26px; line-height: 1; background: var(--marfil); z-index: 2; }
@media (max-width: 700px) {
  .producto { grid-template-columns: 1fr; }
  .producto__img { min-height: 220px; }
  .producto__img img { max-height: 36vh; }
}
