/* ===========================================================================
   IMD Industrial · catálogo de productos
   Solo lo cargan catalogo.html y producto.html. Mismos tokens que el resto.
   =========================================================================== */

/* ------------------------------------------------- Encabezado y buscador */
.phead--slim .phead__in { padding-block: clamp(22px, 3vw, 32px) clamp(28px, 4vw, 44px); }
.phead--slim .crumbs { margin-bottom: 14px; }
.cat-search { display: flex; gap: 10px; margin-top: 20px; max-width: 720px; }
.cat-search .input { flex: 1; min-width: 0; }

.sec--tight { padding-block: clamp(28px, 4vw, 48px) var(--section); }

/* Ruta sobre fondo claro (ficha de producto) */
.crumbs--light { color: var(--ink-soft); }
.crumbs--light a { color: var(--ink-soft); }
.crumbs--light a:hover { color: var(--blue); }
.crumbs--light b { color: var(--navy); }

/* ---------------------------------------------------------- Distribución */
.cat { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: clamp(24px, 3vw, 40px); align-items: start; }
.cat__side { position: sticky; top: calc(var(--hdr-h) + 16px); display: grid; gap: 20px; max-height: calc(100vh - var(--hdr-h) - 32px); overflow-y: auto; overscroll-behavior: contain; padding-right: 4px; }
.cat__h { font-size: .8125rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }

/* Árbol de categorías */
.tree ul { list-style: none; margin: 0; padding: 0; }
.tree .tree__l2 { margin: 2px 0 8px 12px; border-left: 2px solid var(--grey-2); }
.tree .tree__l3 { margin: 0 0 6px 12px; }
.tree__a {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius-sm); text-decoration: none;
  color: var(--navy); font-size: .9063rem; line-height: 1.35;
  transition: background-color 140ms ease, color 140ms ease;
}
.tree__a small { color: var(--ink-soft); font-size: .75rem; font-weight: 500; flex: none; }
.tree__a--0, .tree__a--1 { font-weight: 700; }
.tree__a--2 { font-weight: 600; }
.tree__a--3 { font-weight: 500; color: var(--ink-soft); font-size: .875rem; }
.tree__a:hover { background: var(--grey); color: var(--blue); }
.tree__a[aria-current="true"] { background: var(--blue-soft); color: var(--blue); }

.cat__help { background: var(--grey); border-radius: var(--radius); padding: 18px; display: grid; gap: 8px; font-size: .875rem; color: var(--ink-soft); }
.cat__help b { color: var(--navy); }

/* Barra de resultados */
.cat__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin-bottom: 20px; }
.cat__count { font-weight: 700; color: var(--navy); }
.cat__filters { display: flex; flex-wrap: wrap; gap: 10px; }
.cat__filters .input { width: auto; min-width: 200px; max-width: 280px; }

.prods--cat { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.cat__note { margin-top: 24px; font-size: .8125rem; color: var(--ink-soft); }

.empty { grid-column: 1 / -1; display: grid; gap: 10px; justify-items: start; padding: 36px; background: var(--grey); border-radius: var(--radius); color: var(--ink-soft); }
.empty b { color: var(--navy); }

/* Paginación */
.pages { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; margin-top: 32px; }
.pg {
  min-width: 44px; height: 44px; padding: 0 10px; border: 1px solid var(--grey-2); border-radius: var(--radius-sm);
  background: var(--white); color: var(--navy); font: inherit; font-weight: 600; cursor: pointer;
  display: inline-grid; place-items: center; transition: border-color 140ms ease, background-color 140ms ease;
}
.pg svg { width: 18px; height: 18px; }
.pg:hover:not([disabled]) { border-color: var(--blue); color: var(--blue); }
.pg[aria-current="page"] { background: var(--blue); border-color: var(--blue); color: var(--white); }
.pg[disabled] { opacity: .4; cursor: default; }
.pg__gap { color: var(--ink-soft); padding: 0 4px; }

/* -------------------------------------------------------- Ficha de producto */
.pd { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(28px, 4vw, 64px); margin-bottom: clamp(40px, 5vw, 64px); }
.pd__zoom { display: grid; place-items: center; width: 100%; aspect-ratio: 1; padding: 24px; border: 1px solid var(--grey-2); border-radius: var(--radius); background: var(--white); cursor: zoom-in; }
div.pd__zoom { cursor: default; }
.pd__zoom img { width: 100%; height: 100%; object-fit: contain; }
.pd__zoom .prod__ph { width: 30%; }
.pd__info { display: grid; gap: 14px; align-content: start; }
.pd__t { font-size: clamp(1.375rem, 1.1rem + 1vw, 2rem); font-weight: 800; line-height: 1.2; letter-spacing: -.02em; color: var(--navy); }
.pd__sku { color: var(--ink-soft); font-size: .9375rem; }
.pd__sku b { color: var(--navy); }
.pd__price { padding: 18px 20px; background: var(--grey); border-radius: var(--radius); }
.pd__price b { font-size: 1.75rem; font-weight: 800; color: var(--navy); }
.pd__price span { color: var(--ink-soft); font-size: .875rem; }
.pd__price small { display: block; margin-top: 4px; color: var(--ink-soft); font-size: .8125rem; }
.pd__stock { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; font-size: .9375rem; color: var(--ink-soft); }
.pd__stock svg { width: 18px; height: 18px; flex: none; color: var(--blue); }
.pd__stock--no { color: var(--ink-soft); font-style: italic; }
.pd__btns { display: flex; flex-wrap: wrap; gap: 10px; }
.pd__perks { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 10px; }
.pd__perks li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; color: var(--ink-soft); font-size: .9375rem; }
.pd__perks svg { width: 20px; height: 20px; color: var(--blue); }

.specs { width: 100%; max-width: 820px; border-collapse: collapse; font-size: .9375rem; }
.specs th, .specs td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--grey-2); vertical-align: top; overflow-wrap: anywhere; }
.specs th { width: 36%; font-weight: 600; color: var(--navy); background: var(--grey); }
.specs td { color: var(--ink-soft); }

/* ------------------------------------------------------------- Responsive */
@media (max-width: 1024px) {
  .cat { grid-template-columns: 1fr; }
  .cat__side { position: static; max-height: none; overflow: visible; }
  .tree { max-height: 320px; overflow-y: auto; border: 1px solid var(--grey-2); border-radius: var(--radius); padding: 6px; }
  .cat__help { display: none; }
}
@media (max-width: 760px) {
  .cat-search .btn { padding-inline: 1em; }
  .cat__filters, .cat__filters .input { width: 100%; max-width: none; }
  .prods--cat { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .pd { grid-template-columns: 1fr; }
  .pd__btns .btn { flex: 1 1 100%; }
  .specs th { width: 42%; }
  .specs th, .specs td { padding: 10px 12px; }
}
