/* ═══════════════════════════════════════════════════════════
   KLAMPAC — Écran de recherche plein écran
   Toutes les classes commencent par .kls- pour éviter les conflits.
   Couleurs modifiables ci-dessous.
   ═══════════════════════════════════════════════════════════ */
:root {
  --kls-ink: #111A33;        /* texte principal (bleu marine) */
  --kls-muted: #677087;      /* texte secondaire */
  --kls-bg: #FFFFFF;         /* fond de l'écran */
  --kls-soft: #F2F3F6;       /* fond des vignettes / survol */
  --kls-line: rgba(17, 26, 51, .12);
  --kls-accent: #E3463D;     /* rouge KLAMPAC (surlignage) */
  --kls-font: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --kls-ease: cubic-bezier(.76, 0, .24, 1);
}

/* Écran : se déroule du haut vers le bas */
.kls {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--kls-bg); color: var(--kls-ink); font-family: var(--kls-font);
  display: flex; flex-direction: column;
  clip-path: inset(0 0 100% 0); visibility: hidden;
  transition: clip-path .8s var(--kls-ease), visibility 0s .8s;
  padding-top: env(safe-area-inset-top, 0px);
}
.kls.is-open { clip-path: inset(0 0 0 0); visibility: visible; transition: clip-path .8s var(--kls-ease), visibility 0s; }

/* Barre du haut : loupe + champ + fermer */
.kls-top {
  display: flex; align-items: center; gap: 14px;
  padding: 18px clamp(16px, 4vw, 52px); border-bottom: 1px solid var(--kls-line);
}
.kls-top svg { width: 26px; height: 26px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round }
.kls-input {
  flex: 1; min-width: 0; border: 0; background: transparent; outline: none; color: inherit;
  font-family: var(--kls-font); font-weight: 700; font-stretch: 120%;
  font-size: clamp(1.4rem, 3.6vw, 2.8rem); line-height: 1.2; padding: 8px 0;
}
.kls-input::placeholder { color: #A9AFBD; font-weight: 600 }
.kls-input::-webkit-search-cancel-button { display: none }
.kls-close { width: 44px; height: 44px; border: 0; background: none; border-radius: 50%; cursor: pointer; display: grid; place-items: center; color: inherit; flex-shrink: 0 }
.kls-close:hover { background: var(--kls-soft) }
.kls-close svg { width: 20px; height: 20px }

/* Corps : 2 colonnes sur ordinateur, 1 colonne sur mobile */
.kls-body {
  flex: 1; overflow-y: auto; overscroll-behavior: contain;
  padding: 28px clamp(16px, 4vw, 52px) 40px;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 40px; align-content: start;
}
@media (max-width: 760px) { .kls-body { grid-template-columns: 1fr; gap: 28px } }

/* Apparition douce du contenu après l'ouverture */
.kls-col { transition: opacity .6s .25s ease, transform .8s .25s cubic-bezier(.16, 1, .3, 1) }
.kls:not(.is-open) .kls-col { opacity: 0; transform: translateY(20px) }

.kls-label {
  margin: 0 0 14px; font-size: 10.5px; font-weight: 500; letter-spacing: .24em;
  text-transform: uppercase; font-stretch: 118%; color: var(--kls-muted);
}
.kls-label + * + .kls-label, .kls-gap { margin-top: 30px }

/* Puces « Recherches fréquentes » */
.kls-chips { display: flex; flex-wrap: wrap; gap: 8px }
.kls-chip {
  height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--kls-line);
  background: transparent; color: inherit; font: inherit; font-size: 13px; cursor: pointer;
  transition: border-color .3s, background-color .3s, color .3s;
}
.kls-chip:hover { border-color: var(--kls-ink) }
.kls-chip.is-on { background: var(--kls-ink); color: #fff; border-color: var(--kls-ink) }

/* Liste « Familles » */
.kls-families { display: grid; gap: 10px }
.kls-family {
  justify-self: start; text-align: left; border: 0; background: none; color: inherit; cursor: pointer; padding: 0;
  font-family: var(--kls-font); font-weight: 800; font-stretch: 120%; text-transform: uppercase; font-size: 1.05rem;
  position: relative;
}
.kls-family sup { font-family: var(--kls-font); font-weight: 400; font-size: 11px; color: var(--kls-muted); margin-left: 3px }
.kls-family::after { content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform .5s cubic-bezier(.16, 1, .3, 1) }
.kls-family:hover::after { transform: scaleX(1); transform-origin: left }

/* Résultats */
.kls-results { display: grid; gap: 4px }
.kls-item {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 16px; align-items: center;
  padding: 8px; border-radius: 4px; color: inherit; text-decoration: none;
  transition: background-color .25s; animation: kls-in .5s cubic-bezier(.16, 1, .3, 1) both;
}
.kls-item:hover, .kls-item.is-active { background: var(--kls-soft) }
.kls-thumb { width: 64px; aspect-ratio: 4/5; border-radius: 4px; background: var(--kls-soft); position: relative; overflow: hidden }
.kls-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain }
.kls-name { margin: 0; font-size: 15px }
.kls-sub { margin: 2px 0 0; font-size: 12px; color: var(--kls-muted) }
.kls-meta { font-size: 12px; color: var(--kls-muted); text-align: right }
.kls-item mark { background: none; color: inherit; box-shadow: inset 0 -.45em 0 rgba(227, 70, 61, .28) }
.kls-empty { color: var(--kls-muted); padding: 8px 0; margin: 0 }
@keyframes kls-in { from { opacity: 0; transform: translateY(10px) } }

@media (prefers-reduced-motion: reduce) {
  .kls, .kls-col, .kls-item { transition: none !important; animation: none !important }
}
