/**
 * Amazzing Filter for Creative Elements — front styles
 * @author Z Digital
 */
:root {
    --zdaf-accent: #111;
    --zdaf-text: #1f2328;
    --zdaf-muted: #8a8f98;
    --zdaf-border: #e5e7eb;
    --zdaf-soft: #f4f5f7;
    --zdaf-radius: 8px;
    --zdaf-panel-w: 360px;
    --zdaf-panel-bg: #fff;
    --zdaf-overlay: rgba(0, 0, 0, .45);
}

.zdaf {
    position: relative;
}

/* ---------- Base (inline filter) ---------- */
.zdaf-toggle-wrap,
.zdaf-overlay,
.zdaf-panel-head,
.zdaf-panel-foot {
    display: none;
}

.zdaf-title {
    margin: 0 0 14px;
}

/* Remove AF's own box so the widget style controls apply cleanly */
.zdaf--reset .zdaf-body #amazzing_filter.block {
    background: none !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.zdaf--no-af-title .zdaf-body #amazzing_filter > .title_block {
    display: none !important;
}

.zdaf--no-dividers .zdaf-body #amazzing_filter .af_filter {
    border-bottom: 0 !important;
}

.zdaf--no-count .zdaf-body #amazzing_filter .count {
    display: none !important;
}

.zdaf--no-toggle-icon .zdaf-body #amazzing_filter .af_subtitle.toggle-content:before {
    display: none !important;
}

/* Sticky (desktop). The class is set on the CE widget element by JS. */
@media (min-width: 1025px) {
    .zdaf-sticky-host {
        position: -webkit-sticky;
        position: sticky;
        top: var(--zdaf-sticky-top, 20px);
        align-self: flex-start;
        z-index: 3;
    }

    .zdaf-sticky-host .zdaf--sticky-scroll:not(.zdaf--oc-always) .zdaf-body {
        max-height: calc(100vh - var(--zdaf-sticky-top, 20px) - 20px);
        overflow-y: auto;
        overscroll-behavior: contain;
    }
}

/* ---------- Off-canvas pieces (look) ---------- */
.zdaf-toggle-wrap {
    justify-content: flex-start;
}

.zdaf-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    background: #fff;
    color: #111;
    font: inherit;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: box-shadow .2s ease, transform .2s ease;
}

.zdaf-toggle:hover {
    box-shadow: 0 4px 14px rgba(0, 0, 0, .08);
}

.zdaf--toggle-full .zdaf-toggle {
    width: 100%;
}

.zdaf-badge {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: var(--zdaf-accent);
    color: #fff;
    font-size: 12px;
    line-height: 20px;
    text-align: center;
}

.zdaf-badge[hidden] {
    display: none !important;
}

.zdaf-panel-head {
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--zdaf-divider, var(--zdaf-border));
}

.zdaf-panel-title {
    font-size: 18px;
    font-weight: 700;
}

.zdaf-close {
    display: inline-flex;
    padding: 4px;
    border: 0;
    background: none;
    color: inherit;
    cursor: pointer;
}

.zdaf-panel-foot {
    padding: 14px 20px calc(14px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--zdaf-divider, var(--zdaf-border));
}

