/* GASPARD — Catalogue : styles propres au catalogue (le socle est dans /shared/gaspard.css).
   Direction éditoriale du 28/11/2026 : onglets soulignés, pastilles, un cadre noir par catégorie,
   prix en étiquette jaune, mentions en italique Lora, barre d'enregistrement noire. */

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* En-tête */
.page-head-compact { margin-bottom: 8px; }
.page-sub { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-top: 10px; font: 500 13px/18px var(--text); color: var(--ink-2); }
.to-check-btn {
  min-height: 30px; padding: 0 10px; border: 1.5px dashed var(--ink); background: transparent; color: var(--ink);
  font: 600 13px/18px var(--text);
}
.to-check-btn.is-on { border-style: solid; background: var(--ink); color: var(--yellow); }

/* Barre des filtres, collée sous la barre du haut */
.filterbar {
  position: sticky; top: calc(56px + env(safe-area-inset-top)); z-index: 6;
  margin: 0 calc(-1 * var(--pad)); padding: 4px var(--pad) 10px;
  background: var(--cream);
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px;
}
.filterbar.is-stuck { box-shadow: 0 1px 0 var(--line); }
body.on-catalogue .topbar.is-scrolled { box-shadow: none; }

.toolbar { display: flex; align-items: center; gap: 6px; }
.search {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 10px;
  height: 44px; padding: 0 2px;
  border-bottom: 1.5px solid var(--ink);
}
.search:focus-within { border-bottom-color: var(--yellow); box-shadow: 0 1.5px 0 var(--yellow); }
.search svg { width: 18px; height: 18px; flex: none; color: var(--ink); }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; font: 400 16px/24px var(--text); }
.search input::placeholder { color: var(--ink-3); }
.filter-btn {
  flex: none; position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border: 0; background: transparent; color: var(--ink);
}
.filter-btn svg { width: 21px; height: 21px; }
#filter-count {
  position: absolute; top: 4px; right: 2px; min-width: 18px; height: 18px; padding: 0 4px;
  background: var(--yellow); color: var(--ink); font: 800 11px/18px var(--display); text-align: center;
}
#filter-count:empty { display: none; }

/* Moments : onglets en texte, soulignés en jaune */
.tabs { display: flex; justify-content: space-between; gap: 4px; border-bottom: 1px solid var(--line); }
.tabs button {
  position: relative; min-height: 40px; padding: 8px 2px 9px; border: 0; background: transparent;
  font: 600 13.5px/18px var(--text); color: var(--muted); white-space: nowrap;
}
.tabs button.is-on { color: var(--ink); }
.tabs button.is-on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: var(--yellow); }

/* Pastilles (saisons, étoiles, unités, tags) */
.pills, .season-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.pill, .season-picker button {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  min-height: 36px; padding: 0 11px; border: 1px solid var(--line); background: var(--paper); color: #4A463F;
  font: 500 13px/16px var(--text); white-space: nowrap;
}
.pill.is-on, .season-picker button.is-on { background: var(--ink); border-color: var(--ink); color: var(--yellow); }
.season-pills { flex-wrap: nowrap; gap: 6px; }
.season-pills .pill { flex: 1 1 0; min-width: 0; padding: 0 6px; font-size: 13px; }
/* le nom de la saison n'apparaît que sur la pastille choisie (les autres : icône, nom au survol) */
.season-pills .pill:not(.is-on) span { display: none; }
.season-pills .pill.is-on { flex: 2.2 1 0; }
.season-pills .pill .season-icon { width: 15px; height: 15px; }
.pill.is-now:not(.is-on) { box-shadow: inset 0 -3px 0 var(--yellow); }
.only-season { display: flex; align-items: center; gap: 10px; min-height: 32px; font: italic 400 14px/20px var(--serif); color: var(--muted); }

/* Filtres actifs */
.active-filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 6px; }
.active-filters:empty { display: none; }
.pill-remove {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 34px; padding: 0 8px 0 11px; border: 0; background: var(--yellow); color: var(--ink);
  font: 600 13px/16px var(--text);
}
.pill-x { font: 400 18px/16px var(--text); }

/* Icônes et étoiles */
.season-icon { width: 16px; height: 16px; flex: none; }
.star-glyph { font: 400 15px/16px var(--text); letter-spacing: 1.5px; }

