/* ============================================
   PLP B2B — Filtro Panel
   ============================================ */

/* ---- DESKTOP SIDEBAR ---- */
.plp-filtro-panel {
  display: flex;
  width: 266px;
  min-width: 266px;
  padding: 24px;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  border-radius: 12px;
  background: #F6F6F6;
  box-sizing: border-box;
  align-self: flex-start;
  position: sticky;
  top: 24px;
}

/* Header del filtro */
.plp-filtro-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.plp-filtro-title {
  color: var(--ICO-Celeste);
  font-family: 'Avenir Next LT Pro', sans-serif;
  font-size: 20px;
  font-style: normal;
  font-weight: 600;
  line-height: normal;
}

/* Botón borrar filtros — oculto por defecto */
.plp-filtro-clear-btn {
  display: none;
  padding: 10px 20px;
  align-items: flex-start;
  gap: 10px;
  border-radius: 30px;
  border: 1px solid var(--ICO-Celeste);
  color: var(--ICO-Celeste);
  font-family: 'Avenir Next LT Pro', sans-serif;
  font-size: 13px;
  font-weight: 400;
  line-height: normal;
  transition: color 0.2s ease;
  background-color: transparent;
  cursor: pointer;
}

.plp-filtro-clear-btn:visited {
  color: var(--ICO-Celeste);
}

.plp-filtro-clear-btn:hover,
.plp-filtro-clear-btn:focus {
  color: var(--ICO-Azul);
}

.plp-filtro-clear-btn.visible {
  display: flex;
}

/* Grupo de filtro */
.plp-filtro-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  margin-bottom: 24px;
}

.plp-filtro-group-title {
  color: var(--ICO-texto-mate);
  font-family: 'Avenir Next LT Pro', sans-serif;
  font-size: 16px;
  font-style: normal;
  font-weight: 700;
  line-height: 24px;
}

/* --- Navegación de categorías/subcategorías ---
   Estas opciones son enlaces de taxonomía, no filtros por query string. */
.plp-filtro-category-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.plp-filtro-category-link,
.plp-filtro-category-link:link,
.plp-filtro-category-link:visited {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 5px 0;
  color: var(--ICO-texto-mate);
  font-family: 'Avenir Next LT Pro', sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
  text-decoration: none;
  transition: color 0.2s ease, transform 0.2s ease;
}

.plp-filtro-category-link:hover,
.plp-filtro-category-link:focus-visible {
  color: var(--ICO-Celeste);
  text-decoration: none;
}

.plp-filtro-category-link:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
  border-radius: 4px;
}

.plp-filtro-category-link-arrow {
  flex: 0 0 auto;
  font-size: 22px;
  line-height: 1;
  transition: transform 0.2s ease;
}

.plp-filtro-category-link:hover .plp-filtro-category-link-arrow,
.plp-filtro-category-link:focus-visible .plp-filtro-category-link-arrow {
  transform: translateX(3px);
}

/* --- Custom Checkbox --- */
.plp-filtro-checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.plp-filtro-checkbox-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

/* Custom box */
.plp-filtro-checkbox-box {
  width: 16px;
  height: 16px;
  min-width: 16px;
  border-radius: 4px;
  border: 1px solid var(--ICO-Gris);
  background: var(--ICO-Blanco);
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background 0.2s ease, border-color 0.2s ease;
  flex-shrink: 0;
}

.plp-filtro-checkbox-input:checked+.plp-filtro-checkbox-box {
  background: var(--ICO-Celeste);
  border-color: var(--ICO-Celeste);
}

/* Check SVG */
.plp-filtro-checkbox-box::after {
  content: '';
  display: none;
  width: 16px;
  height: 16px;
  background-image: url('../../../../img/B2B/PLP/check_white.svg');
  background-size: 16px;
  background-position: center;
  background-repeat: no-repeat;
}

.plp-filtro-checkbox-input:checked+.plp-filtro-checkbox-box::after {
  display: block;
}

/* Texto del checkbox */
.plp-filtro-checkbox-text {
  color: var(--ICO-texto-mate);
  font-family: 'Avenir Next LT Pro', sans-serif;
  font-size: 16px;
  font-style: normal;
  font-weight: 400;
  line-height: 24px;
  transition: color 0.2s ease, font-weight 0.2s ease;
}

.plp-filtro-checkbox-input:checked~.plp-filtro-checkbox-text {
  color: var(--ICO-Celeste);
  font-weight: 600;
}

.plp-offcanvas-body .plp-filtro-checkbox-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.plp-filtro-price-wrapper {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.plp-filtro-price-values {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

.plp-filtro-price-val {
  color: var(--ICO-texto-mate);
  font-family: 'Avenir Next LT Pro', sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 24px;
}

.plp-filtro-price-range-container {
  position: relative;
  height: 20px;
  display: flex;
  align-items: center;
}

.plp-filtro-price-track {
  position: absolute;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--ICO-Gris);
  border-radius: 2px;
}

.plp-filtro-price-fill {
  position: absolute;
  height: 4px;
  background: var(--ICO-Celeste);
  border-radius: 2px;
  pointer-events: none;
}

.plp-filtro-price-input {
  position: absolute;
  width: 100%;
  height: 4px;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
  pointer-events: none;
  left: 0;
  right: 0;
}

.plp-filtro-price-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ICO-Celeste);
  cursor: pointer;
  pointer-events: auto;
  border: 2px solid #FFF;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.15s ease;
}

