.PM_ASearchTitle,
.PM_ASBlockOutputHorizontal a,
.PM_ASBlockOutputVertical a {
    color: var(--primary-color);
}
.clear { clear: both; }
.PM_ASCriterionsGroupList p {
    margin: 0;
    padding: 0;
}

/* Sin overflow en contenedores padre */
div.PM_ASBlockOutput.PM_ASBlockOutputVertical {
    overflow: visible;
}

#facets-wrapper {
  background-color: var(--white);
  padding-top: var(--spacing-1);
  padding-bottom: var(--spacing-1);
  position: sticky;
  z-index: 2;
  overflow: visible;
}
aside#facets-wrapper::before {
        width: 100%;
        display: block;
        content: ' ';
        height: 100%;
        z-index: -1;
        position: absolute;
        top: 0;
        border-bottom: 1px solid var(--border-color);
        border-top: 1px solid var(--border-color);
        background-color: #fff;
        /*box-shadow: var(--shadowbottom)*/
    }
@media(min-width: 1640px) {
    aside#facets-wrapper::before {
        width: 200vw;
        margin-left: -50vw;
        margin-right: -50vw;
    }
}
@media(max-width: 600px) {
    aside#facets-wrapper {
        margin-right: -.538rem;
        margin-left: -.538rem;
    }
}
/* Wrapper con flechas */
.PM_ASScrollWrapper {
    position: relative;
    overflow: visible;
}

.PM_ASScrollWrapper .PM_ASScrollBtn {
    position: absolute;
    top: 0;
    height: 100%;
    width: 30px;
    border: none;
    cursor: pointer;
    z-index: 2;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 1.2rem;
}


/* Fila de botones: scroll horizontal sin scrollbar visible */
.PM_ASCriterionsGroupList {
    display: flex;
    flex-wrap: nowrap;
    gap: 1rem;
    position: relative;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.PM_ASCriterionsGroupList::-webkit-scrollbar {
    display: none;
}



p.PM_ASCriterionsGroupTitle {
    border: 1px solid var(--border-color);
    white-space: nowrap;
    padding: .5rem 1.25rem;
    border-radius: var(--btn-border-radius-xl);
    cursor: pointer;
}

.PM_ASForm button.select-title {
    white-space: nowrap;
}

/* Cada grupo no se encoge */
.PM_ASCriterionsGroup {
    position: relative;
    flex-shrink: 0;
}

/* Dropdown con position fixed para escapar del overflow */
.PM_ASCriterions.dropdown .dropdown-menu {
    min-width: 300px;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 4px 23px 0 rgba(0, 0, 0, 0.15);
    border-radius: var(--border-radius-sm);
    background-color: var(--white);
    font-size: var(--font-size-sm);
    padding: 1.25rem;
    top: 2px;
}

span.counter {
    display: inline-block;
    aspect-ratio: 1 / 1;
    background: var(--primary-color);
    color: var(--white);
    font-size: 12px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    line-height: 18px;
    text-align: center;
}

.PM_ASCriterionsGroupName::after {
    display: inline-block;
    font: normal normal normal 1em / 1 'Iturri';
    color: inherit;
    flex-shrink: 0;
    font-size: 1rem;
    -webkit-font-smoothing: antialiased;
    content: "\f550";
}

.PM_ASCriterionsGroupName {
    display: flex;
    align-items: center;
    gap: 10px;
}

.PM_ASCriterionsGroupInner ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
}
.PM_ASCriterionsGroupInner ul li {
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 0;
}
.PM_ASCriterionsGroupInner ul li:last-child {
	border-bottom: none;
	padding-bottom: 0;
}
.PM_ASCriterionsGroupInner ul li:first-child {
	padding-top: 0;
}

.PM_ASCriterionsGroupInner ul label {
    margin: 0;
}
.PM_ASCriterionNbProduct {
    opacity: 0.5;
}
a.PM_ASLabelLink {
    display: flex;
    gap: 12px;
    border: none;
    justify-content: space-between;
}
.PM_ASCriterionGroupCheckbox .checkbox, .PM_ASCriterionGroupCheckbox .radio {
    display: flex;
    justify-content: space-between;
    text-align: left;
    align-items: flex-start;
}
.PM_ASCriterionGroupCheckbox .checkbox input[type=checkbox], .PM_ASCriterionGroupCheckbox .radio input[type=radio] {
    margin-top: 2px;
}
.PM_ASCriterionsGroupInner ul label {
    width: 100%;
    max-width: 100%; 
}

body a.PM_ASResetSearch, .PM_ASBlockOutputVertical a.PM_ASResetSearch {
    white-space: nowrap;
    padding: 0.5rem 1rem;
    background-color: var(--white);
    font-size: var(--font-size-sm);
    margin-bottom: 1px;
    position: relative;
    z-index: 3; 
    color: var(--brand) !important;
    height: 50px;
    max-width: 150px;
    overflow: initial;
}
.d-flex-filters {
    display: flex;
    overflow-x: auto;
}