/* Liste : moment en titre centré + sous-titre italique ; une carte encadrée par catégorie */
.moment-head { margin: 34px 0 14px; text-align: center; }
.moment-head h2 { margin: 0; font: 800 20px/26px var(--display); text-transform: uppercase; letter-spacing: 0.3px; }
.moment-head p { margin: 2px 0 0; font: italic 400 15px/22px var(--serif); color: var(--muted); }
.moment-head::after { content: ""; display: block; width: 28px; height: 4px; margin: 12px auto 0; background: var(--yellow); }
#list > .cat-card:first-child, #list > .moment-head:first-child { margin-top: 14px; }

.cat-card { margin: 0 0 16px; background: var(--paper); border: var(--border); }
.cat-head { padding: 16px 16px 6px; text-align: center; }
.cat-head h3 { margin: 0; font: 800 15px/20px var(--display); text-transform: uppercase; letter-spacing: 0.4px; }
.cat-head p { margin: 2px 0 0; font: italic 400 13px/18px var(--serif); color: var(--muted); }
.cat-rows .row { padding: 12px 16px; align-items: flex-start; }
.cat-rows .row + .row { border-top: 1px solid var(--hair); }
.row.is-selected { background: var(--yellow-soft); }

.item-main { flex: 1; min-width: 0; padding-top: 1px; }
.item-name {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font: 600 15px/20px var(--text);
}
.item-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 9px; margin-top: 4px; color: var(--muted); }
.item-stars { color: var(--ink); font-size: 13px; }
.item-seasons { display: inline-flex; gap: 4px; color: var(--ink); }
.item-seasons .season-icon { width: 15px; height: 15px; }
.item-note { font: italic 400 13px/17px var(--serif); color: var(--muted); }

