/* ==========================================================
   WRAPPER GENERAL
========================================================== */
.ynec-filters-wrapper {
    border-radius: 16px;
    padding: 16px 18px 20px;
    font-size: 14px;
    background: #ffffff;
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}

/* ==========================================================
   BUSCADOR
========================================================== */
.ynec-filter-search {
    margin-bottom: 12px;
    padding: 0 10px;
}
.ynec-filter-search-label {
    display: block;
    font-size: 13px;
    margin-bottom: 4px;
    font-weight: 600;
}
.ynec-filter-search-input-wrap {
    position: relative;
}
.ynec-search-input {
    width: 100%;
    padding: 8px 10px;
    padding-right: 34px;
    border-radius: 999px;
    border: 1px solid #ddd;
    font-size: 13px;
    background: #fafafa;
}

/* ==========================================================
   ACCORDIONS
========================================================== */
.ynec-accordion + .ynec-accordion {
    border-top: 1px solid #f1f1f1;
    margin-top: 8px;
    padding-top: 8px;
}

.ynec-acc-header {
    width: 100%;
    border: 0;
    background: transparent;
    padding: 8px 10px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
}

/* Flechas nuevas */
.ynec-acc-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    background: #f3f3f3;
    margin-left: 8px;
    transition: background 0.2s ease, transform 0.2s ease;
    font-size: 13px;
}

.ynec-acc-arrow::before {
    content: "▾";
    color: #555;
    line-height: 1;
    transition: transform 0.2s ease, color 0.2s ease;
}

.ynec-acc-header:hover .ynec-acc-arrow {
    background: #e4e4e4;
}

.ynec-acc-header:hover .ynec-acc-arrow::before {
    color: #222;
}

/* Rotación en acordeón abierto */
.ynec-accordion.ynec-acc-open .ynec-acc-arrow::before {
    transform: rotate(180deg);
}

.ynec-acc-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease-out, opacity 0.2s ease-out;
    opacity: 0;
}
.ynec-accordion.ynec-acc-open .ynec-acc-body {
    max-height: 1000px;
    opacity: 1;
    margin-bottom: 8px;
}

/* ==========================================================
   BLOQUES
========================================================== */
.ynec-filter-block {
    margin: 4px 0 10px;
    padding: 0 10px;
}
.ynec-filter-title {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 13px;
}
.ynec-filter-body {
    font-size: 13px;
}
.ynec-select {
    width: 100%;
    padding: 8px 10px;
    border-radius: 999px;
    border: 1px solid #ddd;
    font-size: 13px;
    background: #fafafa;
}

.ynec-filter-scroll {
    max-height: 180px;
    overflow-y: auto;
    padding-right: 4px;
}
.ynec-filter-column {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* ==========================================================
   CHECKBOX NORMAL (precio, descuentos, talla, otros atributos)
========================================================== */
.ynec-filter-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    cursor: pointer;
}

.ynec-filter-checkbox input[type="checkbox"] {
    margin: 0;
}

.ynec-checkbox-box {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1px solid #c4c4c4;
    position: relative;
    display: inline-block;
    background: #fff;
    flex-shrink: 0;
}

.ynec-filter-checkbox input:checked + .ynec-checkbox-box {
    border-color: #111827;
    background: #111827;
}

.ynec-filter-checkbox input:checked + .ynec-checkbox-box::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 10px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: translate(-50%, -55%) rotate(45deg);
}

/* ==========================================================
   CATEGORÍAS — SANGRÍA + SCROLL (FIX REAL)
========================================================== */
.ynec-cat-pills {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 50rem;
    overflow-y: auto;
    padding-right: 6px;
}

.ynec-cat-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    font-size: 13px;
    cursor: pointer;
    margin-bottom: 4px;
}

.ynec-cat-pill.level-0 { padding-left: 0; }
.ynec-cat-pill.level-1 { padding-left: 16px; }
.ynec-cat-pill.level-2 { padding-left: 32px; }
.ynec-cat-pill.level-3 { padding-left: 48px; }
.ynec-cat-pill.level-4 { padding-left: 64px; }

.ynec-cat-pill input[type="checkbox"] {
    margin: 0 4px 0 0;
}

