/* =========================================================
   Alyra - Visualizador de productos / fichas técnicas
   ========================================================= */

.productos-page-header {
  margin-bottom: 0;
}

/* Header propio de productos: anula la raya del h1 del tema para que no pise la bajada */
.page-header-productos {
  margin-bottom: 0 !important;
  padding-bottom: 34px !important;
}

.page-header-productos h1 {
  display: block !important;
  margin: 0 0 8px !important;
  padding: 0 !important;
  border-bottom: 0 !important;
  line-height: 1.15 !important;
}

.page-header-productos .productos-page-lead {
  margin: 0 !important;
}

.productos-page-lead {
  color: #d8d8d8;
  font-size: 18px;
  margin: 5px 0 0;
}

.productos-section {
  background: #f4f5f7;
  padding: 45px 0 60px;
}

.productos-toolbar {
  display: flex;
  gap: 12px;
  align-items: stretch;
  margin-bottom: 16px;
}

.productos-search-wrap {
  position: relative;
  flex: 1;
}

.productos-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #777;
  z-index: 2;
}

.productos-search {
  height: 52px;
  border-radius: 4px;
  padding-left: 46px;
  border: 1px solid #d8dce2;
  box-shadow: none;
  font-size: 15px;
}

.productos-search:focus {
  border-color: #c5a14b;
  box-shadow: 0 0 0 2px rgba(197, 161, 75, .14);
}

.productos-clear {
  min-width: 96px;
  height: 52px;
  border-radius: 4px;
}

.productos-status {
  color: #777;
  font-size: 13px;
  margin: 0 0 18px;
}

.productos-layout {
  display: flex;
  align-items: flex-start;
}

.productos-sidebar {
  position: sticky;
  top: 90px;
}

.productos-panel {
  background: #fff;
  border: 1px solid #e4e6e8;
  border-radius: 6px;
  padding: 18px;
  box-shadow: 0 8px 22px rgba(0,0,0,.04);
}

.productos-panel-title {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #222;
  font-size: 12px;
  margin-bottom: 12px;
}

.productos-tree-button,
.productos-tree-subbutton {
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 9px 8px;
  border-radius: 4px;
  color: #333;
  font-size: 13px;
  line-height: 1.25;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.productos-tree-button:hover,
.productos-tree-subbutton:hover,
.productos-tree-button.is-active,
.productos-tree-subbutton.is-active {
  background: #f0eadc;
  color: #111;
}

.productos-tree-button {
  font-weight: 700;
  text-transform: uppercase;
}

.productos-tree-subbutton {
  padding-left: 18px;
  color: #555;
}

.productos-tree-count {
  font-size: 11px;
  color: #777;
  background: #f1f1f1;
  border-radius: 999px;
  padding: 2px 7px;
  flex: 0 0 auto;
}

.productos-tree-button.is-active .productos-tree-count,
.productos-tree-subbutton.is-active .productos-tree-count {
  background: #fff;
  color: #333;
}

.productos-results-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 15px;
  margin-bottom: 14px;
}

.productos-results-head h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  color: #202020;
}

.productos-count {
  font-size: 13px;
  color: #777;
}

