/*
 * Compléments à app.css (feuille de style d'origine de GameKlub, reprise telle quelle).
 * Uniquement ce que le rendu PHP sans framework demande en plus : états pilotés par l'attribut `hidden`,
 * formulaires natifs à la place des boutons React, et quelques ajustements.
 */
[hidden] { display: none !important; }
.product-card__form { display: contents; }
.product-card__form .product-card__cta { position: relative; }
.buybox form { display: contents; }
.buybox__incart a { font-weight: 600; }
.cart-list { margin: 0; padding: 0; list-style: none; }
.cart__tools { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; }
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--link, var(--brand-700)); text-decoration: underline; cursor: pointer; }
button.link:hover { text-decoration: none; }
.js [data-cart-update] { display: none; }
.confirm-box[data-confirm-box] { margin-top: 12px; }
.js [data-confirm]:not(.is-open) [data-confirm-box] { display: none; }
.js [data-confirm].is-open [data-confirm-open] { display: none; }
.search-box__list li { cursor: pointer; }
.search-box__empty { padding: 12px 14px; color: var(--muted); grid-template-columns: 1fr !important; cursor: default !important; }
[data-fav][aria-pressed="true"] .icon path { fill: currentColor; }
.buybox [data-fav][aria-pressed="true"] { color: var(--promo, #c2410c); border-color: currentColor; }
.auth-card__logo svg { height: 36px; width: auto; }
.brand svg { display: block; }
.account-card form + form { margin-top: 12px; }
.reservation-note p { white-space: pre-line; }
.faq .condition-scale { margin-top: 8px; }
.banner__nav-icon { margin-right: 10px; }
.share { display: inline-flex; align-items: center; gap: 10px; }
.reservation-aside p > .icon, .reservation-aside h2 > .icon, .reservation-page__subtitle > .icon { display: inline-block; vertical-align: -3px; margin-right: 6px; }

/* ---------- Administration (formulaires natifs) ---------- */
.admin-nav a .badge { margin-left: 4px; }
.extend-form__presets .chip { cursor: pointer; }
.extend-form__presets .chip input { margin: 0 4px 0 0; }
.extend-form__presets .chip:has(input:checked) { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.admin-actions form { display: contents; }
.admin-actions[data-confirm] { display: block; }
.admin-actions + .admin-actions { margin-top: 8px; }
.bulk-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.image-manager__list { display: flex; flex-wrap: wrap; gap: 12px; list-style: none; margin: 0 0 12px; padding: 0; }
.image-manager__list li { display: grid; gap: 4px; justify-items: center; }
.image-manager__list img { width: 96px; height: 96px; object-fit: contain; border: 1px solid var(--border); border-radius: 8px; background: #fff; }
.import-errors { white-space: pre-wrap; font-size: 0.8125rem; background: var(--surface-2, #f1f5f9); border-radius: 8px; padding: 10px 12px; margin: 8px 0 0; overflow-x: auto; }
.hours-editor__row { display: grid; grid-template-columns: 110px 1fr; gap: 12px; align-items: center; padding: 6px 0; }
.hours-editor__ranges input { width: 100%; max-width: 360px; }
.family-universe__editor, .family-platform__editor { display: grid; gap: 10px; padding: 10px 0; }
.family-platform > details > summary { cursor: pointer; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.inline-form label { display: inline-flex; align-items: center; gap: 6px; }
.pokemon-conditions input[type="text"], .pokemon-conditions textarea { width: 100%; }
.pokemon-conditions__order input { width: 4.5em; }
.pokemon-ext-form__keywords { display: grid; gap: 4px; }
.pokemon-ext-form__keywords textarea, .text-row__form textarea { width: 100%; }
.text-row__form { display: grid; gap: 8px; }
.admin-toolbar > form.inline-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; flex: 1; }
.products-table__thumb { object-fit: contain; }
fieldset.field { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
fieldset.field legend { font-weight: 600; padding: 0; margin-bottom: 4px; }
.account-card--danger [data-confirm-box] { margin-top: 12px; }
form.settings__form, form.product-form, form.pokemon-ext-form, .card > form.stack, .admin form.stack:not(.admin-note):not(.confirm-box) { max-width: none; }
.text-row__form .admin-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.promo-box form { display: contents; }
.admin select[multiple] { width: 100%; min-height: 7.5em; }
.cart-line__rule { display: block; }

/* ---------- Grands écrans ---------- */
/* Dans app.css, « .main-nav__list { margin: 0 } » annule le centrage de « .container » : au-delà de 1280 px, le menu
   restait collé à gauche alors que le reste de l'en-tête est centré. */
.main-nav__list.container { margin-inline: auto; }
/* Sans « Bons plans », « Occasions » reste à la suite des univers au lieu d'être repoussé seul à droite. */
.main-nav__item:last-child:not(.main-nav__item--promo) { margin-left: 0; }

/* ---------- Petits écrans ---------- */
/* Une colonne de grille ne doit jamais s'élargir à cause de son contenu (champ de fichier, liste, titre long). */
.product-admin__layout > *, .cart > *, .account-grid > *, .settings__grid > *, .reservation-page__layout > *, .catalog__layout > *, .product__layout > * { min-width: 0; }
.admin input, .admin select, .admin textarea, .account-card input, .cart-summary input, .auth-card input, input[type="file"] { max-width: 100%; }
.inline-form { flex-wrap: wrap; }
.admin-toolbar__search { min-width: 0; max-width: 100%; }
.admin-toolbar__search input { min-width: 0; }
.cart-line__body { min-width: 0; }
.cart-line__title, .cart-line__sku, .products-table__title, .reservation-items a, .admin-table__items { overflow-wrap: anywhere; }
.table-card { overflow-x: auto; position: relative; }
.card, .settings__section, .account-card { min-width: 0; }
.import-errors, .admin code { overflow-wrap: anywhere; }
@media (max-width: 700px) {
  /* Menus déroulants de l'admin : sur toute la largeur de la barre plutôt que débordant de l'écran. */
  .admin-nav { position: relative; }
  .admin-nav__group { position: static; }
  .admin-nav__menu { left: 8px; right: 8px; min-width: 0; }
  .hours-editor__row { grid-template-columns: 1fr; gap: 4px; }
  .bulk-bar .button { flex: 1 1 auto; }
}
@media (max-width: 380px) {
  .menu { position: static; }
  .menu__panel { left: 8px; right: 8px; min-width: 0; }
  .cart-line { grid-template-columns: 64px minmax(0, 1fr) auto; }
  .account-card { padding-inline: 14px; }
}
.stack > *, form.stack > *, .field, fieldset.field { min-width: 0; }
.admin .field select, .admin .field textarea { width: 100%; }
.admin .field select, .admin .field textarea, .admin .field input { min-width: 0; max-width: 100%; }
.field label, .field .field__hint, label.check { min-width: 0; overflow-wrap: anywhere; }
.inline-form label { flex-wrap: wrap; max-width: 100%; min-width: 0; }
.inline-form input, .inline-form select { min-width: 0; max-width: 100%; }
.promo-box .inline-form { display: flex; flex-wrap: nowrap; width: 100%; gap: 8px; }
.promo-box .inline-form input { flex: 1 1 0; width: 0; min-width: 0; }

/* ---------- Mode sombre ---------- */
/* Dans app.css, --brand-700 et --brand-800 servent presque partout de couleur de TEXTE (liens, onglet actif, puce
   active, titres accentués) mais ne sont pas éclaircies en mode sombre : texte bleu foncé sur fond sombre, illisible.
   Ici elles deviennent des teintes claires ; les rares fonds qui les utilisent gardent une teinte foncée. */


/* ---------- Tableaux sur petit écran : défilement horizontal plutôt que colonnes écrasées ---------- */
.admin-table__number, .reservation-number { white-space: nowrap; }
@media (max-width: 700px) {
  .admin-table table { min-width: 620px; }
  .reservation-items table { min-width: 0; }
}
@media (max-width: 700px) { .admin-table .inline-form select { max-width: 190px; } }

/* ---------- Photos de l'état des cartes, icônes d'extension (TCGdex) ---------- */
.image-card__actions form { display: flex; gap: 4px; margin: 0; }
.image-card__actions { flex-wrap: wrap; justify-content: space-between; }
.condition-photo__caption { margin: 0; }
.condition-photo__caption label { flex: 1 1 0; min-width: 0; display: flex; }
.condition-photo__caption input { width: 100%; }
.condition-photos .image-manager__add input[type="text"] { max-width: 100%; }
.condition-photos .image-manager__add input[type="file"], .pokemon-symbol-editor input[type="file"] { max-width: 100%; min-width: 0; font-size: .85rem; }
a.condition-gallery__thumb { color: inherit; }
.condition-gallery__dialog-body img { background: #fff; border-radius: var(--radius-sm); }
.pokemon-symbol-editor { margin-top: 10px; align-items: center; }
.pokemon-symbol-editor form { margin: 0; }
.pokemon-symbol-editor__hint { margin: 4px 0 10px; font-size: .85rem; }
.family-platform__title .pokemon-symbol-preview { margin-right: 4px; }
.pokemon-tcgdex-table { margin-top: 10px; }

/* =====================================================================================================
   Harmonisation générale : mêmes hauteurs, rayons, tailles de texte et états pour tous les champs,
   boutons et encadrés, sur le site comme dans l'administration.
   ===================================================================================================== */
:root { --control-h: 42px; --control-h-sm: 36px; --control-radius: 8px; --control-fs: .95rem; --control-fs-sm: .9rem; --ring: color-mix(in srgb, var(--brand-600) 24%, transparent); }

/* Champs */
input:not([type="radio"]):not([type="checkbox"]):not([type="range"]):not([type="search"]):not([type="color"]):not([type="hidden"]), select, textarea {
  min-height: var(--control-h); padding: 8px 12px; border-radius: var(--control-radius); font-size: var(--control-fs); line-height: 1.4;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
input[type="search"] { font-size: var(--control-fs); }
textarea { min-height: calc(var(--control-h) * 1.6); resize: vertical; }
:is(input:not([type="radio"]):not([type="checkbox"]):not([type="range"]):not([type="color"]), select, textarea):hover:not(:disabled):not(:focus) { border-color: color-mix(in srgb, var(--brand-600) 45%, var(--border-strong)); }
main :is(input:not([type="radio"]):not([type="checkbox"]):not([type="range"]):not([type="color"]), select, textarea):focus { border-color: var(--brand-600); box-shadow: 0 0 0 3px var(--ring); outline: none; }
:is(input, select, textarea)::placeholder { color: var(--muted); opacity: .8; }
:is(input, select, textarea, button):disabled { cursor: not-allowed; }
:is(input, select, textarea):disabled { background: var(--surface-2); opacity: .7; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--brand-600); width: 16px; height: 16px; flex: none; margin: 0; }
label:has(> input[type="checkbox"]), label:has(> input[type="radio"]) { cursor: pointer; }

/* Listes déroulantes : place réservée à la flèche partout, texte coupé proprement */
select { padding-right: 34px; text-overflow: ellipsis; max-width: 100%; cursor: pointer; }
select[multiple] { background-image: none; padding: 6px; min-height: 0; cursor: default; }
select[multiple] option { padding: 5px 8px; border-radius: 6px; }

/* Contextes compacts : barres de filtres, formulaires en ligne, tableaux */
:is(.inline-form, .assign-form, .admin-filters__row, .bulk-bar, .catalog__sort, .admin-table td, .pokemon-conditions, .admin-toolbar, .promo-box) :is(input:not([type="radio"]):not([type="checkbox"]):not([type="range"]):not([type="color"]):not([type="hidden"]), select) {
  min-height: var(--control-h-sm); padding-top: 5px; padding-bottom: 5px; padding-left: 10px; font-size: var(--control-fs-sm);
}
:is(.inline-form, .assign-form, .admin-filters__row, .bulk-bar, .catalog__sort, .admin-table td, .admin-toolbar) select { padding-right: 30px; }
:is(.inline-form, .assign-form, .admin-filters__row, .bulk-bar, .catalog__sort, .admin-table td, .admin-toolbar) input:not([type="radio"]):not([type="checkbox"]):not([type="search"]):not([type="file"]) { padding-right: 10px; }
:is(.admin-table td, .pokemon-conditions, .pokemon-ext-form, .text-row__form) textarea { font-size: var(--control-fs-sm); min-height: var(--control-h-sm); }
.inline-form label, .inline-form .check { min-width: 0; max-width: 100%; }
.inline-form :is(input:not([type="checkbox"]):not([type="radio"]), select) { min-width: 0; max-width: 100%; }
.assign-form select { width: min(100%, 290px); }

/* Envoi de fichier : même bouton que le reste du site */
input[type="file"] { padding: 4px 10px 4px 4px; min-height: var(--control-h-sm); font-size: var(--control-fs-sm); color: var(--muted); background: var(--surface); cursor: pointer; }
input[type="file"]::file-selector-button {
  margin: 0 10px 0 0; padding: 5px 12px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); color: var(--link, var(--brand-700));
  font: inherit; font-weight: 700; font-size: .85rem; cursor: pointer; transition: border-color .15s ease, background-color .15s ease;
}
input[type="file"]:hover::file-selector-button { border-color: var(--brand-600); background: var(--brand-50); }

/* Libellés et aides */
.field { align-content: start; }
.field > label, fieldset.field legend, form.stack > label, .auth-card label, .account-card label { font-size: .9rem; font-weight: 600; }
.field__hint { font-size: .82rem; line-height: 1.45; }
button.primary { font-size: .95rem; }

/* Encadrés : même rayon, même marge intérieure, mêmes titres */
.card, .settings__section, .account-card, .cart-summary, details.family-universe, .confirm-box, .table-card { border-radius: var(--radius-lg); }
.card { padding: 20px 22px; }
.card > h2:first-child, .card > h2, .settings__section > h2, .account-card > h2 { font-size: 1.1rem; line-height: 1.3; margin: 0 0 8px; }
.card > h2 + p.muted, .settings__section > h2 + p.muted { margin-top: 0; font-size: .9rem; }
details.family-universe { overflow: hidden; }

/* Icône d'extension dans l'administration */
.pokemon-symbol-editor > span:first-child { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: .9rem; font-weight: 600; }
input[type="file"] { padding: 3px 10px 3px 3px !important; min-height: var(--control-h-sm) !important; }
input[type="file"]::file-selector-button { padding: 4px 12px; }
.admin input[type="search"] { min-height: var(--control-h-sm); }
.admin-table td form.inline-form > select, .admin-table td form.inline-form label > select { width: 260px; }

/* Menu Pokémon : colonnes assez larges, noms coupés proprement, icônes alignées, compteurs dans leur colonne */
.mega__blocks { grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 10px 24px; }
.mega .mega__extensions a { min-width: 0; gap: 8px; }
.mega__ext .ext-mark, .pokemon-universe .ext-mark { flex: 1 1 0; min-width: 0; }
.mega__ext .ext-mark__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mega__ext .ext-mark:not(:has(.ext-mark__icon)) { padding-left: 22px; }
.mega__ext .mega__count { flex: none; }

/* Barre d'administration sur petit écran : titre et recherche sur la même ligne, liens dessous */
@media (max-width: 720px) {
  .admin-nav { gap: 6px 10px; }
  .admin-nav__search { order: 1; flex: 1 1 0; min-width: 0; }
  .admin-nav__search label { flex: 1 1 0; min-width: 0; }
  .admin-nav__search input[type="search"] { width: 100%; }
  .admin-nav > ul { order: 2; width: 100%; gap: 2px; }
  .admin-nav a, .admin-nav__group summary { padding: 6px 10px; }
}

/* =====================================================================================================
   Bandeaux de rubrique : moins plats (reflets, motif discret), image de fond posée depuis l'admin
   ===================================================================================================== */
.banner { isolation: isolate; min-height: 190px; align-content: center;
  background:
    radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--universe-color, var(--brand)) 55%, #fff) 0%, transparent 46%),
    radial-gradient(90% 120% at 82% 115%, rgba(0, 0, 0, .38) 0%, transparent 60%),
    linear-gradient(105deg, color-mix(in srgb, var(--universe-color, var(--brand)) 62%, #07131d) 0%, color-mix(in srgb, var(--universe-color, var(--brand)) 88%, #000) 100%);
  box-shadow: 0 10px 28px -18px color-mix(in srgb, var(--universe-color, var(--brand)) 80%, #000); }
.banner::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .5;
  background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, .07) 0 2px, transparent 2px 18px);
  -webkit-mask-image: linear-gradient(90deg, transparent 30%, #000 100%); mask-image: linear-gradient(90deg, transparent 30%, #000 100%); }
.banner::after { content: ""; position: absolute; z-index: -1; right: -70px; top: -90px; width: 340px; height: 340px; border-radius: 50%; pointer-events: none;
  border: 44px solid rgba(255, 255, 255, .07); }
.banner h1 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); letter-spacing: -.02em; text-wrap: balance; }
.banner--image { min-height: clamp(210px, 26vw, 320px);
  background: linear-gradient(90deg, rgba(7, 19, 29, .9) 0%, rgba(7, 19, 29, .68) 42%, rgba(7, 19, 29, .18) 100%), var(--banner-image) center / cover no-repeat, #0b1a26; }
.banner--image::before, .banner--image::after { display: none; }
@media (max-width: 640px) { .banner--image { background: linear-gradient(180deg, rgba(7, 19, 29, .78) 0%, rgba(7, 19, 29, .86) 100%), var(--banner-image) center / cover no-repeat, #0b1a26; } .banner::after { display: none; } }

/* Vignettes de rubrique */
.platform-card__mark--photo { background: var(--surface-2); overflow: hidden; width: 56px; height: 42px; padding: 0; }
.platform-card__mark--photo img, .universe-index__thumb img, .block-card__cover img, .section-image__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.universe-index__thumb { flex: none; width: 44px; height: 32px; border-radius: 6px; overflow: hidden; align-self: center; background: var(--surface-2); }
.block-card__cover { display: block; aspect-ratio: 16 / 6; margin: -2px -2px 10px; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }

/* Accueil : ajouts du jour */
.fresh { margin: 0 0 40px; }
.fresh--today { padding: 18px 18px 6px; border: 1px solid var(--brand-200); border-radius: var(--radius-lg); background: linear-gradient(180deg, var(--brand-50), transparent 70%); }
.fresh--today .section { margin-bottom: 8px; }
.fresh--today .section-head h2::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 10px; border-radius: 50%; background: var(--promo, #c2410c); box-shadow: 0 0 0 4px color-mix(in srgb, var(--promo, #c2410c) 22%, transparent); vertical-align: middle; }
.hero__fact--today strong { color: #fff; font-size: 2rem; }
.hero__fact--today span, .hero__fact--today a { color: #fff; font-weight: 700; }
.badge--new { background: var(--promo, #c2410c); color: #fff; }

/* Articles sauvegardés : même grille que le catalogue */
.product-grid--saved { margin-bottom: 20px; }

/* Réseaux sociaux */
.social-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.social-links a { display: inline-flex; align-items: center; min-height: 32px; padding: 4px 12px; border: 1px solid var(--border-strong); border-radius: 999px; font-size: .85rem; font-weight: 700; color: var(--foreground); background: var(--surface); }
.social-links a:hover { border-color: var(--brand-600); text-decoration: none; }
.site-footer__social a { border-color: rgba(255, 255, 255, .35); background: transparent; color: #fff; }
.site-footer__social a:hover { border-color: #fff; background: rgba(255, 255, 255, .12); color: #fff; }
.social-editor { display: grid; gap: 8px; margin: 10px 0 14px; max-width: 720px; }
.social-editor__row { display: flex; gap: 8px; }
.social-editor__row select { width: 160px; }
.social-editor__url { flex: 1 1 0; min-width: 0; }
.social-editor__url input { width: 100%; }

/* Administration : activation, zone de dépôt, import, images des rubriques */
.products-table__toggle { display: block; margin-top: 4px; font-size: .82rem; }
.bulk-bar { margin-top: 12px; }
.bulk-bar [data-bulk-confirm][hidden] { display: none; }
.dropzone { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 16px; border: 2px dashed var(--border-strong); border-radius: var(--radius-lg); background: var(--surface-2); transition: border-color .15s ease, background-color .15s ease; }
.dropzone__label { flex: 1 1 260px; display: grid; gap: 6px; cursor: pointer; }
.dropzone.is-enhanced [data-dropzone-submit] { display: none; }
.dropzone.is-enhanced input[type="file"] { max-width: 340px; }
.dropzone.is-drag, form[data-dropzone].is-drag { border-color: var(--brand-600); background: var(--brand-50); }
form[data-dropzone].is-sending { opacity: .6; pointer-events: none; }
.image-card__actions { align-items: center; }
.import-progress { display: grid; gap: 6px; padding: 14px; border: 1px solid var(--brand-200); border-radius: var(--radius); background: var(--brand-50); }
.import-progress p { margin: 0; }
.import-progress__label { font-weight: 700; }
.import-progress progress { width: 100%; height: 12px; accent-color: var(--brand-600); }
.import-keeps { margin: 0 0 8px; padding-left: 18px; font-size: .9rem; display: grid; gap: 3px; }
.section-images { display: grid; gap: 8px; margin: 0; padding: 12px; list-style: none; }
.section-images.card { padding: 14px; }
.section-image { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.section-image:last-child { border-bottom: 0; }
.section-image__thumb { flex: none; width: 112px; height: 42px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; background: var(--surface-2); font-size: .78rem; }
.section-image__name { flex: 1 1 160px; min-width: 0; font-weight: 600; }
.section-image form { margin: 0; }
.section-image.is-drag { background: var(--brand-50); }
.platform-card__mark--photo, .universe-index__thumb { position: relative; }
.platform-card__mark--photo img, .universe-index__thumb img { position: absolute; inset: 0; }
fieldset.field .check { align-items: flex-start; }
fieldset.field .check input { margin-top: 3px; }
.dropzone, .dropzone__label { min-width: 0; }
.dropzone__label { flex: 1 1 200px; }
.dropzone input[type="file"], .dropzone.is-enhanced input[type="file"] { width: 100%; max-width: 340px; min-width: 0; }
.product-admin__status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.section-image form.inline-form { flex: 1 1 200px; min-width: 0; }
.section-image form.inline-form label { flex: 1 1 120px; min-width: 0; }
.section-image input[type="file"] { width: 100%; min-width: 0; }
.image-grid { grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); }

/* =====================================================================================================
   Statistiques : chiffres clés, graphiques en barres (une série, une échelle), classements
   ===================================================================================================== */
.stats__block { margin: 0 0 36px; }
.stats__block > h2 { font-size: 1.25rem; margin: 0 0 12px; }
.stats-filters { display: grid; gap: 10px; margin: 0 0 22px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.stats-filters__periods { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.stats-filters__custom { gap: 8px 14px; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(210px, 100%), 1fr)); gap: 12px; margin: 0 0 14px; }
.kpi { display: grid; align-content: start; gap: 4px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); min-width: 0; }
.kpi--lead { border-color: var(--brand-200); background: linear-gradient(180deg, var(--brand-50), var(--surface) 80%); }
.kpi__label { font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.kpi__value { font-size: 1.55rem; font-weight: 800; line-height: 1.15; letter-spacing: -.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.kpi--lead .kpi__value { font-size: 1.9rem; }
.kpi__hint { font-size: .82rem; color: var(--muted); line-height: 1.4; }
.kpi__delta { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.kpi__delta--good { background: var(--success-soft); color: var(--success); }
.kpi__delta--bad { background: var(--danger-soft); color: var(--danger); }
.kpi__delta--flat { background: var(--surface-2); color: var(--muted); }
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: 12px; }
.chart-card { padding: 14px 16px 10px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); min-width: 0; }
.chart-card__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 6px; }
.chart-card__head h3 { margin: 0; font-size: .95rem; }
.chart-card__head strong { font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.chart-card__empty { margin: 0; padding: 48px 0; text-align: center; }
.chart-card__note { margin: 4px 0 0; font-size: .8rem; }
.chart-card__table { margin-top: 6px; font-size: .85rem; }
.chart-card__table summary { cursor: pointer; color: var(--link, var(--brand-700)); font-weight: 600; padding: 4px 0; }
.chart-card__table .table-card { max-height: 260px; overflow: auto; margin-top: 6px; }
.chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart__grid { stroke: var(--border); stroke-width: 1; stroke-dasharray: 2 4; }
.chart__axis { stroke: var(--border-strong); stroke-width: 1; }
.chart__tick, .chart__label { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart__bar { fill: var(--brand-600); transition: fill .12s ease; }
.chart__hit { fill: transparent; }
.chart__col:hover .chart__bar { fill: var(--brand-800); }
.chart__col:hover .chart__hit { fill: color-mix(in srgb, var(--brand-600) 9%, transparent); }
.rank-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 12px; margin-bottom: 10px; }
.rank-card { padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); min-width: 0; }
.rank-card h3 { margin: 0 0 10px; font-size: .95rem; }
.rank { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; counter-reset: rang; }
.rank__item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 12px; align-items: baseline; font-size: .9rem; counter-increment: rang; }
.rank__label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank__label::before { content: counter(rang) ". "; color: var(--muted); font-variant-numeric: tabular-nums; }
.rank__sub { font-size: .8rem; }
.rank__value { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rank__bar, .funnel__bar { grid-column: 1 / -1; height: 4px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.rank__bar span, .funnel__bar span { display: block; height: 100%; border-radius: 4px; background: var(--brand-600); }
.funnel { display: grid; gap: 10px; margin: 0 0 10px; padding: 16px; list-style: none; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.funnel__step { display: grid; grid-template-columns: minmax(120px, 220px) minmax(0, 1fr) auto; gap: 12px; align-items: center; font-size: .92rem; }
.funnel__bar { grid-column: auto; height: 12px; border-radius: 6px; }
.funnel__bar span { border-radius: 6px; }
.funnel__value { font-variant-numeric: tabular-nums; min-width: 3.5em; text-align: right; }
.stats__method { font-size: .82rem; max-width: 90ch; }
@media (max-width: 560px) { .funnel__step { grid-template-columns: minmax(0, 1fr) auto; } .funnel__bar { grid-column: 1 / -1; order: 3; } }
.admin-nav > ul { flex: 1 1 0; min-width: 0; }
@media (max-width: 720px) { .admin-nav > ul { flex: 1 1 100%; } }
.stats .funnel { padding: 16px 18px; }
.stats .kpi-grid { grid-template-columns: repeat(auto-fit, minmax(min(185px, 100%), 1fr)); }
.stats .chart-grid { grid-template-columns: repeat(auto-fit, minmax(min(520px, 100%), 1fr)); }
.kpi--lead .kpi__value { font-size: clamp(1.3rem, 1.9vw, 1.7rem); }
.kpi__value { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* =====================================================================================================
   Finitions « boutique » : cartes, visuels de remplacement, navigation mobile, messages, transitions
   ===================================================================================================== */
/* Visuel de remplacement : sobre, un pictogramme dans une pastille, le nom de la plateforme discret */
.product-image--placeholder { gap: 8px; color: var(--muted);
  background-color: var(--surface-2);
  background-image: radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--platform-color, var(--brand-700)) 10%, transparent), transparent 70%); }
.product-image--placeholder svg { width: 44px; height: 44px; padding: 10px; margin: 0 auto; border-radius: 50%; opacity: 1; color: var(--platform-color, var(--brand-700));
  background: var(--surface); box-shadow: 0 1px 0 var(--border), 0 0 0 1px var(--border); box-sizing: border-box; }
.product-image__label { font-size: .82rem; font-weight: 700; letter-spacing: .02em; color: var(--foreground); opacity: .75; }
.product-image__sub { display: none; }
.product-image--large.product-image--placeholder svg { width: 88px; height: 88px; padding: 20px; }
.product-image--large .product-image__label { font-size: 1.05rem; }
.mini__thumb .product-image--placeholder svg { display: none; }

/* Cartes produit : le titre et le prix d'abord, le stock seulement quand il compte */
.product-card { transition: box-shadow .16s ease, transform .16s ease, border-color .16s ease; }
.product-card:hover { box-shadow: 0 10px 24px -14px rgba(10, 30, 50, .35); transform: translateY(-2px); }
.product-card__title { font-weight: 650; }
.product-card__price { font-size: 1.25rem; letter-spacing: -.01em; }
.product-card__stock:not(.product-card__stock--low) { display: none; }
.product-card__platform { font-size: .7rem; }

/* Fiche produit sur téléphone : retour direct à la rubrique, barre « Réserver » toujours visible */
.product__back { display: none; margin: 0 0 8px; font-weight: 600; font-size: .92rem; }
.buybar { display: none; }
@media (max-width: 760px) {
  .product__back { display: block; }
  .product > nav[aria-label="Fil d'Ariane"] { display: none; }
  .buybar { position: fixed; z-index: 90; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -8px 24px -16px rgba(10, 30, 50, .5); }
  .buybar__price { display: grid; line-height: 1.2; min-width: 0; }
  .buybar__price strong { font-size: 1.2rem; }
  .buybar__price .muted { font-size: .78rem; }
  .buybar .button { flex: none; }
  .product { padding-bottom: 76px; }
}

/* Catalogue sur téléphone : bouton « Filtres » collé en bas, panneau plein écran */
@media (max-width: 960px) {
  .catalog__layout { padding-bottom: 64px; }
  .filters:not([open]) { border: 0; background: none; height: 0; }
  .filters:not([open]) > summary { position: fixed; z-index: 80; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); transform: translateX(-50%);
    gap: 8px; padding: 11px 22px; border-radius: 999px; background: var(--brand-600); color: #fff; box-shadow: 0 10px 24px -8px rgba(10, 30, 50, .55); white-space: nowrap; }
  .filters:not([open]) > summary .icon { color: #fff; transform: rotate(180deg); }
  .filters[open] { position: fixed; z-index: 220; inset: 0; overflow: auto; overscroll-behavior: contain; border: 0; border-radius: 0; }
  .filters[open] > summary { position: sticky; top: 0; z-index: 2; background: var(--surface); border-bottom: 1px solid var(--border); padding: 16px; font-size: 1.05rem; }
  .filters[open] > summary::after { content: "Fermer"; font-size: .88rem; font-weight: 700; color: var(--link, var(--brand-700)); }
  .filters[open] > summary .icon { display: none; }
  .filters[open] .filters__form { padding-bottom: 96px; border-top: 0; }
  .filters[open] .filters__form > button[type="submit"], .filters[open] .filters__form > .filters__actions { position: fixed; left: 16px; right: 16px; bottom: calc(14px + env(safe-area-inset-bottom)); width: auto; z-index: 3; box-shadow: 0 10px 24px -8px rgba(10, 30, 50, .5); }
}

/* Menu : panneau « Plus », lien Nouveautés */
.mega__more-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 20px; margin: 0; padding: 0; list-style: none; }
.mega .mega__more-list a { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px; border-radius: var(--radius); color: var(--foreground); }
.mega .mega__more-list a:hover { background: var(--surface-2); text-decoration: none; }
.mega__more-list .nav-icon { color: var(--universe-color, var(--brand-700)); }
.mega__more-list .muted { font-size: .82rem; font-weight: 400; }
.mega:not([hidden]) { animation: gk-pop .14s ease-out; }
@keyframes gk-pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* Accueil : photo du magasin en fond du bandeau */
.hero--image { background-image: linear-gradient(95deg, rgba(6, 22, 36, .92) 0%, rgba(6, 22, 36, .74) 48%, rgba(6, 22, 36, .35) 100%), var(--hero-image); background-size: cover; background-position: center; }

/* Messages de confirmation et d'erreur : bandeaux encadrés, le succès s'efface seul */
.notice { display: flex; align-items: flex-start; gap: 10px; max-width: var(--container, 1280px); margin: 12px auto; padding: 12px 16px; border: 1px solid; border-radius: var(--radius); font-weight: 600; font-size: .95rem;
  box-shadow: 0 6px 18px -14px rgba(10, 30, 50, .5); transition: opacity .3s ease, transform .3s ease; }
.notice::before { content: ""; flex: none; width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; background: currentColor; }
.notice--success { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 45%, transparent); color: var(--success); }
.notice--error { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 45%, transparent); color: var(--danger); }
.notice.is-leaving { opacity: 0; transform: translateY(-6px); }
.notice__close { margin-left: auto; border: 0; background: none; color: inherit; font: inherit; font-size: 1.1rem; line-height: 1; cursor: pointer; padding: 2px 4px; }

/* États vides : un pictogramme au trait, une bordure moins « chantier » */
.empty-state { border-style: solid; border-color: var(--border); border-radius: var(--radius-lg); padding: 44px 16px; }
.empty-state::before { content: ""; display: block; width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%; background: var(--brand-50) center / 28px no-repeat;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230369a1' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 8l9-5 9 5v8l-9 5-9-5V8Z'/%3E%3Cpath d='M3 8l9 5 9-5M12 13v8'/%3E%3C/svg%3E"); }
.empty-suggest { justify-content: center; margin: 18px 0 28px; }

/* Bouton en cours d'envoi */
.button.is-loading, button.primary.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.button.is-loading::after, button.primary.is-loading::after { content: ""; position: absolute; inset: 0; margin: auto; width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .55); border-top-color: #fff; animation: gk-spin .7s linear infinite; }
.button--ghost.is-loading::after, .button--light.is-loading::after { border-color: color-mix(in srgb, var(--brand-600) 35%, transparent); border-top-color: var(--brand-600); }
@keyframes gk-spin { to { transform: rotate(360deg); } }
.shop-address__map { font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .mega:not([hidden]), .button.is-loading::after { animation: none; } .product-card, .notice { transition: none; } .product-card:hover { transform: none; } }
.admin-nav { gap: 6px 10px; }
.admin-nav a, .admin-nav__group summary { padding: 8px 10px; }
.admin-nav__search input[type="search"] { width: 150px; }
@media (max-width: 960px) { .filters[open] .filters__actions { display: flex; gap: 8px; } .filters[open] .filters__actions .button { flex: 1 1 0; justify-content: center; } }