.item-price { flex: none; max-width: 46%; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; text-align: right; }
.price-tag {
  display: inline-block; padding: 3px 8px; background: var(--yellow); color: var(--ink);
  font: 700 13px/18px var(--text); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.price-none { font: italic 400 14px/20px var(--serif); color: var(--muted); white-space: nowrap; }
.item-price small { font: italic 400 12.5px/16px var(--serif); color: var(--muted); }
.item-price small.to-check { color: var(--ink); text-decoration: underline; text-decoration-color: var(--yellow); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.row.is-archived .item-name { color: var(--ink-3); }
/* Hors saison : visible mais grisé, rangé après */
.row.is-off-season .item-main, .row.is-off-season .item-price { opacity: 0.42; }

.tag {
  display: inline-flex; align-items: center; height: 22px; padding: 0 7px;
  background: var(--sand); color: var(--ink);
  font: 500 12px/14px var(--text);
}
.offline-note { text-align: center; margin: 16px 0 0; color: var(--ink-2); }

/* Panneau Filtres */
.sheet-short { top: auto; max-height: calc(100dvh - 48px); }
@media (min-width: 760px) {
  .sheet-short { top: 10vh; bottom: auto; max-height: 80vh; }
}
.form-group { margin: 22px 0 10px; font: 600 11px/16px var(--text); letter-spacing: 1px; text-transform: uppercase; color: var(--ink-2); }
.sheet-body > .form-group:first-child { margin-top: 4px; }
.tag-filter { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-choice {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 0 11px; border: 1px solid var(--line); background: var(--paper);
  font: 500 13px/18px var(--text);
}
.tag-choice span { color: var(--muted); font: italic 400 12px var(--serif); }
.tag-choice.is-on { background: var(--ink); border-color: var(--ink); color: var(--yellow); }
.tag-choice.is-on span { color: var(--yellow); }
.archive-toggle { display: flex; align-items: center; gap: 10px; margin-top: 24px; font: 500 15px/20px var(--text); }
.archive-toggle input { width: 20px; height: 20px; accent-color: var(--ink); margin: 0; }
.filters-foot { display: grid; grid-template-columns: 1fr 2fr; gap: 8px; }
.filters-foot .btn { padding: 0 12px; }
.filters-foot .btn-ghost { color: var(--cream); box-shadow: inset 0 0 0 1.5px var(--yellow); }

/* Fiche produit */
.sheet-crumb { margin: 0; font: italic 400 14px/20px var(--serif); color: var(--muted); }
.field-title { margin-bottom: 6px; }
.title-input.input {
  height: auto; min-height: 40px; padding: 2px 0 6px; border: 0; border-bottom: 1.5px solid transparent; background: transparent;
  font: 800 21px/27px var(--display); resize: none;
}
.title-input.input:hover { border-bottom-color: var(--line); }
.title-input.input:focus { border-bottom-color: var(--ink); box-shadow: none; }
.title-input::placeholder { color: var(--ink-3); }
.price-preview { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 18px; min-height: 26px; }
.price-preview .price-tag { font-size: 14px; padding: 4px 9px; }
.price-per { font: italic 400 14px/20px var(--serif); color: var(--muted); }

.sheet-body .field > .label, .sheet-body .switch-row .label { margin-bottom: 6px; }
.sheet-body textarea.input:not(.title-input) { height: auto; min-height: 48px; padding: 11px 14px; resize: none; display: block; }
.select-wrap { position: relative; display: block; }
.select-wrap::after {
  content: ""; position: absolute; right: 16px; top: 50%; width: 8px; height: 8px; margin-top: -6px;
  border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: rotate(45deg); pointer-events: none;
}
.select-wrap select { -webkit-appearance: none; appearance: none; padding-right: 40px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
#price-row.grid-2 { align-items: end; }
.input-suffix { position: relative; display: block; }
.input-suffix input { padding-right: 36px; font-variant-numeric: tabular-nums; }
.input-suffix em { position: absolute; right: 14px; top: 12px; font: 700 16px/24px var(--text); font-style: normal; color: var(--ink-2); }
.season-picker .season-icon { width: 16px; height: 16px; }
.field-hint { display: block; margin-top: 6px; font: italic 400 13px/18px var(--serif); color: var(--muted); }
.field-hint:empty { display: none; }

.tag-editor { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; height: auto; min-height: 48px; padding: 8px 10px; }
.tag-editor .tag { height: 28px; padding: 0 4px 0 9px; gap: 4px; font-size: 13px; }
.tag-editor .tag button { border: 0; background: transparent; width: 20px; height: 20px; padding: 0; font: 700 16px/20px var(--text); }
.tag-editor .tag.is-warning { background: var(--yellow); }
#tag-input { flex: 1; min-width: 120px; height: 28px; border: 0; outline: 0; background: transparent; font: 400 16px/24px var(--text); }
.tag-suggest { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag-suggest:empty { display: none; }
.tag-suggest button {
  min-height: 30px; padding: 0 9px; border: 1px dashed var(--ink-3); background: transparent; color: var(--ink-2);
  font: 500 13px/16px var(--text);
}

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; margin: 8px 0 16px; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); }
.switch-row small { display: block; margin-top: 2px; font: italic 400 13px/18px var(--serif); color: var(--muted); }
.switch {
  -webkit-appearance: none; appearance: none; flex: none; margin: 0;
  width: 50px; height: 28px; border: 1.5px solid var(--ink); background: var(--paper); position: relative; cursor: pointer;
}
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; background: var(--ink-3); transition: transform .15s, background .15s; }
.switch:checked { background: var(--yellow); }
.switch:checked::after { transform: translateX(22px); background: var(--ink); }
.switch-sm { width: 42px; height: 24px; }
.switch-sm::after { width: 15px; height: 15px; }
.switch-sm:checked::after { transform: translateX(18px); }

.history-row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px; }
.history-row + .history-row { border-top: 1px solid var(--hair); }
.history-row span:first-child { font: 700 14px/20px var(--text); font-variant-numeric: tabular-nums; }
.history-row span:last-child { font: italic 400 14px/20px var(--serif); color: var(--muted); }

.link-danger {
  display: block; margin: 28px auto 8px; padding: 8px; border: 0; background: transparent; color: var(--red);
  font: 600 13px/16px var(--text); text-decoration: underline; text-underline-offset: 4px;
}
.link-danger.is-confirm { width: 100%; height: 48px; background: var(--red); color: #fff; text-decoration: none; }

/* Barre noire d'enregistrement */
.sheet-foot-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.save-state { font: italic 400 14px/20px var(--serif); color: rgba(250, 248, 245, 0.6); }
.sheet-foot-bar.is-dirty .save-state { color: var(--yellow); }
.sheet-foot-bar .btn { flex: none; min-width: 150px; }

.sheet-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 24px; text-align: center; }
.sheet-empty .label { color: var(--ink); font: 800 15px/20px var(--display); letter-spacing: 0.3px; }
.sheet-empty p { margin: 0; max-width: 280px; font: italic 400 15px/22px var(--serif); color: var(--muted); }

/* PC (≥ 1024 px) : deux colonnes, la liste à gauche, la fiche fixe à droite (plus de fenêtre par-dessus) */
@media (min-width: 1024px) {
  .topbar-inner, .tabbar-inner { max-width: 1180px; }
  body.on-catalogue .page[data-page="catalogue"] {
    max-width: 1180px;
    padding-right: calc(max(var(--pad), env(safe-area-inset-right)) + 480px);
  }
  body.on-catalogue #sheet {
    top: calc(56px + 12px + env(safe-area-inset-top)); bottom: calc(var(--tabbar-h) + 12px);
    left: calc(50% + 590px - 460px - var(--pad)); right: auto; width: 460px;
    transform: none; border: var(--border); animation: none; z-index: 5;
  }
  body.on-catalogue #sheet-backdrop { display: none !important; }
  .filterbar { margin: 0; padding-left: 0; padding-right: 0; }
}
@media (min-width: 1024px) and (max-width: 1220px) {
  body.on-catalogue #sheet { left: auto; right: var(--pad); width: min(440px, 42vw); }
  body.on-catalogue .page[data-page="catalogue"] { padding-right: calc(var(--pad) + min(440px, 42vw) + 20px); }
}
body:not(.on-catalogue) #sheet { display: none; }

