@charset "UTF-8";
/* rc208: sort menu drawn by sort-menu.js over a native <select data-sort-menu>.
   Colours follow the page: simple mode and shared lists use the warm palette
   (paper, rust accent), advanced mode keeps its own accent and lines. */

.sort-menu-native { display: none !important; }

.sort-menu-button {
  display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; min-height: 44px; margin: 0; padding: 0 12px;
  border: 1px solid #dfd3c7; border-radius: 10px; background: var(--surface, #fffdf9); color: var(--ink, #332c2c);
  font: inherit; font-size: var(--text-body, 1rem); line-height: 1.4; text-align: left; cursor: pointer;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.sort-menu-button:disabled { cursor: default; opacity: .55; }
.sort-menu-button:focus-visible { outline: 2px solid var(--accent, var(--wishlist-brand-accent, #9e4835)); outline-offset: 3px; }
.sort-menu-button[aria-expanded="true"] { border-color: #b39b8a; }
.sort-menu-name { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.sort-menu-value { display: grid; flex: 1; min-width: 0; overflow: hidden; }
.sort-menu-current, .sort-menu-sizer { grid-area: 1 / 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sort-menu-sizer { visibility: hidden; height: 0; }
.sort-menu-chevron { flex: none; width: 8px; height: 8px; margin: -4px 3px 0 6px; border-right: 1.75px solid currentColor; border-bottom: 1.75px solid currentColor; transform: rotate(45deg); opacity: .7; }
.sort-menu-button[aria-expanded="true"] .sort-menu-chevron { transform: translateY(3px) rotate(225deg); }

/* The list: a popover in the browser's top layer, so no overflow or stacking
   context cuts it and it also shows above an open <dialog>. */
.sort-menu-listbox {
  position: fixed; inset: auto; z-index: 1000; box-sizing: border-box; width: max-content; min-width: 0;
  max-width: calc(100vw - 16px); margin: 0; padding: 6px; overflow: auto; overscroll-behavior: contain; list-style: none;
  border: 1px solid var(--line, #e8e0d7); border-radius: 12px; background: var(--surface, #fffdf9); color: var(--ink, #332c2c);
  box-shadow: 0 12px 35px rgba(50, 34, 24, .14); font-family: var(--wishlist-font, inherit); font-size: var(--text-body, 1rem); line-height: 1.4;
  --sort-menu-hover: #f3eee8; --sort-menu-selected: var(--accent, var(--wishlist-brand-accent, #9e4835));
}
.sort-menu-listbox[hidden] { display: none; }
.sort-menu-listbox.sort-menu-listbox:focus, .sort-menu-listbox.sort-menu-listbox:focus-visible { outline: none; }
.sort-menu-option {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 10px 16px 10px 10px; border-radius: 8px;
  white-space: nowrap; cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
}
.sort-menu-option.is-active { background: var(--sort-menu-hover); }
.sort-menu-listbox:focus-visible .sort-menu-option.is-active { box-shadow: inset 0 0 0 2px var(--sort-menu-selected); }
.sort-menu-option[aria-selected="true"] { color: var(--sort-menu-selected); font-weight: 600; }
.sort-menu-option[aria-disabled="true"] { opacity: .5; cursor: default; }
.sort-menu-check { flex: none; width: 16px; height: 16px; }
.sort-menu-option[aria-selected="true"] .sort-menu-check::before {
  content: ""; display: block; width: 5px; height: 10px; margin: 1px 0 0 5px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg);
}

/* Simple mode: the bordered « Trier » box stays as it was (arrows icon and
   chevron), the button simply fills it. */
body[data-experience-mode="simple"] .sort-control.has-sort-menu { cursor: pointer; }
body[data-experience-mode="simple"] .sort-control.has-sort-menu .sort-menu-button { min-height: 42px; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--ink); }
body[data-experience-mode="simple"] .sort-control.has-sort-menu .sort-menu-button:focus-visible { outline: none; }
body[data-experience-mode="simple"] .sort-control.has-sort-menu .sort-menu-chevron { display: none; }
body[data-experience-mode="simple"] .sort-control.is-sort-menu-open { border-color: #b39b8a; }
body[data-experience-mode="simple"] .sort-control.has-sort-menu > .icon:last-child { transition: none; }
body[data-experience-mode="simple"] .sort-control.is-sort-menu-open > .icon:last-child { transform: rotate(180deg); }

/* Advanced mode, « Plus de filtres » panel: same frame as the other fields. */
.select-field.has-sort-menu .sort-menu-button { min-height: 44px; padding: 9px 10px; border-color: #cfd9e2; border-radius: 8px; background: #fff; color: #17202a; }
.select-field.has-sort-menu .sort-menu-button:focus-visible { border-color: #6386a5; box-shadow: 0 0 0 3px rgba(47, 103, 151, .12); outline: 2px solid var(--accent, #176b53); outline-offset: 2px; }
.select-field.has-sort-menu .sort-menu-button[aria-expanded="true"] { border-color: #6386a5; }
body[data-experience-mode="advanced"] .sort-menu-listbox { border-color: var(--line, #dce3ea); background: #fff; color: #17202a; border-radius: 10px; box-shadow: 0 12px 35px rgba(22, 39, 57, .14); --sort-menu-hover: #eef3f7; }

/* Shared list page. */
.shared-sort.has-sort-menu { display: block; }
.shared-sort.has-sort-menu .sort-menu-button { min-height: 46px; padding: 10px 13px; border-color: #dfd3c7; border-radius: 10px; color: #5c514a; background: #fffdf9; }
.shared-sort.has-sort-menu .sort-menu-button[aria-expanded="true"] { border-color: #b39b8a; }

@media (prefers-reduced-motion: no-preference) {
  .sort-menu-chevron, body[data-experience-mode="simple"] .sort-control.has-sort-menu > .icon:last-child { transition: transform .16s ease; }
  .sort-menu-listbox.is-open { animation: sort-menu-in .14s ease-out; }
  .sort-menu-listbox.is-open[data-placement="top"] { animation-name: sort-menu-in-up; }
}
@keyframes sort-menu-in { from { opacity: 0; transform: translateY(-4px); } }
@keyframes sort-menu-in-up { from { opacity: 0; transform: translateY(4px); } }
