/* Ajouté par Amine le 2026-10-19. Scoped to the Cadex filter panel. */
#cdx-af {
    --cdx-af-accent: #dd3333;
    clear: both;
    width: 100%;
    box-sizing: border-box;
    margin: 0 0 20px;
    padding: var(--cdx-af-top-spacing, 20px) 0 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: #fff;
    color: #202124;
    text-align: start;
}
#cdx-af *, #cdx-af *::before, #cdx-af *::after { box-sizing: border-box; }
#cdx-af .cdx-af-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
#cdx-af .cdx-af-heading h2 { margin: 0; padding: 0; font-family: inherit; font-size: 18px; line-height: 1.4; font-weight: 700; text-transform: none; letter-spacing: 0; color: #202124; }
#cdx-af .cdx-af-reset { font-size: 13px; font-weight: 600; color: #454545; text-decoration: underline; text-underline-offset: 3px; }
#cdx-af .cdx-af-reset:hover { color: var(--cdx-af-accent); }
#cdx-af .cdx-af-form { margin: 0; }
#cdx-af .cdx-af-grid { display: grid; grid-template-columns: repeat(var(--cdx-af-columns, 4), minmax(0, 1fr)); gap: 10px 16px; }
#cdx-af .cdx-af-field { min-width: 0; }
#cdx-af .cdx-af-colors { grid-column: 1 / -1; min-inline-size: 0; margin: 0; padding: 0; border: 0; }
#cdx-af .cdx-af-colors legend { padding: 0; margin-bottom: 4px; color: #53575c; font: inherit; font-size: 12px; font-weight: 700; line-height: 1.5; letter-spacing: .04em; }
#cdx-af .cdx-af-swatches { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; }
#cdx-af .cdx-af-swatch { position: relative; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 44px; width: 44px; height: 44px; padding: 5px; margin: 0; border: 2px solid transparent; border-radius: 50%; background: transparent; text-decoration: none; box-shadow: none; cursor: pointer; }
#cdx-af .cdx-af-swatch:hover { border-color: #a3a3a3; }
#cdx-af .cdx-af-swatch.is-selected { border-color: var(--cdx-af-accent); }
#cdx-af .cdx-af-swatch.is-selected::after { content: '✓'; position: absolute; top: -2px; right: -2px; display: flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; background: #191919; color: #fff; font: 700 11px/1 Arial,sans-serif; }
#cdx-af .cdx-af-dot { display: inline-flex; width: 30px; height: 30px; align-items: center; justify-content: center; border: 1px solid rgb(0 0 0 / 22%); border-radius: 50%; box-shadow: 0 0 0 2px #fff, 0 0 0 3px #d6d6d6; color: #444; font-size: 13px; font-weight: 700; }
#cdx-af .cdx-af-color-caption { margin: 2px 0 0; color: #53575c; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
#cdx-af .cdx-af-field > label, #cdx-af .cdx-af-label { display: block; margin: 0 0 4px; color: #53575c; font-family: inherit; font-size: 12px; line-height: 1.5; font-weight: 700; letter-spacing: .04em; }
#cdx-af .cdx-af-field select, #cdx-af .cdx-af-field input { display: block; width: 100%; min-width: 0; max-width: 100%; height: 40px; padding: 8px 10px; border: 1px solid #c9cdd1; border-radius: 4px; background-color: #fafafa; color: #202124; box-shadow: none; transition: border-color .15s ease; font-family: inherit; font-size: 16px; line-height: 1.4; text-transform: none; letter-spacing: normal; }
#cdx-af .cdx-af-field select { appearance: none; -webkit-appearance: none; padding-inline-end: 36px; background-image: none; cursor: pointer; }
#cdx-af .cdx-af-select-wrap { position: relative; }
#cdx-af .cdx-af-field input::placeholder { color: #6c7075; opacity: 1; }
#cdx-af :is(a, button, input, select, summary):focus-visible { outline: 2px solid var(--cdx-af-accent); outline-offset: 3px; }
#cdx-af .cdx-af-apply { margin: 18px 0 0; padding: 12px 20px; border: 1px solid #151719; border-radius: 4px; background: #151719; color: #fff; font-family: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
#cdx-af .cdx-af-apply, #cdx-af[data-enhanced] .cdx-af-apply { display: inline-block; min-height: 44px; }
#cdx-af .cdx-af-apply:disabled { opacity: .65; cursor: wait; }
#cdx-af[data-failed] .cdx-af-apply { display: inline-block; }
#cdx-af .cdx-af-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
#cdx-af .cdx-af-chips a { display: inline-flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 100%; min-height: 34px; padding: 5px 10px; border: 1px solid #ddd; border-radius: 4px; background: #f4f4f4; color: #292929; font-size: 13px; line-height: 1.5; text-decoration: none; overflow-wrap: anywhere; }
#cdx-af .cdx-af-chips a:hover { border-color: var(--cdx-af-accent); }
#cdx-af .cdx-af-chips span { font-size: 19px; line-height: 1; }
#cdx-af .cdx-af-status { margin: 0; font-size: 13px; line-height: 1.5; color: #555; }
#cdx-af .cdx-af-status:not(:empty) { margin-top: 14px; }
#cdx-af[data-failed] .cdx-af-status { color: #a51d1d; }
#cdx-af-results { clear: both; }
#cdx-af-results[aria-busy="true"] { opacity: .65; }
@media (max-width: 1024px) { #cdx-af .cdx-af-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 540px) {
    #cdx-af { margin-bottom: 20px; }
    #cdx-af .cdx-af-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
    #cdx-af .cdx-af-heading { align-items: start; }
    #cdx-af .cdx-af-heading h2 { font-size: 17px; }
}