/* Saisons de la fiche : 4 colonnes égales, jamais une seule sur une ligne */
.season-picker.season-icons { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.season-picker.season-icons button { padding: 0 4px; }
.season-picker.season-icons button { flex-direction: column; gap: 3px; min-height: 54px; font-size: 12px; }
.input-suffix input { display: block; }
.field > .input-suffix, .field > .select-wrap { margin-bottom: 0; }
@media (min-width: 520px) {
  .season-pills .pill:not(.is-on) span { display: inline; }
  .season-pills .pill, .season-pills .pill.is-on { flex: 1 1 auto; }
}

/* Étoiles Lucide dans les pastilles et la liste */
.pill .stars svg, .season-picker .stars svg { width: 15px; height: 15px; }
.item-stars .stars svg { width: 13px; height: 13px; }
.pill-remove .stars svg { width: 14px; height: 14px; }
.pill-x { width: 16px; height: 16px; }
.tag-editor .tag button svg { width: 14px; height: 14px; }
.tag-editor .tag button { display: inline-grid; place-items: center; }
.square-btn svg { stroke-width: 2.5; }
#sheet-save svg { width: 18px; height: 18px; stroke-width: 2.5; }

/* ── Majuscules comme sur gaspard-tours.fr (28/11) : noms de plats, onglets, pastilles, prix ── */
.item-name { font: 700 14px/19px var(--display); letter-spacing: 0.2px; text-transform: uppercase; }
.tabs button { font: 700 12px/16px var(--display); letter-spacing: 0.3px; text-transform: uppercase; }
.pill, .season-picker button, .pill-remove, .tag-choice { font-family: var(--display); font-weight: 700; font-size: 11.5px; letter-spacing: 0.4px; text-transform: uppercase; }
.season-picker.season-icons button { font-size: 10.5px; }
.price-tag { font: 800 12.5px/18px var(--display); letter-spacing: 0.3px; text-transform: uppercase; }
.price-preview .price-tag { font-size: 13.5px; }
.page-sub { font: 700 11.5px/16px var(--display); letter-spacing: 0.6px; text-transform: uppercase; }
.to-check-btn { font: 700 11.5px/16px var(--display); letter-spacing: 0.6px; text-transform: uppercase; }
.title-input.input { text-transform: uppercase; font-size: 20px; line-height: 26px; }
.sheet-crumb { font: 700 11px/16px var(--display); font-style: normal; letter-spacing: 1px; text-transform: uppercase; color: var(--ink-2); }
.history-row span:first-child { font-family: var(--display); }
.tabs button { font-size: 11.5px; letter-spacing: 0.1px; }
.season-pills .pill:first-child { flex: 0 0 auto; padding: 0 10px; }

/* Accès en lecture : on consulte sans pouvoir modifier (le serveur refuse aussi toute écriture) */
body.read-only #add-btn { display: none; }
body.read-only #product-form .season-picker, body.read-only #product-form .tag-editor button { pointer-events: none; }
body.read-only #product-form .tag-suggest, body.read-only #product-form #tag-input, body.read-only #product-form .field-hint { display: none; }
body.read-only #product-form .title-input.input:hover { border-bottom-color: transparent; }