.plp-filtro-price-input::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ICO-Celeste);
  cursor: pointer;
  pointer-events: auto;
  border: 2px solid #FFF;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.plp-filtro-price-input::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

/* --- Botón Aplicar Filtros --- */
.plp-filtro-apply-btn {
  display: none;
  padding: 12px 0;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  align-self: stretch;
  width: 100%;
  border-radius: 26px;
  background: var(--ICO-Azul);
  border: none;
  cursor: pointer;
  color: var(--ICO-Blanco);
  text-align: center;
  font-family: 'Avenir Next LT Pro', sans-serif;
  font-size: 16px;
  font-style: normal;
  font-weight: 700;
  line-height: 24px;
  transition: background 0.2s ease, transform 0.15s ease;
}

.plp-filtro-apply-btn:hover {
  background: #0d5478;
}

.plp-filtro-apply-btn:active {
  transform: scale(0.98);
}

.plp-filtro-apply-btn.visible {
  display: flex;
}

/* ============================================
   OFF-CANVAS MOBILE FILTROS
   ============================================ */

/* Overlay */
.plp-offcanvas-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 999;
}

.plp-offcanvas-overlay.active {
  display: block;
}

/* Panel off-canvas */
.plp-offcanvas-panel {
  display: flex;
  width: 351px;
  max-width: 90vw;
  height: 100%;
  padding: 24px;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  border-radius: 0 12px 12px 0;
  background: #F6F6F6;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  transform: translateX(-110%);
  transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  overflow: hidden;
  box-sizing: border-box;
}

.plp-offcanvas-panel.active {
  transform: translateX(0);
}

/* Header del off-canvas */
.plp-offcanvas-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.plp-offcanvas-title {
  color: var(--ICO-Celeste);
  font-family: 'Avenir Next LT Pro', sans-serif;
  font-size: 20px;
  font-weight: 600;
  line-height: normal;
}

.plp-offcanvas-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  width: 26px;
  height: 26px;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  flex-shrink: 0;
}

.plp-offcanvas-close-btn img {
  width: 26px;
  height: 26px;
}

/* Botón borrar filtros mobile */
.plp-offcanvas-clear-btn {
  display: none;
  padding: 10px 20px;
  justify-content: center;
  align-items: center;
  gap: 10px;
  border-radius: 30px;
  border: 1px solid var(--ICO-Celeste);
  background: transparent;
  cursor: pointer;
  color: var(--ICO-Celeste);
  font-family: 'Avenir Next LT Pro', sans-serif;
  font-size: 14px;
  font-weight: 400;
  transition: all 0.2s ease;
}

.plp-offcanvas-clear-btn.visible {
  display: flex;
}

.plp-offcanvas-clear-btn:hover {
  background: var(--ICO-Celeste);
  color: #FFF;
}

/* Contenido de filtros dentro del off-canvas */
.plp-offcanvas-body {
  flex: 1;
  padding: 16px 0px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.plp-offcanvas-body::-webkit-scrollbar {
  display: none;
}

/* Footer del off-canvas */
.plp-offcanvas-footer {
  width: 100%;
  padding-top: 24px;
}

.plp-offcanvas-apply-btn {
  display: flex;
  padding: 12px 0;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  align-self: stretch;
  width: 100%;
  border-radius: 26px;
  background: var(--ICO-Azul);
  border: none;
  cursor: pointer;
  color: var(--ICO-Blanco);
  text-align: center;
  font-family: 'Avenir Next LT Pro', sans-serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 24px;
  transition: background 0.2s ease;
}

.plp-offcanvas-apply-btn:hover {
  background: #0d5478;
}

/* Solo mostrar off-canvas en mobile */
.plp-offcanvas-overlay,
.plp-offcanvas-panel {
  display: none;
  visibility: hidden;
}

.plp-filtro-content-group {
  width: 100%;
}

@media (max-width: 1023px) {

  .plp-offcanvas-overlay,
  .plp-offcanvas-panel {
    display: flex;
    visibility: visible;
  }

  .plp-offcanvas-overlay {
    display: none;
  }

  .plp-offcanvas-overlay.active {
    display: block;
  }

  /* Ocultar filtro sidebar en mobile */
  .plp-filtro-panel {
    display: none !important;
  }

  .plp-offcanvas-checkbox-input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
  }

  .plp-offcanvas-checkbox-input:checked+.plp-filtro-checkbox-box {
    background-color: var(--ICO-Celeste);
    border-color: var(--ICO-Celeste);
    background-image: url('../../../../img/B2B/PLP/check_white.svg');
    background-size: 16px;
  }

  .plp-offcanvas-checkbox-input:checked~.plp-filtro-checkbox-text {
    color: var(--ICO-Celeste);
    font-weight: 600;
  }

  .plp-filtro-group {
    margin-bottom: 0px;
  }
}