/* Multi-selection menus: native disclosure and checkboxes, no UI library. */
#cdx-af .cdx-af-multi { position: relative; margin: 0; }
#cdx-af .cdx-af-multi summary { position: relative; display: flex; align-items: center; min-height: 40px; height: 40px; padding: 8px 36px 8px 10px; border: 1px solid #c9cdd1; border-radius: 4px; background: #fafafa; color: #202124; font: inherit; font-size: 16px; line-height: 1.4; cursor: pointer; list-style: none; transition: border-color .15s ease; }
#cdx-af .cdx-af-multi summary::-webkit-details-marker { display: none; }
#cdx-af .cdx-af-multi summary::before { content: none; }
/* Ajouté par Amine le 2026-10-20 : same chevron and inset for every dropdown. */
#cdx-af .cdx-af-multi summary::after, #cdx-af .cdx-af-select-wrap::after { content: ''; position: absolute; inset-inline-end: 14px; top: 50%; width: 7px; height: 7px; margin: 0; border-right: 2px solid #202124; border-bottom: 2px solid #202124; transform: translateY(-70%) rotate(45deg); pointer-events: none; }
#cdx-af .cdx-af-multi[open] summary::after { transform: translateY(-30%) rotate(225deg); }
#cdx-af .cdx-af-select-wrap::after { inset-inline-end: 15px; }
#cdx-af .cdx-af-selection { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#cdx-af .cdx-af-choices { position: absolute; z-index: 30; inset-inline: 0; top: calc(100% + 4px); max-height: 280px; overflow-y: auto; overscroll-behavior: contain; padding: 6px; border: 1px solid #c9cdd1; border-radius: 4px; background: #fff; box-shadow: 0 6px 18px rgb(0 0 0 / 12%); }
#cdx-af .cdx-af-field .cdx-af-choice { display: flex; align-items: center; gap: 10px; min-height: 44px; margin: 0; padding: 8px; color: #202124; font: inherit; font-size: 14px; line-height: 1.4; letter-spacing: normal; cursor: pointer; }
#cdx-af .cdx-af-choice:hover { background: #f4f4f4; }
#cdx-af .cdx-af-field .cdx-af-choice input { appearance: auto; -webkit-appearance: checkbox; position: static; display: inline-block; flex: 0 0 18px; width: 18px; min-width: 18px; height: 18px; padding: 0; margin: 0; opacity: 1; accent-color: var(--cdx-af-accent); cursor: pointer; }
#cdx-af .cdx-af-choice span { overflow-wrap: anywhere; }

/* Result line: decorative quantity indicator; the count is the exact query total. */
#cdx-af .cdx-af-result-bar { display: flex; align-items: center; gap: 20px; width: 100%; margin-top: 14px; padding: 0 0 4px; }
#cdx-af .cdx-af-track { display: block; position: relative; flex: 1 1 auto; min-width: 20px; height: 3px; overflow: hidden; background: #e4e4e4; }
#cdx-af .cdx-af-track-fill { display: block; width: 100%; height: 100%; background: var(--cdx-af-accent); transform-origin: left center; }
#cdx-af .cdx-af-total { display: inline-flex; flex: 0 0 auto; align-items: baseline; gap: 6px; color: #202124; font-size: 14px; line-height: 1.4; white-space: nowrap; }
#cdx-af .cdx-af-total-number { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
#cdx-af .cdx-af-visually-hidden, #cdx-af .cdx-af-status { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
#cdx-af[data-pending] .cdx-af-status, #cdx-af[data-failed] .cdx-af-status { position: static; width: auto; height: auto; margin: 10px 0 0; overflow: visible; clip-path: none; white-space: normal; }
#cdx-af[data-loading-state] .cdx-af-track-fill { opacity: .5; }
@media (prefers-reduced-motion: reduce) { #cdx-af .cdx-af-track-fill { transition: none; } }

/* Compact spacing while keeping comfortable touch controls on phones/tablets. */
@media (max-width: 1024px), (pointer: coarse) {
    #cdx-af .cdx-af-field select, #cdx-af .cdx-af-field > input { height: 44px; min-height: 44px; }
    #cdx-af .cdx-af-multi summary, #cdx-af .cdx-af-chips a { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
    #cdx-af .cdx-af-field select, #cdx-af .cdx-af-field input, #cdx-af .cdx-af-multi summary { transition: none; }
}

/* Consistent circular clipping for image and hybrid swatches at fractional zoom. */
#cdx-af .cdx-af-dot { flex: 0 0 30px; overflow: hidden; background-repeat: no-repeat; background-clip: padding-box; isolation: isolate; }
#cdx-af .cdx-af-swatch { flex-shrink: 0; }
#cdx-af .cdx-af-swatch.is-selected::after { pointer-events: none; box-shadow: 0 0 0 1px #fff; }
#cdx-af[data-pending] .cdx-af-status { color: #53575c; }
