/**
 * Agillia
 *
 * @author    Agillia <contact@agillia.fr>
 * @copyright Copyright (c) Agillia
 * @license   Commercial / Proprietary
 *
 * @website   https://www.agillia.fr
 * -------------------------------------------------------------------
 * COMMERCIAL MODULE - ALL RIGHTS RESERVED
 * -------------------------------------------------------------------
 * This file is part of a commercial PrestaShop module developed by Agillia.
 * Any unauthorized modification, reproduction, resale, distribution,
 * sublicensing or use of this file is strictly prohibited.
 * -------------------------------------------------------------------
 * MODULE COMMERCIAL - TOUS DROITS RÉSERVÉS
 * -------------------------------------------------------------------
 * Ce fichier fait partie d'un module PrestaShop commercial développé par Agillia.
 * Toute modification, reproduction, revente, distribution, sous-licence
 * ou utilisation non autorisée est strictement interdite.
 * -------------------------------------------------------------------
 * SUPPORT / CONTACT
 * -------------------------------------------------------------------
 * Support technique / Technical support : support.prestashop@agillia.fr
 */

/* Popin de recherche Search Pro by Agillia (CDC §5.8, §6, §12.2, §12.3). Sans dépendance au thème. */
.agosp-visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.agosp-trigger { display: flex; align-items: center; position: relative; max-width: 100%; }
.agosp-trigger__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.agosp-trigger__input { flex: 1 1 auto; min-width: 0; padding: 8px 40px 8px 12px; border: 1px solid #d0d0d0; border-radius: 4px; font: inherit; }
.agosp-trigger__button { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; padding: 6px; cursor: pointer; color: inherit; display: inline-flex; }

.agosp-popin { --agosp-primary: #2fb5d2; --agosp-bg: #fff; --agosp-fg: #232323; --agosp-muted: #6c757d; --agosp-border: #e5e5e5; --agosp-surface: #f6f6f6; position: fixed; inset: 0; z-index: 10000; font-family: inherit; color: var(--agosp-fg); }
.agosp-popin--dark { --agosp-bg: #1e1e1e; --agosp-fg: #f2f2f2; --agosp-muted: #a5a5a5; --agosp-border: #3a3a3a; --agosp-surface: #2a2a2a; }
.agosp-popin[hidden] { display: none; }
.agosp-popin__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .55); }
.agosp-popin__dialog { position: relative; margin: 5vh auto 0; width: calc(100% - 32px); max-height: 90vh; background: var(--agosp-bg); border-radius: 8px; box-shadow: 0 20px 60px rgba(0,0,0,.35); display: flex; flex-direction: column; overflow: hidden; }
.agosp-popin__header { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--agosp-border); }
.agosp-popin__logo { flex: 0 0 auto; display: inline-flex; align-items: center; margin-right: 4px; }
.agosp-popin__logo img { display: block; width: auto; height: auto; max-height: 40px; max-width: 140px; }
.agosp-popin--compact .agosp-popin__logo img { max-height: 32px; }
@media (max-width: 480px) { .agosp-popin__logo img { max-height: 32px; max-width: 100px; } }
.agosp-popin__form { flex: 1 1 auto; position: relative; margin: 0; }
.agosp-popin__input { width: 100%; box-sizing: border-box; font-size: 18px; padding: 10px 36px 10px 12px; border: 2px solid var(--agosp-border); border-radius: 6px; background: var(--agosp-bg); color: var(--agosp-fg); }
.agosp-popin__input:focus { outline: none; border-color: var(--agosp-primary); }
.agosp-popin__ghost { position: absolute; inset: 0; display: flex; align-items: center; box-sizing: border-box; overflow: hidden; white-space: pre; pointer-events: none; color: var(--agosp-muted); }
.agosp-popin__ghost[hidden] { display: none; }
.agosp-popin__ghost-typed { visibility: hidden; }
.agosp-popin__clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; font-size: 22px; line-height: 1; cursor: pointer; color: var(--agosp-muted); padding: 4px 8px; }
.agosp-popin__close { border: 0; background: transparent; cursor: pointer; color: var(--agosp-fg); padding: 8px; display: inline-flex; border-radius: 4px; }
.agosp-popin__close:focus-visible, .agosp-popin__clear:focus-visible, .agosp-popin__load-more:focus-visible, .agosp-popin__filters-toggle:focus-visible { outline: 2px solid var(--agosp-primary); outline-offset: 2px; }
/* Scan de codes-barres et de QR codes (CDC §5.15) : bouton de l'en-tête, menu des sources, messages et actions. */
.agosp-popin__scan-wrap { position: relative; display: inline-flex; flex: 0 0 auto; }
.agosp-popin__scan { border: 0; background: transparent; cursor: pointer; color: var(--agosp-fg); padding: 8px; display: inline-flex; border-radius: 4px; min-width: 44px; min-height: 44px; align-items: center; justify-content: center; box-sizing: border-box; }
.agosp-popin__scan:focus-visible, .agosp-popin__scan-menu button:focus-visible, .agosp-popin__scan-action:focus-visible { outline: 2px solid var(--agosp-primary); outline-offset: 2px; }
.agosp-popin__scan-menu { position: absolute; top: 100%; right: 0; z-index: 6; min-width: 200px; max-width: calc(100vw - 32px); margin-top: 4px; padding: 4px 0; background: var(--agosp-bg); color: var(--agosp-fg); border: 1px solid var(--agosp-border); border-radius: 6px; box-shadow: 0 6px 20px rgba(0, 0, 0, .15); }
.agosp-popin__scan-menu[hidden] { display: none; }
.agosp-popin__scan-menu button { display: block; width: 100%; box-sizing: border-box; padding: 10px 14px; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; min-height: 44px; }
.agosp-popin__scan-menu button:hover { background: var(--agosp-surface); }
.agosp-popin__scan-msg { display: block; margin-bottom: 8px; }
.agosp-popin__scan-code { display: block; margin-bottom: 6px; font-weight: 600; color: var(--agosp-fg); word-break: break-all; }
.agosp-popin__scan-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.agosp-popin__scan-action { font: inherit; padding: 8px 12px; min-height: 44px; border: 1px solid var(--agosp-border); border-radius: 4px; background: var(--agosp-surface); color: var(--agosp-fg); cursor: pointer; }
.agosp-popin__toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 16px; border-bottom: 1px solid var(--agosp-border); font-size: 14px; }
.agosp-popin__toolbar[hidden] { display: none; }
.agosp-popin__count { flex: 1 1 auto; min-width: 0; color: var(--agosp-muted); }
/* Tri calé à droite ; largeur propre, jamais celle que le thème donne à tous les select (recette mobile du 09/10). */
.agosp-popin__sort { flex: 0 1 auto; margin: 0 0 0 auto; min-width: 0; max-width: 100%; position: relative; z-index: 3; }
/* Tri (09/10) : composant du module, styles explicites pour résister aux règles génériques `button` / `ul` / `li` des thèmes. */
.agosp-popin .agosp-sort__button { -webkit-appearance: none; appearance: none; display: inline-flex; align-items: center; gap: 6px; box-sizing: border-box; width: auto; height: auto; min-width: 0; max-width: 100%; margin: 0; padding: 4px 8px; font: inherit; font-size: 14px; line-height: 1.4; text-transform: none; letter-spacing: normal; text-align: left; white-space: nowrap; color: var(--agosp-fg); background: var(--agosp-bg); border: 1px solid var(--agosp-border); border-radius: 4px; box-shadow: none; cursor: pointer; }
.agosp-popin .agosp-sort__current { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.agosp-popin .agosp-sort__chevron { flex: 0 0 auto; }
.agosp-popin .agosp-sort__button[aria-expanded="true"] .agosp-sort__chevron { transform: rotate(180deg); }
.agosp-popin .agosp-sort__menu { position: absolute; top: 100%; right: 0; left: auto; z-index: 5; box-sizing: border-box; min-width: 180px; max-width: calc(100vw - 32px); max-height: 60vh; overflow-y: auto; margin: 4px 0 0; padding: 4px 0; list-style: none; background: var(--agosp-bg); color: var(--agosp-fg); border: 1px solid var(--agosp-border); border-radius: 6px; box-shadow: 0 6px 20px rgba(0, 0, 0, .15); }
.agosp-popin .agosp-sort__menu[hidden] { display: none; }
.agosp-popin .agosp-sort__option { display: block; float: none; width: auto; text-align: left; margin: 0; padding: 8px 12px 8px 28px; font-size: 14px; line-height: 1.4; white-space: nowrap; cursor: pointer; position: relative; list-style: none; background: none; }
.agosp-popin .agosp-sort__option::before { content: none; }
.agosp-popin .agosp-sort__option:hover, .agosp-popin .agosp-sort__option:focus { background: var(--agosp-surface); outline: none; }
.agosp-popin .agosp-sort__option:focus-visible { outline: 2px solid var(--agosp-primary); outline-offset: -2px; }
.agosp-popin .agosp-sort__option[aria-selected="true"] { font-weight: 600; }
.agosp-popin .agosp-sort__option[aria-selected="true"]::after { content: '\2713'; position: absolute; left: 10px; top: 8px; color: var(--agosp-primary); }
.agosp-popin__filters-toggle { font: inherit; padding: 6px 12px; border: 1px solid var(--agosp-border); border-radius: 4px; background: var(--agosp-surface); color: var(--agosp-fg); cursor: pointer; }
.agosp-popin__body { display: flex; flex: 1 1 auto; min-height: 0; position: relative; }
.agosp-popin__filters { flex: 0 0 240px; border-right: 1px solid var(--agosp-border); overflow: auto; padding: 12px 16px; }
.agosp-popin__filters[hidden] { display: none; }
.agosp-popin__filters--loading { opacity: .6; }
.agosp-popin__filters--stale .agosp-facet { opacity: .7; }
.agosp-facets__stale { font-size: 12px; color: #8a6d3b; background: #fcf8e3; border: 1px solid #faebcc; border-radius: 4px; padding: 4px 8px; margin-bottom: 10px; }
.agosp-facets__active { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.agosp-facets__tag { font: inherit; font-size: 12px; padding: 4px 8px; border: 1px solid var(--agosp-primary); color: var(--agosp-primary); background: transparent; border-radius: 12px; cursor: pointer; }
.agosp-facets__clear { font: inherit; font-size: 12px; border: 0; background: transparent; color: var(--agosp-muted); cursor: pointer; text-decoration: underline; padding: 4px 0; }
.agosp-facet { border: 0; margin: 0 0 16px; padding: 0; min-width: 0; }
.agosp-facet__title { font-weight: 600; font-size: 14px; padding: 0; margin-bottom: 8px; }
.agosp-facet__values { display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow: auto; }
.agosp-facet__values--buttons, .agosp-facet__values--color { flex-direction: row; flex-wrap: wrap; gap: 6px; }
.agosp-facet__option { display: flex; align-items: center; justify-content: flex-start; gap: 6px; font-size: 13px; font-weight: 400; text-align: left; cursor: pointer; margin: 0; width: 100%; color: var(--agosp-fg); }
/* Le thème colore `label`, `legend`, `h*` et `a` : la popin impose sa palette (thème sombre illisible sinon, recette 2026-09-13). */
.agosp-popin label, .agosp-popin legend, .agosp-popin h1, .agosp-popin h2, .agosp-popin h3, .agosp-popin h4 { color: var(--agosp-fg); }
.agosp-facet__option[hidden] { display: none; }
.agosp-facet__option input { margin: 0; }
.agosp-facet__option span:first-of-type { flex: 1 1 auto; overflow-wrap: anywhere; }
.agosp-facet__count { color: var(--agosp-muted); font-size: 12px; }
.agosp-facet__button { font: inherit; font-size: 13px; padding: 4px 10px; border: 1px solid var(--agosp-border); border-radius: 4px; background: var(--agosp-bg); color: var(--agosp-fg); cursor: pointer; }
.agosp-facet__button[hidden] { display: none; }
.agosp-facet__button.is-active { border-color: var(--agosp-primary); background: var(--agosp-primary); color: #fff; }
.agosp-facet__button.is-active .agosp-facet__count { color: rgba(255,255,255,.8); }
.agosp-facet__button:disabled, .agosp-facet__option input:disabled + span { opacity: .45; cursor: default; }
.agosp-facet__swatch { width: 28px; height: 28px; padding: 2px; border: 2px solid var(--agosp-border); border-radius: 50%; background: var(--agosp-bg); cursor: pointer; }
.agosp-facet__swatch.is-active { border-color: var(--agosp-primary); }
.agosp-facet__swatch:disabled { opacity: .35; cursor: default; }
.agosp-facet__swatch-color { display: block; width: 100%; height: 100%; border-radius: 50%; background: var(--agosp-surface); border: 1px solid rgba(0,0,0,.1); box-sizing: border-box; }
.agosp-facet__range { margin: 0; }
.agosp-facet__bounds { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.agosp-facet__unit { font-size: 12px; color: var(--agosp-muted); }
.agosp-facet__slider { position: relative; height: 24px; margin: 4px 0 6px; }
.agosp-facet__slider input[type="range"] { position: absolute; left: 0; right: 0; top: 0; width: 100%; margin: 0; background: transparent; pointer-events: none; -webkit-appearance: none; appearance: none; height: 24px; }
/* Rail unique dessiné par le conteneur : les deux curseurs superposés ont une piste transparente (demande client 2026-09-18, double trait sinon). */
.agosp-facet__slider::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 4px; margin-top: -2px; background: var(--agosp-border); border-radius: 2px; pointer-events: none; }
.agosp-facet__slider input[type="range"]::-webkit-slider-runnable-track { height: 4px; background: transparent; border-radius: 2px; }
.agosp-facet__slider input[type="range"]::-moz-range-track { height: 4px; background: transparent; border-radius: 2px; }
.agosp-facet__slider input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 16px; height: 16px; margin-top: -6px; border-radius: 50%; background: var(--agosp-primary); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--agosp-border); pointer-events: auto; cursor: pointer; }
.agosp-facet__slider input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--agosp-primary); border: 2px solid #fff; pointer-events: auto; cursor: pointer; }
.agosp-facet__more { font: inherit; font-size: 12px; margin-top: 6px; border: 0; background: transparent; color: var(--agosp-primary); cursor: pointer; text-decoration: underline; padding: 0; }
.agosp-facet--boolean .agosp-facet__values { margin-top: 2px; }
.agosp-facet__option.is-pinned span:first-of-type, .agosp-facet__button.is-pinned { font-weight: 600; }
.agosp-facet__swatch[hidden], .agosp-facet__option[hidden], .agosp-facet__button[hidden] { display: none; }
.agosp-facet__bounds label { flex: 1 1 64px; min-width: 0; margin: 0; }
.agosp-facet__unit { flex: 0 0 auto; }
.agosp-facet__bounds input { width: 100%; box-sizing: border-box; font: inherit; font-size: 13px; padding: 4px 6px; border: 1px solid var(--agosp-border); border-radius: 4px; background: var(--agosp-bg); color: var(--agosp-fg); }
.agosp-facet__apply { flex: 1 0 100%; font: inherit; font-size: 13px; padding: 4px 10px; border: 1px solid var(--agosp-primary); color: var(--agosp-primary); background: transparent; border-radius: 4px; cursor: pointer; }
.agosp-facet__hint { font-size: 12px; color: var(--agosp-muted); margin-top: 4px; }
/* Filtre prix en curseur seul (CDC §5.6.1) : sélection lisible au-dessus, piste haute pour le tactile, focus visible. */
.agosp-facet__range-values { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 600; color: var(--agosp-fg); margin-bottom: 2px; }
.agosp-facet__range--price .agosp-facet__slider { height: 32px; margin: 2px 0 4px; }
.agosp-facet__range--price .agosp-facet__slider input[type="range"] { height: 32px; }
.agosp-facet__range--price .agosp-facet__slider input[type="range"]::-webkit-slider-thumb { width: 20px; height: 20px; margin-top: -8px; }
.agosp-facet__range--price .agosp-facet__slider input[type="range"]::-moz-range-thumb { width: 20px; height: 20px; }
.agosp-facet__slider input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--agosp-bg), 0 0 0 5px var(--agosp-primary); }
.agosp-facet__slider input[type="range"]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px var(--agosp-bg), 0 0 0 5px var(--agosp-primary); }
.agosp-facet__search { width: 100%; box-sizing: border-box; font: inherit; font-size: 13px; padding: 4px 8px; margin-bottom: 6px; border: 1px solid var(--agosp-border); border-radius: 4px; background: var(--agosp-bg); color: var(--agosp-fg); }
.agosp-facet__select { width: 100%; font: inherit; font-size: 13px; padding: 4px 6px; border: 1px solid var(--agosp-border); border-radius: 4px; background: var(--agosp-bg); color: var(--agosp-fg); }
.agosp-facets__footer { display: none; position: sticky; bottom: 0; padding: 12px 0 0; background: var(--agosp-bg); }
.agosp-facets__apply { width: 100%; font: inherit; padding: 10px; border: 0; border-radius: 4px; background: var(--agosp-primary); color: #fff; cursor: pointer; }
.agosp-popin__filters-toggle[hidden] { display: none; }
@media (min-width: 768px) { .agosp-popin__filters-toggle { display: none; } }
.agosp-popin__main { flex: 1 1 auto; min-width: 0; overflow: auto; padding: 12px 16px 16px; -webkit-overflow-scrolling: touch; }
.agosp-popin__suggestions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 0 0 12px; font-size: 13px; }
.agosp-popin__suggestions[hidden] { display: none; }
.agosp-suggestions__title { color: var(--agosp-muted); }
.agosp-suggestions__list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.agosp-suggestions__item { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--agosp-border); border-radius: 14px; color: var(--agosp-fg); text-decoration: none; background: var(--agosp-surface); }
.agosp-suggestions__item:hover, .agosp-suggestions__item:focus-visible { border-color: var(--agosp-primary); color: var(--agosp-primary); outline: none; }
.agosp-suggestions__item--query::before { content: '🔍'; font-size: 11px; }
.agosp-suggestions__type { font-size: 11px; color: var(--agosp-muted); }
.agosp-popin__state { color: var(--agosp-muted); padding: 24px 8px; text-align: center; font-size: 15px; }
.agosp-popin__state:empty { display: none; }
.agosp-popin__state a { color: var(--agosp-primary); }
.agosp-correction { display: block; color: var(--agosp-fg); }
.agosp-did-you-mean { display: block; margin-top: 4px; }
.agosp-did-you-mean a { font-weight: 600; text-decoration: underline; }
.agosp-popin__banners { display: flex; flex-direction: column; gap: 10px; margin: 0 0 14px; }
.agosp-popin__banners[data-agosp-banners="bottom"] { margin: 14px 0 0; }
.agosp-banner { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--agosp-border); border-radius: 6px; background: var(--agosp-surface); color: inherit; text-decoration: none; min-width: 0; }
.agosp-banner--link:hover, .agosp-banner--link:focus-visible { border-color: var(--agosp-primary); }
.agosp-banner__image { width: 64px; height: 64px; object-fit: cover; border-radius: 4px; flex: 0 0 auto; }
.agosp-banner__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.agosp-banner__title { font-size: 14px; }
.agosp-banner__text { font-size: 13px; color: var(--agosp-muted); overflow-wrap: anywhere; }
.agosp-banner--image { display: block; padding: 0; overflow: hidden; }
.agosp-banner__picture { display: block; width: 100%; height: auto; max-height: 300px; object-fit: contain; }
.agosp-popin__results { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.agosp-result { border: 1px solid var(--agosp-border); border-radius: 6px; overflow: hidden; background: var(--agosp-bg); display: flex; flex-direction: column; min-width: 0; }
.agosp-result:focus-within, .agosp-result:hover { border-color: var(--agosp-primary); }
.agosp-result__link { color: inherit; text-decoration: none; display: flex; flex-direction: column; flex: 1 1 auto; }
.agosp-result__image { aspect-ratio: 1 / 1; width: 100%; height: auto; background: var(--agosp-surface); display: block; object-fit: cover; }
.agosp-result__body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; }
.agosp-result__name { font-weight: 600; font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; }
.agosp-result__meta { font-size: 12px; color: var(--agosp-muted); overflow-wrap: anywhere; }
.agosp-result__price { font-weight: 700; font-size: 15px; }
.agosp-result__regular { text-decoration: line-through; color: var(--agosp-muted); font-weight: 400; font-size: 13px; margin-left: 6px; }
.agosp-result__badges { display: flex; flex-wrap: wrap; gap: 4px; }
.agosp-result__cart { margin: 0 12px 12px; padding: 8px 10px; border: 1px solid var(--agosp-primary); border-radius: 4px; background: var(--agosp-primary); color: #fff; font: inherit; font-size: 13px; font-weight: 600; text-align: center; text-decoration: none; cursor: pointer; }
.agosp-result__cart:hover, .agosp-result__cart:focus-visible { filter: brightness(0.92); color: #fff; text-decoration: none; }
.agosp-result__cart:disabled { opacity: 0.6; cursor: wait; }
.agosp-result__cart--link { background: transparent; color: var(--agosp-primary); }
.agosp-result__cart--added { background: #1d6b3a; border-color: #1d6b3a; }
.agosp-result__cart--error { background: #9b2c2c; border-color: #9b2c2c; }
.agosp-badge { font-size: 11px; padding: 2px 6px; border-radius: 3px; background: var(--agosp-surface); color: var(--agosp-fg); }
.agosp-badge--stock { background: #e3f6e9; color: #1d6b3a; }
.agosp-badge--out { background: #fbe8e8; color: #9b2c2c; }
.agosp-badge--last { background: #fff4d6; color: #7a5a00; }
.agosp-badge--availability { display: inline-flex; align-items: center; gap: 4px; }
.agosp-badge__icon { flex: 0 0 auto; }
.agosp-badge--new { background: var(--agosp-primary); color: #fff; }
.agosp-badge--sale { background: #f7c948; color: #4a3800; }
/* Pied de popin fixe (CDC §6.2) : affichés / total, actions, mention Agillia ; les résultats défilent au-dessus. */
.agosp-popin__footer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 8px 16px; border-top: 1px solid var(--agosp-border); background: var(--agosp-bg); font-size: 13px; flex: 0 0 auto; }
.agosp-popin__footer[hidden] { display: none; }
.agosp-popin__shown { color: var(--agosp-muted); flex: 1 1 auto; }
.agosp-popin__footer-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.agosp-popin__filters-reset, .agosp-popin__footer-close { font: inherit; font-size: 13px; padding: 8px 12px; border: 1px solid var(--agosp-border); color: var(--agosp-fg); background: var(--agosp-surface); border-radius: 4px; cursor: pointer; }
.agosp-popin__filters-reset[hidden] { display: none; }
.agosp-popin__filters-reset:focus-visible, .agosp-popin__footer-close:focus-visible { outline: 2px solid var(--agosp-primary); outline-offset: 2px; }
.agosp-popin__branding { flex: 1 0 100%; font-size: 11px; color: var(--agosp-muted); text-align: right; }
.agosp-popin__branding a { color: var(--agosp-muted); text-decoration: underline; }
.agosp-popin__load-more { font: inherit; font-size: 13px; padding: 8px 16px; border: 1px solid var(--agosp-primary); color: var(--agosp-primary); background: transparent; border-radius: 4px; cursor: pointer; }
.agosp-popin__load-more[hidden] { display: none; }
.agosp-popin__load-more:disabled { opacity: .6; cursor: wait; }
.agosp-popin--loading .agosp-popin__results { opacity: .5; }
.agosp-result--skeleton { height: 240px; background: linear-gradient(90deg, var(--agosp-surface) 25%, var(--agosp-bg) 50%, var(--agosp-surface) 75%); background-size: 200% 100%; animation: agosp-shimmer 1.2s infinite; }
@keyframes agosp-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
body.agosp-popin-open { overflow: hidden; }

/* Disposition plein écran (CDC §5.7) : mêmes règles que le mobile, à toutes les largeurs. */
.agosp-popin--fullscreen .agosp-popin__dialog { margin: 0; width: 100%; max-width: none !important; height: 100%; max-height: none; border-radius: 0; }
@media (max-width: 767px) {
  .agosp-popin__dialog { margin: 0; width: 100%; max-width: none !important; height: 100%; max-height: none; border-radius: 0; }
  .agosp-popin__filters { display: none; position: absolute; inset: 0; flex: none; width: 100%; box-sizing: border-box; border-right: 0; background: var(--agosp-bg); z-index: 2; }
  .agosp-popin--filters-open .agosp-popin__filters:not([hidden]) { display: block; }
  /* Le bouton collant couvre le padding bas du panneau (recette 2026-09-15 : bande de 12 px où le contenu défilait sous lui). */
  .agosp-popin--filters-open .agosp-facets__footer { display: block; bottom: -12px; margin-bottom: -12px; padding-bottom: 12px; }
  .agosp-popin__results { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .agosp-popin__input { font-size: 16px; }
  /* Cibles tactiles (CDC §5.8) : au moins 36 px de haut sur mobile. */
  .agosp-facet__option { min-height: 36px; }
  .agosp-facet__button, .agosp-facet__apply, .agosp-facets__tag, .agosp-facet__more { min-height: 36px; padding-top: 8px; padding-bottom: 8px; }
  .agosp-facet__swatch { width: 36px; height: 36px; }
  .agosp-facet__range--price .agosp-facet__slider, .agosp-facet__range--price .agosp-facet__slider input[type="range"] { height: 44px; }
  .agosp-facet__range--price .agosp-facet__slider input[type="range"]::-webkit-slider-thumb { width: 24px; height: 24px; margin-top: -10px; }
  .agosp-facet__range--price .agosp-facet__slider input[type="range"]::-moz-range-thumb { width: 24px; height: 24px; }
  /* Pied de popin sur mobile : cibles tactiles, mention sur sa propre ligne, au-dessus du clavier virtuel (safe-area). */
  .agosp-popin__footer { padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px)); }
  .agosp-popin__filters-reset, .agosp-popin__footer-close, .agosp-popin__load-more { min-height: 36px; }
  .agosp-popin__branding { text-align: left; }
}
/* Fenêtres basses (téléphone en paysage, recette 2026-09-15) : l'en-tête, la barre d'outils, les puces « Affiner la
 * recherche » et le pied consommaient toute la hauteur — puces sur une ligne défilante, mention Agillia sur la ligne des
 * boutons, marges réduites, pour qu'une rangée de résultats reste visible. */
@media (max-height: 520px) {
  .agosp-popin__header { padding: 6px 12px; }
  .agosp-popin__toolbar { padding: 4px 12px; }
  .agosp-popin__suggestions { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 8px; scrollbar-width: thin; }
  .agosp-suggestions__list { flex-wrap: nowrap; }
  .agosp-suggestions__item { white-space: nowrap; }
  .agosp-suggestions__title { white-space: nowrap; }
  .agosp-popin__footer { padding-top: 6px; padding-bottom: 6px; }
  .agosp-popin__branding { flex: 0 0 auto; margin-left: auto; }
}
/* Disposition mobile « panneau bas » (CDC §5.7) : 92 % de la hauteur, coins arrondis, poignée, page visible derrière. */
.agosp-popin__handle { display: none; }
@media (max-width: 767px) {
  .agosp-popin--sheet { display: flex; flex-direction: column; justify-content: flex-end; }
  .agosp-popin--sheet[hidden] { display: none; }
  .agosp-popin--sheet .agosp-popin__dialog { height: 92vh; height: 92dvh; max-height: 92dvh; border-radius: 16px 16px 0 0; box-shadow: 0 -8px 30px rgba(0,0,0,.3); transform: translateY(0); transition: transform .25s ease-out; will-change: transform; }
  .agosp-popin--sheet .agosp-popin__handle { display: block; width: 40px; height: 4px; margin: 8px auto 0; border-radius: 2px; background: var(--agosp-muted); opacity: .6; }
  .agosp-popin--sheet .agosp-popin__header { touch-action: pan-y; }
  .agosp-popin--sheet.agosp-popin--dragging .agosp-popin__dialog { transition: none; }
}
@media (max-width: 767px) and (prefers-reduced-motion: reduce) { .agosp-popin--sheet .agosp-popin__dialog { transition: none; } }

/* Densité compacte (CDC §5.7) : lignes de 40 px de vignette, nom sur une ligne, deux fois plus de résultats par écran. */
.agosp-popin--compact .agosp-popin__results { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 6px; }
.agosp-popin--compact .agosp-result { flex-direction: row; align-items: center; border-radius: 4px; }
.agosp-popin--compact .agosp-result__link { flex-direction: row; align-items: center; gap: 10px; padding: 6px 8px; min-width: 0; }
.agosp-popin--compact .agosp-result__image { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 3px; }
.agosp-popin--compact .agosp-result__body { padding: 0; min-width: 0; flex: 1 1 auto; display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 0 8px; }
.agosp-popin--compact .agosp-result__name { flex: 0 0 100%; font-size: 13px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal; }
.agosp-popin--compact .agosp-result__meta { flex: 1 1 0; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal; font-size: 11px; line-height: 1.4; }
.agosp-popin--compact .agosp-result__price { flex: 0 0 auto; font-size: 13px; line-height: 1.4; }
.agosp-popin--compact .agosp-result__regular { font-size: 11px; margin-left: 4px; }
.agosp-popin--compact .agosp-result__badges { flex: 0 0 auto; gap: 3px; }
.agosp-popin--compact .agosp-badge { font-size: 10px; padding: 1px 4px; line-height: 1.3; }
.agosp-popin--compact .agosp-result__cart { margin: 0 8px 0 0; padding: 5px 8px; font-size: 12px; flex: 0 0 auto; }
.agosp-popin--compact .agosp-result--skeleton { height: 52px; }
@media (max-width: 767px) { .agosp-popin--compact .agosp-popin__results { grid-template-columns: 1fr; gap: 4px; } }
@media (prefers-reduced-motion: reduce) { .agosp-result--skeleton { animation: none; } }

/* Écran « aucun résultat » (CDC §5.7) */
.agosp-empty { grid-column: 1 / -1; padding: 16px; border: 1px dashed var(--agosp-border); border-radius: 6px; background: var(--agosp-surface); display: flex; flex-direction: column; gap: 8px; }
.agosp-empty__title { margin: 0; font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.agosp-empty__tips, .agosp-empty__fewer, .agosp-empty__native { margin: 0; font-size: 13px; color: var(--agosp-muted); }
.agosp-empty__fewer a, .agosp-empty__native a { color: var(--agosp-primary); }
.agosp-empty__group { font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.agosp-empty__label { color: var(--agosp-muted); }
.agosp-empty__link { display: inline-block; padding: 3px 8px; border: 1px solid var(--agosp-border); border-radius: 12px; color: var(--agosp-fg); text-decoration: none; background: var(--agosp-bg); }
.agosp-empty__link:hover, .agosp-empty__link:focus-visible { border-color: var(--agosp-primary); color: var(--agosp-primary); }
.agosp-empty__actions { margin: 0; }
.agosp-empty__reset { font: inherit; font-size: 13px; padding: 8px 12px; border: 1px solid var(--agosp-primary); color: var(--agosp-primary); background: var(--agosp-bg); border-radius: 4px; cursor: pointer; }
.agosp-empty__reset:hover, .agosp-empty__reset:focus-visible { background: var(--agosp-primary); color: #fff; outline: 2px solid var(--agosp-primary); outline-offset: 2px; }

/* Mises en avant de la popin (CDC §5.14) : blocs empilés, termes en boutons, produits sur la grille des résultats. */
.agosp-highlights { padding: 4px 0 8px; }
.agosp-popin__span { grid-column: 1 / -1; list-style: none; }
.agosp-highlights__intro { margin: 8px 0 4px; font-weight: 600; color: var(--agosp-fg); }
.agosp-highlights__block { margin: 10px 0 14px; }
.agosp-highlights__title { margin: 0 0 8px; font-size: 14px; font-weight: 600; color: var(--agosp-fg); }
.agosp-highlights__terms { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.agosp-highlights__term { font: inherit; font-size: 13px; padding: 6px 12px; border: 1px solid var(--agosp-border); border-radius: 999px; background: var(--agosp-bg); color: var(--agosp-fg); cursor: pointer; min-height: 32px; }
.agosp-highlights__term:hover, .agosp-highlights__term:focus-visible { border-color: var(--agosp-primary); color: var(--agosp-primary); outline: none; }
.agosp-highlights__term:focus-visible { box-shadow: 0 0 0 2px var(--agosp-bg), 0 0 0 4px var(--agosp-primary); }
.agosp-highlights__products { margin: 0; }
/* Catégories mises en avant (CDC §5.14.8) : titre = nom de la catégorie, lien « Voir la catégorie » aligné à droite, replié sous le titre sur petit écran. */
.agosp-highlights__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin: 0 0 8px; }
.agosp-highlights__head .agosp-highlights__title { margin: 0; }
.agosp-highlights__more { font-size: 13px; color: var(--agosp-fg); text-decoration: underline; }
.agosp-highlights__more:hover, .agosp-highlights__more:focus-visible { color: var(--agosp-primary); text-decoration: none; }
.agosp-highlights__more:focus-visible { outline: 2px solid var(--agosp-primary); outline-offset: 2px; }
@media (max-width: 767px) {
  .agosp-highlights__term { min-height: 36px; padding: 8px 14px; }
}
/* Bannière image seule : un visuel portrait ne repousse pas les résultats hors de l'écran (passe 2 du 24/10). */
@media (max-width: 767px) {
  .agosp-banner__picture { max-height: 160px; }
}