.zdaf-apply {
    width: 100%;
    padding: 13px 18px;
    border: 0;
    border-radius: 8px;
    background: var(--zdaf-accent);
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.zdaf-overlay {
    position: fixed;
    inset: 0;
    z-index: 99998;
    background: var(--zdaf-overlay);
    opacity: 0;
    transition: opacity .25s ease;
}

.zdaf-overlay.is-open {
    opacity: 1;
}

html.zdaf-lock,
html.zdaf-lock body {
    overflow: hidden !important;
}

/* ---------- Off-canvas behaviour (repeated per breakpoint) ---------- */

/* All devices */
.zdaf--oc-always .zdaf-toggle-wrap { display: flex; }
.zdaf--oc-always .zdaf-overlay:not([hidden]) { display: block; }
.zdaf--oc-always .zdaf-panel-head,
.zdaf--oc-always .zdaf-panel-foot { display: flex; }
.zdaf--oc-always .zdaf-panel {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 99999;
    display: flex; flex-direction: column;
    width: min(var(--zdaf-panel-w), 100vw); max-width: 100vw;
    background: var(--zdaf-panel-bg);
    box-shadow: 0 0 40px rgba(0, 0, 0, .18);
    transform: translateX(-105%); visibility: hidden;
    transition: transform .3s ease, visibility 0s linear .3s;
}
.zdaf--oc-always.zdaf--side-right .zdaf-panel { left: auto; right: 0; transform: translateX(105%); }
.zdaf--oc-always .zdaf-panel.is-open { transform: none; visibility: visible; transition: transform .3s ease; }
.zdaf--oc-always .zdaf-panel > .zdaf-title,
.zdaf--oc-always .zdaf-panel > .zdaf-body { margin-left: 20px; margin-right: 20px; }
.zdaf--oc-always .zdaf-panel > .zdaf-title { margin-top: 16px; }
.zdaf--oc-always .zdaf-body { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; padding-top: 8px; padding-bottom: 16px; }

/* Mobile and tablet */
@media (max-width: 1024px) {
    .zdaf--oc-tablet .zdaf-toggle-wrap { display: flex; }
    .zdaf--oc-tablet .zdaf-overlay:not([hidden]) { display: block; }
    .zdaf--oc-tablet .zdaf-panel-head,
    .zdaf--oc-tablet .zdaf-panel-foot { display: flex; }
    .zdaf--oc-tablet .zdaf-panel {
        position: fixed; top: 0; bottom: 0; left: 0; z-index: 99999;
        display: flex; flex-direction: column;
        width: min(var(--zdaf-panel-w), 100vw); max-width: 100vw;
        background: var(--zdaf-panel-bg);
        box-shadow: 0 0 40px rgba(0, 0, 0, .18);
        transform: translateX(-105%); visibility: hidden;
        transition: transform .3s ease, visibility 0s linear .3s;
    }
    .zdaf--oc-tablet.zdaf--side-right .zdaf-panel { left: auto; right: 0; transform: translateX(105%); }
    .zdaf--oc-tablet .zdaf-panel.is-open { transform: none; visibility: visible; transition: transform .3s ease; }
    .zdaf--oc-tablet .zdaf-panel > .zdaf-title,
    .zdaf--oc-tablet .zdaf-panel > .zdaf-body { margin-left: 20px; margin-right: 20px; }
    .zdaf--oc-tablet .zdaf-panel > .zdaf-title { margin-top: 16px; }
    .zdaf--oc-tablet .zdaf-body { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; padding-top: 8px; padding-bottom: 16px; }
}

/* Mobile */
@media (max-width: 767px) {
    .zdaf--oc-mobile .zdaf-toggle-wrap { display: flex; }
    .zdaf--oc-mobile .zdaf-overlay:not([hidden]) { display: block; }
    .zdaf--oc-mobile .zdaf-panel-head,
    .zdaf--oc-mobile .zdaf-panel-foot { display: flex; }
    .zdaf--oc-mobile .zdaf-panel {
        position: fixed; top: 0; bottom: 0; left: 0; z-index: 99999;
        display: flex; flex-direction: column;
        width: min(var(--zdaf-panel-w), 100vw); max-width: 100vw;
        background: var(--zdaf-panel-bg);
        box-shadow: 0 0 40px rgba(0, 0, 0, .18);
        transform: translateX(-105%); visibility: hidden;
        transition: transform .3s ease, visibility 0s linear .3s;
    }
    .zdaf--oc-mobile.zdaf--side-right .zdaf-panel { left: auto; right: 0; transform: translateX(105%); }
    .zdaf--oc-mobile .zdaf-panel.is-open { transform: none; visibility: visible; transition: transform .3s ease; }
    .zdaf--oc-mobile .zdaf-panel > .zdaf-title,
    .zdaf--oc-mobile .zdaf-panel > .zdaf-body { margin-left: 20px; margin-right: 20px; }
    .zdaf--oc-mobile .zdaf-panel > .zdaf-title { margin-top: 16px; }
    .zdaf--oc-mobile .zdaf-body { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; padding-top: 8px; padding-bottom: 16px; }
}

/* ---------- Editor notice ---------- */
.zdaf-notice {
    margin: 0 0 12px;
    padding: 10px 12px;
    border: 1px dashed #93b4e8;
    border-radius: 6px;
    background: #f1f6fe;
    color: #2a4a7a;
    font-size: 12px;
    line-height: 1.45;
}

/* Minimal base for the simulated filter in the editor (AF's CSS is not loaded there) */
.zdaf-mock .title_block { margin: 0 0 10px; font-size: 1.3em; font-weight: 600; }
.zdaf-mock .selectedFilters { margin: 0 0 10px; }
.zdaf-mock .selectedFilters .cf { position: relative; display: inline-block; margin: 0 6px 6px 0; padding: 7px 25px 7px 8px; background: #eceff0; line-height: 1; }
.zdaf-mock .selectedFilters .cf a { position: absolute; right: 8px; color: inherit; text-decoration: none; }
.zdaf-mock .selectedFilters .cf a:before { content: "\00d7"; }
.zdaf-mock .clearAll { padding: 6px 0; }
.zdaf-mock .clearAll a { color: inherit; }
.zdaf-mock .af_filter { position: relative; padding: 8px 0; border-bottom: 1px solid #d0d5db; }
.zdaf-mock .af_subtitle { position: relative; margin-bottom: 6px; font-weight: 600; cursor: pointer; }
.zdaf-mock .af_subtitle.toggle-content:before { content: ""; position: absolute; top: 50%; right: 3px; width: 7px; height: 7px; margin-top: -2px; border: solid #aab2bd; border-width: 2px 0 0 2px; transform: rotate(45deg); }
.zdaf-mock ul { margin: 0; padding: 0; list-style: none; }
.zdaf-mock li { padding: 3px 0; }
.zdaf-mock label { display: flex; align-items: center; margin: 0; cursor: pointer; }
.zdaf-mock .name { padding-left: 5px; }
.zdaf-mock .count { margin-left: auto; padding-left: 3px; color: #aab2bd; }
.zdaf-mock .count:before { content: "("; }
.zdaf-mock .count:after { content: ")"; }
.zdaf-mock .af_filter.tb li { display: inline-block; margin: 0 4px 4px 0; padding: 6px; border: 2px solid #d0d5db; border-radius: 5px; line-height: 1; }
.zdaf-mock .af_filter.tb li.active { border-color: #aab2bd; background: #f1f3f4; }
.zdaf-mock .af_filter.tb input { display: none; }
.zdaf-mock .af_filter.tb .name { padding: 0; }
.zdaf-mock .af-inline-colors li { display: inline-block; margin: 2px 6px 2px 0; }
.zdaf-mock .af-color-box { display: inline-block; width: 25px; height: 25px; border-radius: 50%; box-shadow: inset 0 0 4px rgba(0, 0, 0, .2); }
.zdaf-mock .af-color-box input,
.zdaf-mock .af-inline-colors .name,
.zdaf-mock .af-inline-colors .count { display: none; }
.zdaf-mock .slider-bar { position: relative; height: 7px; margin: 10px 8px 14px; border-radius: 5px; background: #eee; }
.zdaf-mock .selected-bar { position: absolute; top: 0; bottom: 0; left: 20%; right: 25%; background: #d0d5db; }
.zdaf-mock .pointer { position: absolute; top: -5px; width: 16px; height: 16px; margin-left: -8px; border: 5px solid #aab2bd; border-radius: 50%; background: #eceff0; box-sizing: border-box; }
.zdaf-mock .slider-values { display: flex; justify-content: space-between; }
.zdaf-mock .btn { display: inline-block; margin-top: 10px; padding: 8px 14px; border: 1px solid #ccc; background: #f6f6f6; font-size: 12px; text-transform: uppercase; }

/* =====================================================================
 * Modern design ("Diseño moderno"). Scope: .zdaf-skin on the widget, or on
 * <html> for the global option of the module configuration.
 * ===================================================================== */

.zdaf-skin #amazzing_filter {
    color: var(--zdaf-text);
}

.zdaf-skin #amazzing_filter.block .title_block {
    margin: 0 0 12px;
    font-size: 17px;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
}

.zdaf-skin #amazzing_filter .af_filter {
    margin: 0;
    padding: 14px 0;
    border-bottom: 1px solid var(--zdaf-divider, var(--zdaf-border));
}

.zdaf-skin #amazzing_filter .af_filter:last-child {
    border-bottom: 0;
}

.zdaf-skin #amazzing_filter .af_subtitle {
    position: relative;
    margin: 0 0 10px;
    padding-right: 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--zdaf-text);
}

.zdaf-skin #amazzing_filter .closed .af_subtitle {
    margin-bottom: 0;
}

.zdaf-skin #amazzing_filter .af_subtitle.toggle-content:before {
    right: 4px;
    width: 8px;
    height: 8px;
    border-color: var(--zdaf-muted);
    transition: transform .2s ease;
}

.zdaf-skin #amazzing_filter .af_filter li {
    padding: 4px 0;
}

.zdaf-skin #amazzing_filter .af_filter label {
    align-items: center;
    gap: 10px;
    padding: 2px 0;
    font-size: 14px;
    line-height: 1.3;
    color: var(--zdaf-text);
}

.zdaf-skin #amazzing_filter .af_filter .name {
    padding-left: 0;
}