#facets-wrapper .PM_ASCriterionsGroupList > .js-filter:nth-child(n+7) {
  display: none;
}

#facets-wrapper.js-view-all-filters-result .PM_ASCriterionsGroupList > .js-filter:nth-child(n+7) {
  display: block;
}

#facets-wrapper.js-view-all-filters-result .js-view-all-filters {
  display: none;
}
aside#facets-wrapper.js-view-all-filters-result .PM_ASCriterionsGroupList {
    flex-wrap: wrap;
}
.PM_ASCriterionsOutput .dropdown .dropdown-menu  {
    transition: none !important;
}
.js-view-all-filters {
    white-space: nowrap;
}

.PM_ASCriterions.dropdown.as4-dropdown-open {
    position: relative;
    z-index: 50;
}

.PM_ASCriterions.dropdown.as4-dropdown-open > .dropdown-menu.PM_ASCriterionsGroupOuter,
 {
    position: absolute !important;
    z-index: 60 !important;
    display: block;
    box-sizing: border-box;
    width: 280px !important;
    max-height: 300px !important;
    padding: var(--space-2, var(--spacing-2, 1rem)) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    transform: none !important;
    inset: auto auto auto auto !important;
}

.PM_ASCriterionsGroupInner {
    max-height: 300px;
    overflow-y: auto;
    padding: 1rem;
    width: 300px; 
}
#facets-wrapper.as4-filters-static, #facets-wrapper.js-view-all-filters-result {
    position: fixed !important;
    left: auto;
    right: 0;
    width: 100vw; 
    max-width: 500px;
    z-index: 1001;
    top: 0 !important;
    overflow-y: auto;
    padding: var(--space-3);
    height: 100dvh;
    box-shadow: rgba(255, 255, 255, 0.1) 0px 1px 1px 0px inset, rgba(50, 50, 93, 0.25) 0px 50px 100px -20px, rgba(0, 0, 0, 0.3) 0px 30px 60px -30px;
}
#facets-wrapper.js-view-all-filters-result::before {
    display: none;
}

.filters-side-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
    padding-bottom: var(--space-1);
    margin-bottom: var(--space-2);
    border-bottom: 1px solid var(--border-color);
}

.filters-side-panel-header .js-filters-side-panel-close {
    font-size: 1.5rem;
    line-height: 1;
    color: inherit;
    background: transparent;
    border: 0;
    cursor: pointer;
    width: 50px; 
}

#facets-wrapper:not(.js-view-all-filters-result) .filters-side-panel-header {
    display: none;
}

#facets-wrapper.js-view-all-filters-result .PM_ASForm button.select-title {
    white-space: initial;
    text-align: left;
}

#facets-wrapper.js-view-all-filters-result .d-flex-filters {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    gap: 1rem;
}
#facets-wrapper.js-view-all-filters-result .d-flex-filters .PM_ASCriterionsGroupList {
    display: flex;
    flex-direction: column;
}

.d-flex-filters .PM_ASCriterionsGroupName::after {
    font-size: 1.5rem;
}

.btn-small-rounded.select-title:has(.counter) {
  background-color: var(--bg-light-gray);
  border-color: var(--primary);
  color: var(--primary);
}

/* Línea de filtros aplicados bajo el h1 del header */
.PM_ASActiveFilters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
    margin-top: var(--gap-vertical-small);
    margin-bottom: var(--gap-vertical-small);
}

.PM_ASActiveFilters--empty {
    margin: 0;
}

.PM_ASActiveFilter {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    min-height: 2.25rem;
    padding: var(--space-1) var(--space-2);
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--btn-border-radius-xl);
    font-family: inherit;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--dark);
    line-height: 1.2;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.PM_ASActiveFilter:hover,
.PM_ASActiveFilter:focus {
    border-color: var(--danger);
    color: var(--danger);
    outline: none;
}

.PM_ASActiveFilterLabel {
    white-space: nowrap;
}

.PM_ASActiveFilterRemove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    line-height: 1;
    color: var(--neutral-700);
    transition: color 0.2s ease;
}

.PM_ASActiveFilter:hover .PM_ASActiveFilterRemove,
.PM_ASActiveFilter:focus .PM_ASActiveFilterRemove {
    color: var(--danger);
}

.PM_ASActiveFiltersClear {
    margin-left: var(--space-1);
    padding: var(--space-1) var(--space-2);
    min-height: 2.25rem;
    background: transparent;
    border: 0;
    color: var(--neutral-700);
    font-family: inherit;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    text-decoration: underline;
    cursor: pointer;
    transition: color 0.2s ease;
}

.PM_ASActiveFiltersClear:hover,
.PM_ASActiveFiltersClear:focus {
    color: var(--primary);
    outline: none;
}

