/* ═══════════════════════════════════════════════════════════
   Molykote Theme — Catálogo / archive-product
   ═══════════════════════════════════════════════════════════ */

/* ─── Alias: mapear design vars → theme tokens ─── */
:root {
  --surface-0:   var(--tm-surface-0);
  --surface-1:   var(--tm-surface-1);
  --surface-2:   var(--tm-surface-2);
  --surface-3:   var(--tm-surface-3);
  --line:        var(--tm-line);
  --line-strong: var(--tm-line-strong);
  --ink-0: var(--tm-ink-0);
  --ink-1: var(--tm-ink-1);
  --ink-2: var(--tm-ink-2);
  --ink-3: var(--tm-ink-3);
  --ink-4: var(--tm-ink-4);
  --ink-5: var(--tm-ink-5);
  --steel-50:  var(--tm-steel-50);
  --steel-100: var(--tm-steel-100);
  --steel-200: var(--tm-steel-200);
  --steel-300: var(--tm-steel-300);
  --steel-500: var(--tm-steel-500);
  --steel-600: var(--tm-steel-600);
  --steel-700: var(--tm-steel-700);
  --font-sans: var(--tm-font-sans);
  --font-body: var(--tm-font-body);
  --font-mono: var(--tm-font-mono);
  --signal-ok:   var(--tm-ok);
  --signal-warn: var(--tm-warn);
}

/* ─── Breadcrumb ─── */
.mk-breadcrumb {
  padding: 10px 40px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-4);
  border-bottom: 1px solid var(--line);
  background: var(--surface-0);
  display: flex;
  align-items: center;
  gap: 6px;
}
.mk-breadcrumb a { color: var(--ink-4); text-decoration: none; }
.mk-breadcrumb a:hover { color: var(--ink-1); }
.mk-breadcrumb .sep { color: var(--ink-5); }
.mk-breadcrumb .current { color: var(--ink-2); }

/* ─── Category banner ─── */
.cat-banner {
  background: var(--ink-0);
  padding: 36px 40px 32px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 32px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: relative;
  overflow: hidden;
}
.cat-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}
.cat-banner-meta { position: relative; }
.cat-banner-eyebrow {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--steel-300);
  margin-bottom: 8px;
}
.cat-banner-title {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 34px;
  letter-spacing: -0.02em;
  color: white;
  line-height: 1.1;
  margin: 0;
}
.cat-banner-desc {
  font-size: 13.5px;
  color: rgba(255,255,255,0.55);
  max-width: 580px;
  line-height: 1.55;
  margin-top: 10px;
}
.cat-banner-chips {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.cat-banner-chip {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  padding: 5px 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.7);
}
.cat-banner-right {
  position: relative;
  display: flex;
  gap: 32px;
  align-items: flex-end;
}
.cat-stat { text-align: right; }
.cat-stat .num {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 500;
  color: white;
  letter-spacing: -0.01em;
}
.cat-stat .lbl {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.35);
  margin-top: 2px;
}

/* ─── Category tabs ─── */
.cat-tabs-bar {
  background: var(--surface-0);
  border-bottom: 1px solid var(--line);
  padding: 0 40px;
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow-x: auto;
}
.cat-tab {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-3);
  padding: 14px 18px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color .12s, border-color .12s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  display: flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}
.cat-tab:hover { color: var(--ink-0); }
.cat-tab.active {
  color: var(--ink-0);
  border-bottom-color: var(--steel-500);
}
.cat-tab .count {
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--surface-2);
  color: var(--ink-3);
  padding: 1px 6px;
  border-radius: 10px;
}
.cat-tab.active .count {
  background: var(--steel-50);
  color: var(--steel-600);
}

/* ─── Active filter chips ─── */
.active-filters {
  padding: 10px 40px;
  background: var(--surface-1);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-height: 46px;
}
.active-filters-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}
.af-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 4px 8px 4px 10px;
  background: var(--steel-50);
  color: var(--steel-600);
  border: 1px solid var(--steel-200);
  cursor: pointer;
  text-decoration: none;
}
.af-chip:hover { background: var(--steel-100); color: var(--steel-700); }
.af-chip .x { font-size: 13px; opacity: 0.6; line-height: 1; }