.zdaf-skin #amazzing_filter .af_filter li.active > label .name {
    font-weight: 600;
}

.zdaf-skin #amazzing_filter .af_filter .count {
    min-width: 24px;
    padding: 2px 7px;
    border-radius: 20px;
    background: var(--zdaf-soft);
    color: var(--zdaf-muted);
    font-size: 11px;
    line-height: 1.4;
    text-align: center;
}

.zdaf-skin #amazzing_filter .af_filter .count:before,
.zdaf-skin #amazzing_filter .af_filter .count:after {
    content: none;
}

/* Checkboxes and radios */
.zdaf-skin #amazzing_filter .af-checkbox-label > input.af,
.zdaf-skin #amazzing_filter .af-radio-label > input.af {
    -webkit-appearance: none;
    appearance: none;
    display: inline-block;
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    margin: 0;
    border: 1.5px solid #c7cbd1;
    border-radius: 5px;
    background: #fff no-repeat center / 12px 12px;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease;
}

.zdaf-skin #amazzing_filter .af-radio-label > input.af {
    border-radius: 50%;
}

.zdaf-skin #amazzing_filter .af-checkbox-label:hover > input.af,
.zdaf-skin #amazzing_filter .af-radio-label:hover > input.af {
    border-color: var(--zdaf-accent);
}

