/*
 * Conversionauts PrestaShop Theme
 * Copyright (c) 2026 Conversionauts (conversionauts.pl)
 * Licensed for use on one store only. Unauthorized distribution, resale, or modification prohibited.
 * All rights reserved.
 *
 * Theme override of pm_advancedsearch4's own stylesheet (see AbstractAssetManager::getFullPath()
 * override-by-same-relative-path mechanism). Visual styling now lives in Tailwind utility classes
 * on the overridden .tpl files (views/templates/hummingbird/hook/9/) and in
 * src/css/components/advanced-search.css. What remains here is functional CSS that JS depends on
 * (initial hidden states before jQuery ever runs, the blur/spinner overlay classes injected at
 * runtime by as4_plugin-17.js, and the noUiSlider color/size skin layered on top of the vendor
 * nouislider.min.css engine, which is NOT overridden here). Do not remove class selectors below
 * even though they render no color: the JS toggles them by name.
 */

/* Hidden and disabled criteria (opacity dimming for out-of-stock/unavailable options) */
.PM_ASCriterionDisable {
    opacity: .5;
}
.PM_ASCriterionsSEOGroupDisabled,
.PM_ASCriterionsSEOGroupDisabled a,
.PM_ASCriterionsSEOGroupDisabled input {
    cursor: default;
}

/* Criterion display: initial hidden state before slideToggle/slideDown ever runs */
.PM_ASCriterionHide,
li.PM_ASCriterionHide {
    display: none;
}
.PM_ASCriterionsGroupHidden {
    display: none;
}
.PM_ASHide {
    display: none;
}

/* Category tree open/close icon swap (li span.grower > i.add / i.remove) */
.PM_ASLevelDepth li span.grower.PM_ASCriterionClose .add,
.PM_ASLevelDepth li span.grower.PM_ASCriterionOpen .remove {
    display: block;
}
.PM_ASLevelDepth li span.grower.PM_ASCriterionClose .remove,
.PM_ASLevelDepth li span.grower.PM_ASCriterionOpen .add {
    display: none;
}
.PM_ASLevelDepth li span.grower i {
    display: none;
}
.as4-toggle-icon svg,
.grower i svg {
    width: 100%;
    height: 100%;
}

/* Whole-panel mobile collapse (class toggled by as4Plugin on .card-header click).
   Scoped to .card-header specifically - .as4-toggle-icon is reused on the per-group accordion
   buttons in pm_advancedsearch_criterions.tpl, which must stay visible on desktop too. */
.PM_ASBlockOutput.PM_ASMobileMode .PM_ASBlockContent {
    display: none;
}
.PM_ASBlockOutput.PM_ASMobileMode.PM_ASMobileVisible .PM_ASBlockContent {
    display: block;
}
.PM_ASBlockOutput:not(.PM_ASMobileMode) .card-header .as4-toggle-icon {
    display: none;
}
.card-header .as4-toggle-icon {
    transition: transform .2s ease;
}
.PM_ASBlockOutput.PM_ASMobileMode.PM_ASMobileVisible .card-header .as4-toggle-icon {
    transform: rotate(180deg);
}

/* Per-group accordion chevron rotation is already handled by the sitewide .accordion[aria-expanded="true"] svg
   rule in src/css/components/accordion.css - do not add a second rotate rule here, it double-rotates (360deg). */

/* Reset-group trash icon: center + size it (the raw svg carries its own 24x24 attributes) */
.PM_ASResetGroup {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.PM_ASResetGroup svg {
    width: 100%;
    height: 100%;
}

/* Native (non-selectize) criterion selects: swap the OS-default arrow for the sitewide chevron-down */
.PM_ASCriterionGroupSelect:not(.as4-select) {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}
.as4-select-wrapper {
    position: relative;
}
.as4-select-wrapper > .as4-select-chevron {
    position: absolute;
    top: 50%;
    right: .75rem;
    width: .875rem;
    height: .875rem;
    transform: translateY(-50%);
    pointer-events: none;
}
.as4-select-wrapper > .as4-select-chevron svg {
    width: 100%;
    height: 100%;
}

/* Range slider: color/size skin on top of the vendor noUiSlider engine (nouislider.min.css) */
.PM_ASCritRange {
    max-width: 94%;
    height: 4px;
    margin-left: auto;
    margin-right: auto;
}
.PM_ASCritRange.noUi-target {
    background: #e5e5e5;
    border: none;
    border-radius: 4px;
    box-shadow: none;
}
.PM_ASCritRange .noUi-connect {
    background: #111111;
}
.PM_ASCritRange.noUi-horizontal .noUi-handle {
    width: 16px;
    height: 16px;
    right: -8px;
    top: -6px;
    background: #ffffff;
    border: 2px solid #111111;
    border-radius: 50%;
    box-shadow: none;
    cursor: pointer;
}
.PM_ASCritRange .noUi-handle:before,
.PM_ASCritRange .noUi-handle:after {
    display: none;
}

/* Loading overlay injected at runtime by as4Plugin.setLayer()/removeLayer() */
.as4-loader-blur {
    filter: blur(2px);
}
.PM_ASBlockOutput {
    position: relative;
}
.as4-loader {
    display: block;
    width: 2rem;
    height: 2rem;
    margin: 2rem auto;
    border-radius: 50%;
    border: 2px solid #d6d4d4;
    border-top-color: #111111;
    animation: as4loader .8s linear infinite;
}
@keyframes as4loader {
    to { transform: rotate(360deg); }
}

/* Scrollbar cosmetics for an admin-configured max-height/overflow criterion list */
.PM_ASCriterionsGroupOuter::-webkit-scrollbar {
    width: 5px;
}
.PM_ASCriterionsGroupOuter::-webkit-scrollbar-track {
    border-radius: 10px;
}
.PM_ASCriterionsGroupOuter::-webkit-scrollbar-thumb {
    border-radius: 10px;
    background: rgba(0,0,0,0.4);
}
.PM_ASCriterionsGroupOuter::-webkit-scrollbar-thumb:window-inactive {
    background: rgba(0,0,0,0.2);
}