/* ─── Main 2-col layout ─── */
.cat-layout {
  display: grid;
  grid-template-columns: 256px 1fr;
  min-height: calc(100vh - 320px);
  align-items: start;
}

/* ─── Sidebar ─── */
.cat-sidebar {
  border-right: 1px solid var(--line);
  align-self: stretch;
}
.cat-sidebar::-webkit-scrollbar { width: 4px; }
.cat-sidebar::-webkit-scrollbar-track { background: transparent; }
.cat-sidebar::-webkit-scrollbar-thumb { background: var(--line-strong); }

.cat-sidebar-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cat-sidebar-head span {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-0);
}
.cat-clear-btn {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--steel-500);
  background: none;
  border: none;
  cursor: pointer;
  letter-spacing: 0.04em;
  padding: 0;
  text-decoration: none;
}
.cat-clear-btn:hover { color: var(--steel-700); }

.filter-group { border-bottom: 1px solid var(--line); }
.filter-group-head {
  padding: 13px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
}
.filter-group-head:hover { background: var(--surface-1); }
.filter-group-title {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-1);
}
.filter-group-arrow {
  font-size: 10px;
  color: var(--ink-4);
  transition: transform .15s;
}
.filter-group.collapsed .filter-group-arrow { transform: rotate(-90deg); }
.filter-group-body { padding: 6px 20px 14px; }
.filter-group.collapsed .filter-group-body { display: none; }

.filter-option {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 0;
  cursor: pointer;
  font-size: 13px;
  color: var(--ink-2);
  text-decoration: none;
}
.filter-option:hover { color: var(--ink-0); }
.filter-option input[type="checkbox"] {
  accent-color: var(--steel-500);
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}
.filter-option .opt-label { flex: 1; }
.filter-option .opt-count {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-5);
}
.filter-option.checked .opt-label { color: var(--ink-0); font-weight: 500; }

/* Sidebar CTA asesor */
.sidebar-cta {
  padding: 20px;
  border-top: 1px solid var(--line);
}
.sidebar-cta-label {
  font-family: var(--font-mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  margin-bottom: 10px;
}

/* ─── Catalog main area ─── */
.cat-main { padding: 0; }

.cat-toolbar {
  padding: 14px 28px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  background: var(--surface-0);
  z-index: 10;
}
.cat-count {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-3);
}
.cat-count strong { color: var(--ink-0); font-weight: 600; }
.cat-toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sort-select {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-1);
  padding: 7px 28px 7px 10px;
  border: 1px solid var(--line);
  background: var(--surface-0) url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%235a6775' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 8px center;
  -webkit-appearance: none;
  cursor: pointer;
  outline: none;
}
.sort-select:hover { border-color: var(--ink-3); }

.view-toggle {
  display: flex;
  border: 1px solid var(--line);
}
.view-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  cursor: pointer;
  background: none;
  border: none;
  color: var(--ink-4);
  transition: background .1s, color .1s;
}
.view-btn:hover { background: var(--surface-1); }
.view-btn.active { background: var(--steel-50); color: var(--steel-600); }
.view-btn + .view-btn { border-left: 1px solid var(--line); }

/* ─── Product grid ─── */
.mk-product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border-bottom: 1px solid var(--line);
}
.mk-product-grid.view-list {
  grid-template-columns: 1fr;
}

/* ─── Product card ─── */
.pcard {
  background: var(--surface-0);
  position: relative;
  cursor: pointer;
  transition: background .12s;
  display: flex;
  flex-direction: column;
}
.pcard:hover { background: var(--steel-50); }
.pcard:hover .pcard-actions { opacity: 1; }

.pcard-top {
  padding: 14px 18px 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.pcard-sku {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--ink-4);
}
.pcard-badges { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }

.badge {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  text-transform: uppercase;
}
.badge-hot { background: oklch(96% 0.04 25); color: oklch(40% 0.15 25); border: 1px solid oklch(80% 0.1 25); }
.badge-new { background: var(--steel-50); color: var(--steel-600); border: 1px solid var(--steel-200); }
.badge-nsf { background: oklch(96% 0.04 150); color: oklch(35% 0.14 150); border: 1px solid oklch(82% 0.1 150); }
.badge-sale { background: oklch(96% 0.05 310); color: oklch(38% 0.16 310); border: 1px solid oklch(82% 0.12 310); }
.badge-low { background: oklch(96% 0.05 70); color: oklch(40% 0.14 70); border: 1px solid oklch(82% 0.12 70); }

/* Product image / placeholder */
.pcard-img {
  width: 100%;
  aspect-ratio: 4/3;
  max-height: 160px;
  background: var(--surface-1);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}
.pcard-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 16px;
}
.pcard-img-placeholder {
  width: 100%;
  height: 100%;
  background-image: repeating-linear-gradient(
    -45deg,
    transparent 0, transparent 8px,
    rgba(11,21,32,0.04) 8px, rgba(11,21,32,0.04) 9px
  );
  display: grid;
  place-items: center;
}
.pcard-illus {
  width: 52%;
  aspect-ratio: 1;
  background: linear-gradient(160deg, #f0f3f7 0%, #d4dce6 100%);
  border-radius: 4px 4px 2px 2px;
  position: relative;
  box-shadow: 0 8px 24px rgba(11,21,32,0.1), inset 8px 0 20px rgba(255,255,255,0.6);
  border: 1px solid rgba(11,21,32,0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.pcard-illus::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 22%;
  background: linear-gradient(180deg, #e0e7ee, #c8d2dc);
  border-bottom: 1px solid rgba(11,21,32,0.08);
}
.pcard-illus-label {
  background: var(--steel-500);
  flex: 1;
  margin: 25% 6px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px;
  gap: 2px;
}
.pcard-illus-label .s1 {
  font-family: var(--font-sans);
  font-size: 9px;
  letter-spacing: 0.2em;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
}
.pcard-illus-label .s2 {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 15px;
  color: white;
  letter-spacing: 0.02em;
}

/* Hover actions */
.pcard-actions {
  position: absolute;
  bottom: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: opacity .15s;
}
.pcard-action-btn {
  flex: 1;
  padding: 9px 10px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background .1s;
  text-decoration: none;
}
.pab-primary { background: var(--steel-500); color: white; }
.pab-primary:hover { background: var(--steel-600); }
.pab-secondary {
  background: var(--surface-0);
  color: var(--ink-1);
  border: 1px solid var(--line);
  flex: 0 0 38px;
}
.pab-secondary:hover { background: var(--surface-2); }

/* Card body */
.pcard-body {
  padding: 14px 18px 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.pcard-family {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--steel-500);
  margin-bottom: 4px;
}
.pcard-name {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 14.5px;
  color: var(--ink-0);
  line-height: 1.25;
  margin: 0 0 6px;
  text-decoration: none;
}
.pcard-name:hover { color: var(--steel-600); }
.pcard-desc {
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.45;
  flex: 1;
}
.pcard-specs {
  margin-top: 10px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.pspec-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 3px 7px;
  background: var(--surface-1);
  border: 1px solid var(--line);
  color: var(--ink-2);
}

.pcard-footer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.pcard-price {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-0);
}
.pcard-price .cur { font-size: 10px; color: var(--ink-3); margin-right: 2px; }
.pcard-price .unit { font-family: var(--font-mono); font-size: 9px; color: var(--ink-4); margin-left: 4px; }
.pcard-stock {
  font-family: var(--font-mono);
  font-size: 10px;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}
.stock-dot { width: 5px; height: 5px; border-radius: 50%; display: inline-block; }
.dot-ok   { background: var(--signal-ok); }
.dot-warn { background: var(--signal-warn); }
.dot-no   { background: var(--ink-4); }

/* ─── List view ─── */
.mk-product-grid.view-list .pcard {
  flex-direction: row;
}
.mk-product-grid.view-list .pcard-img {
  width: 180px;
  aspect-ratio: 1;
  flex-shrink: 0;
}
.mk-product-grid.view-list .pcard-actions {
  position: static;
  opacity: 1;
  flex-direction: column;
  gap: 6px;
  padding: 0;
}
.mk-product-grid.view-list .pcard-action-btn { width: 160px; }
.mk-product-grid.view-list .pcard-body {
  flex-direction: row;
  align-items: center;
  gap: 24px;
  padding: 20px 24px;
  flex: 1;
}
.mk-product-grid.view-list .pcard-info { flex: 1; }
.mk-product-grid.view-list .pcard-specs { margin-top: 8px; }
.mk-product-grid.view-list .pcard-footer {
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  border-top: none;
  padding-top: 0;
  margin-top: 0;
  flex-shrink: 0;
  min-width: 180px;
}
.mk-product-grid.view-list .pcard-top { display: none; }
.mk-product-grid.view-list .pcard-list-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}

/* ─── Pagination ─── */
.cat-pagination {
  padding: 20px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.pag-info { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); }
.pag-btns {
  display: flex;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.pag-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: var(--surface-0);
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-2);
  border: none;
  transition: background .1s, color .1s;
  text-decoration: none;
}
.pag-btn:hover { background: var(--surface-2); }
.pag-btn.active { background: var(--steel-500); color: white; }
.pag-btn.disabled { color: var(--ink-5); cursor: default; pointer-events: none; }