/* Scroll bonito para categorías (opcional pero queda fino) */
.ynec-cat-pills::-webkit-scrollbar {
    width: 6px;
}
.ynec-cat-pills::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}
.ynec-cat-pills::-webkit-scrollbar-thumb:hover {
    background: #bbb;
}

/* ==========================================================
   COLORES — SWATCH
========================================================== */
.ynec-color-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13px;
    position: relative;
}

.ynec-color-filter input[type="checkbox"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    margin: 0;
    cursor: pointer;
}

.ynec-color-filter .ynec-color-swatch,
.ynec-color-filter .ynec-color-name {
    pointer-events: none;
}

.ynec-color-swatch {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    display: inline-block;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.07);
    flex-shrink: 0;
    box-sizing: border-box;
    position: relative;
}

.ynec-color-filter input[type="checkbox"]:checked + .ynec-color-swatch {
    border-color: #111827;
    box-shadow: 0 0 0 2px #111827;
}

.ynec-color-filter input[type="checkbox"]:checked + .ynec-color-swatch::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 12px;
    border: 2px solid #ffffff;
    border-top: none;
    border-left: none;
    transform: translate(-50%, -60%) rotate(45deg);
}

.ynec-color-name {
    display: inline-block;
    margin-left: 4px;
}

.ynec-color-filter input[type="checkbox"]:checked ~ .ynec-color-name {
    font-weight: 600;
}

/* ==========================================================
   DOBLE RANGO PRECIO
========================================================== */
.ynec-slider-labels {
    font-size: 12px;
    color: #4b5563;
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
}
.ynec-double-range {
    position: relative;
    height: 24px;
    margin: 10px 0 4px;
}
.ynec-double-range-track {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 4px;
    transform: translateY(-50%);
    background: #e5e7eb;
    border-radius: 999px;
}
.ynec-double-range-range {
    position: absolute;
    top: 50%;
    height: 4px;
    transform: translateY(-50%);
    background: #111827;
    border-radius: 999px;
}
.ynec-range-input {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    width: 100%;
    margin: 0;
    background: transparent;
    pointer-events: none;
}
.ynec-range-input::-webkit-slider-thumb { pointer-events: auto; }
.ynec-range-input::-moz-range-thumb { pointer-events: auto; }
.ynec-range-input.ynec-range-min { z-index: 2; }
.ynec-range-input.ynec-range-max { z-index: 3; }

.ynec-slider-help {
    font-size: 11px;
    color: #6b7280;
    margin-top: 4px;
}

/* ==========================================================
   BOTONES
========================================================== */
.ynec-filter-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    padding: 0 10px;
}

.ynec-btn {
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
}

.ynec-btn-primary {
    background: #111827;
    color: #ffffff;
    border-color: #111827;
    flex: 1;
    text-align: center;
}
.ynec-btn-primary:hover {
    background: #000000;
}

.ynec-btn-secondary {
    background: #ffffff;
    color: #111827;
    border-color: #d1d5db;
    flex: 1;
    text-align: center;
}
.ynec-btn-secondary:hover {
    background: #f3f4f6;
}

/* ==========================================================
   RESPONSIVE
========================================================== */
@media (max-width: 768px) {
    .ynec-filters-wrapper {
        padding: 12px 14px 14px;
    }
    
    .ynec-filter-actions {
        flex-direction: column;
    }

    .ynec-btn {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
    }
    
    .ynec-btn-secondary {
        justify-content: center;
    }
    
    .ynec-cat-pills {
        max-height: 220px;
    }
}

.ynec-color-filter{
    padding-left: 10px;
}

.ynec-acc-header{
  position: relative;
  z-index: 3;
  touch-action: manipulation;
}
.ynec-acc-arrow{
  pointer-events: none;
}

.ynec-filters-wrapper label.ynec-filter-checkbox,
.ynec-filters-wrapper label.ynec-filter-checkbox * {
  pointer-events: auto !important;
  cursor: pointer;
}

.ynec-filters-wrapper.ynec-is-loading {
  opacity: .6;
  pointer-events: none;
  position: relative;
}
.ynec-filters-wrapper.ynec-is-loading::after {
  content: "Cargando productos...";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-weight: 600;
  background: rgba(255,255,255,.6);
  border-radius: 16px;
}