.zdaf-skin #amazzing_filter .af-checkbox-label > input.af:checked {
    border-color: var(--zdaf-accent);
    background-color: var(--zdaf-accent);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2l2.3 2.3 4.7-5' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.zdaf-skin #amazzing_filter .af-radio-label > input.af:checked {
    border-color: var(--zdaf-accent);
    box-shadow: inset 0 0 0 4px #fff;
    background-color: var(--zdaf-accent);
}

/* Text boxes (sizes...) as pills */
.zdaf-skin #amazzing_filter .af_filter.tb li {
    margin: 0 6px 6px 0;
    padding: 7px 12px;
    border: 1px solid var(--zdaf-border);
    border-radius: 20px;
    background: #fff;
    transition: border-color .15s ease, background-color .15s ease;
}

.zdaf-skin #amazzing_filter .af_filter.tb li:hover {
    border-color: var(--zdaf-accent);
}

.zdaf-skin #amazzing_filter .af_filter.tb li.active {
    border-color: var(--zdaf-accent);
    background: var(--zdaf-accent);
}

.zdaf-skin #amazzing_filter .af_filter.tb li.active label,
.zdaf-skin #amazzing_filter .af_filter.tb li.active .name {
    color: #fff;
}

/* Colour swatches */
.zdaf-skin #amazzing_filter .active .af-color-box:after {
    border-color: var(--zdaf-accent);
}