/* WooCommerce pagination override */
.woocommerce-pagination { padding: 0 28px 20px; }
.woocommerce-pagination ul {
  display: flex;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  list-style: none;
  margin: 0;
  padding: 0;
  width: fit-content;
}
.woocommerce-pagination ul li { margin: 0; }
.woocommerce-pagination ul li a,
.woocommerce-pagination ul li span {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: var(--surface-0);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-2);
  text-decoration: none;
  transition: background .1s;
}
.woocommerce-pagination ul li a:hover { background: var(--surface-2); }
.woocommerce-pagination ul li span.current {
  background: var(--steel-500);
  color: white;
}

/* ─── Recommended strip ─── */
.rec-strip {
  border-top: 1px solid var(--line);
  padding: 28px 28px 0;
}
.rec-strip-head {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 16px;
}
.rec-strip-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.rec-card {
  background: var(--surface-0);
  padding: 16px;
  cursor: pointer;
  text-decoration: none;
  display: block;
}
.rec-card:hover { background: var(--surface-1); }
.rc-sku { font-family: var(--font-mono); font-size: 9.5px; color: var(--ink-4); letter-spacing: 0.04em; }
.rc-name { font-family: var(--font-sans); font-weight: 600; font-size: 13px; color: var(--ink-0); margin-top: 4px; line-height: 1.25; }
.rc-price { font-family: var(--font-mono); font-size: 13px; color: var(--ink-0); margin-top: 8px; }

/* ─── No results ─── */
.no-results {
  padding: 80px 28px;
  text-align: center;
}
.no-results .nr-icon { font-size: 32px; margin-bottom: 16px; color: var(--ink-5); }
.no-results h3 { font-family: var(--font-sans); font-weight: 600; font-size: 18px; color: var(--ink-1); margin: 0 0 8px; }
.no-results p { font-size: 13.5px; color: var(--ink-3); margin: 0; }

/* ─── Responsive ─── */
@media (max-width: 989px) {
  .cat-layout { grid-template-columns: 1fr; }
  .cat-sidebar { position: static; max-height: none; border-right: none; border-bottom: 1px solid var(--line); display: none; }
  .cat-sidebar.open { display: block; }
  .cat-banner { grid-template-columns: 1fr; }
  .cat-banner-right { justify-content: flex-start; }
  .mk-product-grid { grid-template-columns: repeat(2, 1fr); }
  .cat-banner-title { font-size: 26px; }
}
@media (max-width: 749px) {
  .mk-product-grid { grid-template-columns: 1fr; }
  .cat-banner { padding: 24px 20px; }
  .cat-tabs-bar { padding: 0 20px; }
  .active-filters { padding: 10px 20px; }
  .cat-toolbar { padding: 10px 16px; }
  .mk-breadcrumb { padding: 10px 20px; }
}