.productos-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.producto-card {
  background: #fff;
  border: 1px solid #e3e5e8;
  border-radius: 7px;
  overflow: hidden;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 24px rgba(0,0,0,.045);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.producto-card:hover {
  transform: translateY(-2px);
  border-color: #d0bd82;
  box-shadow: 0 16px 30px rgba(0,0,0,.075);
}

.producto-card-img-wrap {
  height: 175px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.producto-card-img-wrap img {
  max-width: 100%;
  max-height: 120px;
  object-fit: contain;
  display: block;
}

.producto-img-placeholder {
  width: 100%;
  height: 100%;
  min-height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .08em;
  text-align: center;
}

.producto-card-body {
  padding: 17px 17px 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.producto-card-codes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.producto-code-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #222;
  color: #fff;
  padding: 4px 9px;
  font-size: 11px;
  line-height: 1;
  font-weight: 700;
}

.producto-code-pill--light {
  background: #f1f1f1;
  color: #333;
}

.producto-card-title {
  font-size: 17px;
  line-height: 1.25;
  font-weight: 800;
  color: #1f1f1f;
  margin: 0 0 12px;
}

.producto-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  margin-bottom: 14px;
}

.producto-meta-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 3px;
  background: #f3f4f5;
  color: #444;
  padding: 5px 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.producto-card-action {
  width: 100%;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.productos-empty {
  background: #fff;
  border: 1px dashed #cfd3d8;
  color: #777;
  padding: 28px;
  border-radius: 6px;
  text-align: center;
}

.producto-modal .modal-content {
  border-radius: 7px;
  overflow: hidden;
  border: 0;
}

.producto-modal-close {
  position: absolute;
  right: 15px;
  top: 10px;
  z-index: 5;
  font-size: 34px;
  line-height: 1;
  opacity: .45;
}

.producto-detail {
  display: grid;
  grid-template-columns: 310px 1fr;
  gap: 30px;
  padding: 12px;
}

.producto-detail-img {
  background: linear-gradient(135deg, #f7f7f7 0%, #eceff2 100%);
  border: 1px solid #e5e7ea;
  border-radius: 6px;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
}

.producto-detail-img img {
  max-width: 100%;
  max-height: 260px;
  object-fit: contain;
}

.producto-detail-kicker {
  color: #777;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 7px;
}

.producto-detail-title {
  font-size: 28px;
  line-height: 1.15;
  font-weight: 800;
  color: #171717;
  margin: 0 0 14px;
  padding-right: 28px;
}

.producto-detail-codes,
.producto-detail-meta,
.producto-compatible-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.producto-detail-codes,
.producto-detail-meta {
  margin-bottom: 14px;
}

.producto-detail-section {
  margin-top: 22px;
}

.producto-detail-section h4 {
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #222;
  margin: 0 0 9px;
}

.producto-detail-description {
  color: #555;
  font-size: 15px;
  line-height: 1.6;
  margin: 0;
}

.producto-bullets {
  padding-left: 18px;
  margin: 0;
}

.producto-bullets li {
  color: #444;
  margin-bottom: 7px;
  line-height: 1.45;
}

.producto-compatible-chip {
  border: 1px solid #d9dce0;
  background: #fff;
  color: #222;
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.producto-compatible-chip:hover,
.producto-compatible-chip.is-linked {
  border-color: #c5a14b;
  background: #fbf7ec;
}

.producto-compatible-chip.is-missing {
  color: #777;
  border-style: dashed;
}

.producto-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.producto-actions .btn {
  border-radius: 4px;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: .04em;
}

@media (max-width: 991px) {
  .productos-layout {
    display: block;
  }

  .productos-sidebar {
    position: static;
    margin-bottom: 20px;
  }

  .productos-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .producto-detail {
    grid-template-columns: 1fr;
  }

  .producto-detail-img {
    min-height: 220px;
  }
}

@media (max-width: 600px) {
  .productos-toolbar {
    display: block;
  }

  .productos-clear {
    width: 100%;
    margin-top: 10px;
  }

  .productos-grid {
    grid-template-columns: 1fr;
  }

  .productos-results-head {
    display: block;
  }

  .productos-count {
    margin-top: 5px;
  }

  .producto-card-img-wrap {
    height: 155px;
  }

  .producto-detail-title {
    font-size: 23px;
  }
}

/* Ajuste v2: card clickeable, código único y categorías jerárquicas */
.producto-card {
  cursor: pointer;
  outline: none;
}

.producto-card:focus {
  border-color: #c5a14b;
  box-shadow: 0 0 0 3px rgba(197, 161, 75, .18), 0 16px 30px rgba(0,0,0,.075);
}

.producto-card-code-line {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  align-self: flex-start;
  margin-bottom: 12px;
  padding: 4px 0;
  border-bottom: 1px solid #d9dce0;
  color: #222;
  line-height: 1;
}

.producto-card-code-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: #777;
}

.producto-card-code-value {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .02em;
  color: #222;
}

.producto-card-category {
  margin-top: auto;
  padding-top: 13px;
  border-top: 1px solid #edf0f2;
}

.producto-card-category-main {
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .10em;
  color: #222;
  line-height: 1.25;
}

.producto-card-category-sub {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 600;
  color: #777;
  line-height: 1.25;
}

.producto-card-codes,
.producto-card-meta,
.producto-card-action {
  display: none;
}

.producto-detail-category {
  margin: 0 0 16px;
  padding: 11px 13px;
  border-left: 3px solid #c5a14b;
  background: #f7f7f7;
}

.producto-detail-category-main,
.producto-detail-category-sub {
  display: block;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.producto-detail-category-main {
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .10em;
  color: #222;
}

.producto-detail-category-sub {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 600;
  color: #666;
}

.producto-detail-category-main:hover,
.producto-detail-category-sub:hover {
  color: #9b7b2f;
}

/* Ajuste v3: ruta de categorías, ficha interna y carrusel */
.producto-card-route {
  margin-top: auto;
  padding-top: 13px;
  border-top: 1px solid #edf0f2;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  color: #777;
  font-size: 12px;
  line-height: 1.3;
}

.producto-card-route-item--main {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: #222;
}

.producto-card-route-item--sub {
  font-weight: 600;
  color: #777;
}

.producto-card-route-separator {
  color: #b9b9b9;
  font-weight: 700;
}

.producto-modal .modal-dialog {
  width: min(1040px, calc(100vw - 32px));
}

.producto-modal .modal-body {
  padding: 24px 26px 26px;
}

.producto-detail {
  grid-template-columns: minmax(260px, 330px) minmax(0, 1fr);
  gap: 34px;
  padding: 0;
}

.producto-detail-media {
  min-width: 0;
}

.producto-gallery {
  position: relative;
}

.producto-gallery-stage {
  position: relative;
  height: 330px;
  border: 1px solid #e2e5e9;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  overflow: hidden;
}

.producto-gallery-stage img {
  max-width: 100%;
  max-height: 286px;
  object-fit: contain;
  display: block;
}

.producto-img-placeholder--detail {
  min-height: 180px;
}

.producto-gallery-nav {
  position: absolute;
  top: 145px;
  width: 34px;
  height: 34px;
  border: 1px solid #d7dadd;
  border-radius: 50%;
  background: rgba(255,255,255,.94);
  color: #222;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 5px 14px rgba(0,0,0,.10);
}

.producto-gallery-prev {
  left: 10px;
}

.producto-gallery-next {
  right: 10px;
}

.producto-gallery-nav:hover {
  border-color: #c5a14b;
  color: #9b7b2f;
}

.producto-gallery-counter {
  position: absolute;
  right: 12px;
  bottom: 55px;
  background: rgba(34,34,34,.78);
  color: #fff;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 800;
}

.producto-gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.producto-gallery-thumb {
  height: 58px;
  border: 1px solid #dfe2e5;
  border-radius: 6px;
  background: #f8f8f8;
  padding: 4px;
  overflow: hidden;
}

.producto-gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.producto-gallery-thumb span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 10px;
  color: #999;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.producto-gallery-thumb.is-active {
  border-color: #c5a14b;
  box-shadow: 0 0 0 2px rgba(197,161,75,.16);
}

.producto-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 8px;
  padding-right: 34px;
}

.producto-detail-kicker {
  margin-bottom: 0;
}

.producto-detail-main-code {
  font-size: 13px;
  font-weight: 900;
  color: #1c1c1c;
  white-space: nowrap;
}

.producto-detail-main-code span {
  font-size: 10px;
  color: #777;
  letter-spacing: .10em;
  text-transform: uppercase;
}

.producto-detail-title {
  font-size: 30px;
  margin-bottom: 8px;
}

.producto-detail-route {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin: 0 0 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #eceff1;
  color: #777;
}

.producto-detail-route-item {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  line-height: 1.25;
}

.producto-detail-route-item--main {
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .10em;
  color: #222;
}

.producto-detail-route-item--sub {
  font-size: 13px;
  font-weight: 700;
  color: #777;
}

.producto-detail-route-separator {
  color: #b7b7b7;
  font-weight: 800;
}

.producto-detail-route-item:hover {
  color: #9b7b2f;
}

.producto-detail-codes {
  margin-bottom: 18px;
  gap: 10px;
}

.producto-code-pill,
.producto-code-pill--light {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 0;
  background: transparent;
  color: #444;
  border-left: 2px solid #d7dadd;
  padding: 1px 0 1px 9px;
  font-size: 12px;
  font-weight: 800;
}

.producto-code-pill span {
  font-size: 9px;
  color: #888;
  letter-spacing: .10em;
  text-transform: uppercase;
}

.producto-code-muted {
  color: #888;
  font-size: 12px;
}

.producto-detail-section {
  margin-top: 24px;
}

.producto-detail-section h4 {
  margin-bottom: 11px;
}

.producto-detail-description {
  background: #f8f8f8;
  border-left: 3px solid #d9bf72;
  padding: 13px 15px;
  border-radius: 0 5px 5px 0;
  color: #4d4d4d;
}

.producto-bullets {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: ficha;
  border-top: 1px solid #eceff1;
}

.producto-bullets li {
  counter-increment: ficha;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  margin: 0;
  padding: 10px 0;
  border-bottom: 1px solid #eceff1;
  color: #444;
  line-height: 1.45;
}

.producto-bullets li::before {
  content: counter(ficha, decimal-leading-zero);
  font-size: 11px;
  font-weight: 900;
  color: #b08a32;
  letter-spacing: .05em;
}

.producto-bullets li span {
  display: block;
}

.producto-compat-subtitle {
  color: #777;
  font-size: 13px;
  margin: -2px 0 10px;
}

.producto-compatible-list {
  gap: 8px;
}

.producto-compatible-chip {
  border-radius: 5px;
  padding: 8px 10px;
  background: #fff;
}

.producto-actions {
  padding-top: 18px;
  border-top: 1px solid #eceff1;
}

.producto-actions .btn {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 800;
  padding: 8px 13px;
}

.producto-share-btn i {
  margin-right: 5px;
}

.producto-detail-category {
  display: none;
}

@media (max-width: 991px) {
  .producto-modal .modal-dialog {
    width: calc(100vw - 20px);
  }

  .producto-detail {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .producto-gallery-stage {
    height: 270px;
  }

  .producto-gallery-stage img {
    max-height: 230px;
  }

  .producto-gallery-nav {
    top: 118px;
  }
}

@media (max-width: 600px) {
  .producto-modal .modal-body {
    padding: 18px;
  }

  .producto-detail-head {
    display: block;
    padding-right: 28px;
  }

  .producto-detail-main-code {
    margin-top: 6px;
  }

  .producto-detail-title {
    font-size: 24px;
  }

  .producto-gallery-thumbs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Ajuste v4: ficha vertical, códigos en línea y bullets sin numeración */
.producto-modal .modal-dialog {
  width: min(920px, calc(100vw - 32px));
}

.producto-detail--vertical {
  display: block;
  padding: 0;
}

.producto-detail--vertical .producto-detail-media {
  margin: 0 0 26px;
}

.producto-detail--vertical .producto-gallery-stage {
  height: 310px;
}

.producto-detail--vertical .producto-gallery-stage img {
  max-height: 260px;
}

.producto-detail--vertical .producto-gallery-nav {
  top: 50%;
  transform: translateY(-50%);
}

.producto-detail--vertical .producto-gallery-counter {
  bottom: 12px;
}

.producto-detail--vertical .producto-gallery-thumbs {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.producto-detail-head {
  display: block;
  margin-bottom: 8px;
  padding-right: 34px;
}

.producto-detail-kicker {
  margin-bottom: 0;
}

.producto-detail-title {
  margin-bottom: 9px;
}

.producto-detail-route {
  margin-bottom: 12px;
  padding-bottom: 0;
  border-bottom: 0;
}

.producto-detail-code-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  padding: 10px 0 15px;
  border-bottom: 1px solid #eceff1;
  color: #2b2b2b;
  font-size: 13px;
  line-height: 1.35;
}

.producto-detail-code-row strong {
  font-size: 10px;
  font-weight: 900;
  color: #777;
  letter-spacing: .10em;
  text-transform: uppercase;
}

.producto-detail-code-separator {
  color: #c7c7c7;
  font-weight: 700;
}

.producto-detail-code-row--empty {
  color: #888;
}

.producto-bullets {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: none;
  border-top: 1px solid #eceff1;
}

.producto-bullets li {
  counter-increment: none;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  margin: 0;
  padding: 10px 0;
  border-bottom: 1px solid #eceff1;
  color: #444;
  line-height: 1.45;
}

.producto-bullets li::before {
  content: "•";
  font-size: 18px;
  line-height: 1.05;
  font-weight: 900;
  color: #b08a32;
  letter-spacing: 0;
}

@media (max-width: 991px) {
  .producto-detail--vertical .producto-gallery-stage {
    height: 270px;
  }

  .producto-detail--vertical .producto-gallery-stage img {
    max-height: 230px;
  }
}

@media (max-width: 600px) {
  .producto-modal .modal-dialog {
    width: calc(100vw - 18px);
  }

  .producto-detail--vertical .producto-gallery-stage {
    height: 230px;
  }

  .producto-detail--vertical .producto-gallery-thumbs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .producto-detail-code-row {
    gap: 6px;
  }
}

/* =========================================================
   Ajuste v5: scroll interno categorías + árbol compacto
   ========================================================= */

.productos-sidebar {
  position: sticky;
  top: 90px;
}

.productos-sidebar .productos-panel {
  max-height: calc(100vh - 112px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.productos-tree {
  max-height: calc(100vh - 170px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-right: 4px;
}

.productos-tree::-webkit-scrollbar {
  width: 8px;
}

.productos-tree::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, .22);
  border-radius: 999px;
}

.productos-tree::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, .06);
  border-radius: 999px;
}

.productos-tree-group {
  border-bottom: 1px solid rgba(0, 0, 0, .07);
}

.productos-tree-main {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 4px;
}

.productos-tree-toggle,
.productos-tree-filter {
  border: 0;
  background: transparent;
  padding: 0;
  line-height: 1.25;
}

.productos-tree-toggle {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #555;
  text-align: center;
}

.productos-tree-toggle:hover {
  background: rgba(0, 0, 0, .06);
}

.productos-tree-toggle:disabled {
  opacity: .25;
  cursor: default;
}

.productos-tree-filter {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  text-align: left;
  color: #222;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .02em;
}

.productos-tree-filter:hover,
.productos-tree-filter.is-active {
  color: #9b7b2f;
}

.productos-tree-count {
  flex: 0 0 auto;
  min-width: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #f1f1f1;
  color: #777;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.productos-tree-filter.is-active .productos-tree-count,
.productos-tree-child.is-active .productos-tree-count {
  background: #fff;
  color: #333;
}

.productos-tree-children {
  display: none;
  padding: 0 0 8px 31px;
}

.productos-tree-group.is-open > .productos-tree-children {
  display: block;
}

.productos-tree-child {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 0;
  background: transparent;
  padding: 7px 5px;
  text-align: left;
  color: #555;
  font-size: 13px;
  line-height: 1.25;
  border-radius: 4px;
}

.productos-tree-child:hover,
.productos-tree-child.is-active {
  background: #f0eadc;
  color: #111;
}

.productos-tree-empty {
  padding: 10px 2px;
  color: #777;
  font-size: 13px;
}

@media (max-width: 991px) {
  .productos-sidebar,
  .productos-sidebar .productos-panel {
    position: static;
    top: auto;
    max-height: none;
  }

  .productos-tree {
    max-height: 280px;
  }
}


/* =========================================================
   Ajuste v6: navegación de categorías más usable
   ========================================================= */

.productos-tree,
.productos-tree * {
  box-sizing: border-box;
}

.productos-tree {
  overflow-x: hidden;
  padding-right: 6px;
  min-width: 0;
}

.productos-tree-all {
  width: 100%;
  border: 0;
  background: #222;
  color: #fff;
  border-radius: 4px;
  padding: 10px 9px;
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .02em;
  line-height: 1.25;
}

.productos-tree-all:hover,
.productos-tree-all.is-active {
  background: #9b7b2f;
  color: #fff;
}

.productos-tree-all .productos-tree-count {
  background: rgba(255, 255, 255, .18);
  color: #fff;
}

.productos-tree-main {
  width: auto;
  max-width: 100%;
  min-width: 0;
}

.productos-tree-toggle {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
}

.productos-tree-filter {
  width: auto;
  min-width: 0;
}

.productos-tree-filter > span:first-child,
.productos-tree-child > span:first-child,
.productos-tree-all > span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.productos-tree-children {
  padding-left: 30px;
  padding-right: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.productos-tree-child {
  width: 100%;
  min-width: 0;
}

.productos-tree-count {
  max-width: 42px;
}

/* =========================================================
   Ajuste v7: categorías en card como ruta simple, no etiquetas
   ========================================================= */

.producto-card-route {
  margin-top: auto;
  padding-top: 13px;
  border-top: 1px solid #edf0f2;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 5px;
  color: #777;
  font-size: 12px;
  line-height: 1.35;
}

.producto-card-route-item {
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  min-height: 0 !important;
  width: auto !important;
  max-width: 100%;
  display: inline !important;
  appearance: none;
  -webkit-appearance: none;
  white-space: normal;
}

.producto-card-route-item--main {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: #222;
}

.producto-card-route-item--sub {
  font-size: 12px;
  font-weight: 600;
  color: #777;
  text-transform: none;
  letter-spacing: 0;
}

.producto-card-route-separator {
  color: #b9b9b9;
  font-weight: 800;
}

/* =========================================================
   Ajuste v8: compatibilidades por bloques desde JSON separado
   ========================================================= */

.producto-compat-section {
  border-top: 1px solid #eceff1;
  padding-top: 22px;
}

.producto-compat-blocks {
  display: grid;
  gap: 18px;
}

.producto-compat-block {
  background: #fafafa;
  border: 1px solid #e4e6e8;
  border-radius: 7px;
  padding: 14px;
}

.producto-compat-block h5 {
  margin: 0 0 10px;
  color: #222;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.25;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.producto-compat-note {
  margin: -3px 0 12px;
  color: #666;
  font-size: 13px;
  line-height: 1.45;
}

.producto-related-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.producto-related-card {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 1px solid #dfe2e5;
  background: #fff;
  border-radius: 6px;
  padding: 8px;
  text-align: left;
  color: #222;
  cursor: pointer;
}

.producto-related-card:hover {
  border-color: #c5a14b;
  box-shadow: 0 8px 18px rgba(0,0,0,.06);
}

.producto-related-img {
  height: 54px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.producto-related-img img {
  max-width: 100%;
  max-height: 48px;
  object-fit: contain;
  display: block;
}

.producto-related-img-placeholder {
  color: #999;
  font-size: 9px;
  line-height: 1.15;
  text-transform: uppercase;
  letter-spacing: .04em;
  text-align: center;
  padding: 0 4px;
}

.producto-related-info {
  min-width: 0;
  display: block;
}

.producto-related-code-label {
  display: inline-block;
  margin-right: 5px;
  color: #777;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.producto-related-code-value {
  color: #222;
  font-size: 12px;
  font-weight: 900;
}

.producto-related-name {
  display: block;
  margin-top: 4px;
  color: #333;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}

.producto-related-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px dashed #cfd3d8;
  background: #fff;
  color: #555;
  border-radius: 5px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  cursor: pointer;
}

.producto-related-code:hover {
  border-color: #c5a14b;
  color: #222;
  background: #fbf7ec;
}

@media (max-width: 600px) {
  .producto-related-grid {
    grid-template-columns: 1fr;
  }
}

/* Botón Atrás dentro de la ficha de producto */
.producto-back-btn {
  margin-right: 8px;
}

.producto-back-btn i {
  margin-right: 5px;
}

@media (max-width: 480px) {
  .producto-actions .btn {
    width: 100%;
    margin-right: 0;
    margin-bottom: 8px;
  }
}


/* =========================================================
   Ajuste v9: filtro de categorías plegable en mobile
   ========================================================= */

.productos-categories-toggle {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  display: flex;
  align-items: center;
  text-align: left;
  font: inherit;
  cursor: default;
}

.productos-categories-toggle > span:first-child {
  flex: 1 1 auto;
}

.productos-categories-toggle-meta,
.productos-categories-toggle > i {
  display: none;
}

@media (max-width: 991px) {
  .productos-sidebar {
    margin-bottom: 16px;
  }

  .productos-sidebar .productos-panel {
    max-height: none;
    padding: 0;
    overflow: hidden;
  }

  .productos-categories-toggle {
    min-height: 50px;
    margin: 0;
    padding: 14px 16px;
    gap: 9px;
    cursor: pointer;
    touch-action: manipulation;
  }

  .productos-categories-toggle-meta {
    display: inline-block;
    flex: 0 0 auto;
    color: #777;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
  }

  .productos-categories-toggle > i {
    display: inline-block;
    flex: 0 0 auto;
    color: #555;
    font-size: 16px;
    transition: transform .2s ease;
  }

  .productos-tree {
    display: none;
    max-height: 380px;
    max-height: min(58vh, 380px);
    padding: 10px 14px 14px;
    border-top: 1px solid #e7e8ea;
    overflow-y: auto;
    overscroll-behavior: auto;
  }

  .productos-sidebar.is-mobile-open .productos-tree {
    display: block;
  }

  .productos-sidebar.is-mobile-open .productos-categories-toggle > i {
    transform: rotate(180deg);
  }
}


/* Ajuste v10: grilla y títulos compactos en mobile */
@media (max-width: 600px) {
  .productos-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .producto-card {
    min-width: 0;
  }

  .producto-card-title {
    font-size: clamp(11px, 3.3vw, 14px);
    line-height: 1.25;
    white-space: normal;
    overflow: visible;
    overflow-wrap: break-word;
  }
}