/* Selects and quick search */
.zdaf-skin #amazzing_filter .af-select,
.zdaf-skin #amazzing_filter .qsInput {
    width: 100%;
    height: auto;
    padding: 9px 12px;
    border: 1px solid var(--zdaf-border);
    border-radius: var(--zdaf-radius);
    background-color: #fff;
    color: var(--zdaf-text);
    font-size: 14px;
    box-shadow: none;
}

.zdaf-skin #amazzing_filter .af-select:focus,
.zdaf-skin #amazzing_filter .qsInput:focus {
    border-color: var(--zdaf-accent);
    outline: none;
}

/* Price / weight slider */
.zdaf-skin #amazzing_filter .af-slider .slider-bar {
    height: 4px;
    margin: 14px 9px 16px;
    background: var(--zdaf-border);
}

.zdaf-skin #amazzing_filter .af-slider .selected-bar {
    background: var(--zdaf-accent);
}

.zdaf-skin #amazzing_filter .af-slider .pointer {
    top: -7px;
    width: 18px;
    height: 18px;
    margin-left: -9px;
    border: 2px solid var(--zdaf-accent);
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
    box-sizing: border-box;
}

.zdaf-skin #amazzing_filter .af-slider .slider_value {
    padding: 4px 8px;
    border: 1px solid var(--zdaf-border);
    border-radius: 6px;
    font-size: 13px;
}

/* Active filters */
.zdaf-skin #amazzing_filter .selectedFilters .cf {
    display: inline-block;
    margin: 0 6px 6px 0;
    padding: 6px 28px 6px 12px;
    border-radius: var(--zdaf-chip-radius, 20px);
    background: var(--zdaf-chip-bg, var(--zdaf-accent));
    color: var(--zdaf-chip-color, #fff);
    font-size: 13px;
    line-height: 1.2;
}

.zdaf-skin #amazzing_filter .selectedFilters .cf a {
    top: 50%;
    right: 10px;
    color: inherit;
    opacity: .8;
    transform: translateY(-50%);
}

.zdaf-skin #amazzing_filter .selectedFilters .clearAll {
    padding: 4px 0 8px;
    background: none;
    text-align: left;
}

.zdaf-skin #amazzing_filter .selectedFilters .clearAll a {
    display: inline;
    color: var(--zdaf-text);
    text-decoration: underline;
}

.zdaf-skin #amazzing_filter .selectedFilters .clearAll .txt {
    margin: 0;
    font-size: 12px;
    line-height: 1.2;
}

/* Buttons */
.zdaf-skin #amazzing_filter .btn {
    padding: 10px 16px;
    border: 1px solid var(--zdaf-accent);
    border-radius: var(--zdaf-radius);
    background: var(--zdaf-accent);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    text-transform: none;
    box-shadow: none;
}

.zdaf-skin #amazzing_filter .btn.toggleMoreFilters {
    border-color: var(--zdaf-border);
    background: #fff;
    color: var(--zdaf-text);
}

.zdaf-skin #amazzing_filter .toggle-cut-off {
    color: var(--zdaf-accent);
    font-size: 13px;
    font-weight: 600;
}
