/* =========================================================================
   Kaetel&Kids — correctifs mobile (chargé en dernier)
   Audit 320 / 375 / 414 / 768 px. Ne cible pas le header, la recherche,
   le bouton panier ni .kk-card__add (gérés dans style.css).
   ========================================================================= */

/* ---------- confort tactile général ---------- */
a, button, summary, label, select { -webkit-tap-highlight-color: rgba(244, 160, 152, .25); }
button, .kk-btn, .kk-chip, .kk-gallery__nav, .kk-gallery__thumb { touch-action: manipulation; }

/* ---------- débordements horizontaux ---------- */
/* Fiche produit : la bande de miniatures (6 x 68 px) élargissait la colonne
   de grille à 448 px -> page à 464 px de large sur 320-414 px. */
.kk-product { grid-template-columns: minmax(0, 1fr); }
.kk-gallery, .kk-pinfo { min-width: 0; }
.kk-gallery__thumbs { overscroll-behavior-x: contain; scroll-snap-type: x proximity; }
.kk-gallery__thumb { scroll-snap-align: start; }
.kk-gallery__main { touch-action: pan-y pinch-zoom; }
@media (min-width: 900px) { .kk-product { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); } }

/* Boutique 320 px : bouton Filtres + liste de tri ne tenaient pas (332 px). */
.kk-toolbar__right { flex-wrap: wrap; min-width: 0; max-width: 100%; }
.kk-toolbar select { max-width: 100%; min-width: 0; }
@media (max-width: 899px) {
  .kk-toolbar { gap: 8px; }
  .kk-toolbar select { min-height: 44px; }
  .kk-filters-open { min-height: 44px; }
}
@media (max-width: 359px) {
  .kk-toolbar__right { width: 100%; }
  .kk-toolbar__right > .kk-filters-open { flex: none; }
  .kk-toolbar__right > select { flex: 1; }
}

/* ---------- cibles tactiles >= 44 px ---------- */
@media (max-width: 899px) {
  .kk-linkbtn { min-height: 44px; display: inline-flex; align-items: center; }
  .kk-section__head a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; }
  .kk-crumbs a { display: inline-block; padding: 11px 2px; line-height: 22px; }
  .kk-crumbs { margin: 0 0 8px; }
  .kk-footer ul { gap: 0; }
  .kk-footer ul a { display: inline-flex; align-items: center; min-height: 44px; }
  .kk-chip { min-height: 44px; }
  .kk-facet summary { min-height: 44px; }
  .kk-facet__list label { min-height: 44px; }
  .kk-facet__list--chips label { min-height: 44px; }
  .kk-facet__search, .kk-price .kk-input { min-height: 44px; }
  .kk-switch { min-height: 44px; }
  .kk-check { min-height: 44px; align-items: center; }
  .kk-check input { margin-top: 0; }
  .kk-ship__opt { min-height: 56px; }
  .kk-age { min-height: 56px; justify-content: center; }
}

/* ---------- lisibilité : rien sous 14 px pour le texte courant ---------- */
@media (max-width: 899px) {
  .kk-topbar { font-size: .875rem; }
  .kk-card__meta { font-size: .875rem; }
  .kk-shortcut small, .kk-age small, .kk-univers small { font-size: .875rem; }
  .kk-crumbs, .kk-note, .kk-footer__copy { font-size: .875rem; }
  .kk-field__err, .kk-facet__hint, .kk-opt__count, .kk-facet__list--chips .kk-opt__count { font-size: .875rem; }
  .kk-cart__meta, .kk-cart__qty, .kk-ship__label small, .kk-mini__t small { font-size: .875rem; }
  .kk-badge { font-size: .8rem; }
  .kk-hero__kicker { font-size: .875rem; }
  .kk-gallery__pos { font-size: .875rem; }
  .kk-facts dt { font-size: .8125rem; }
}

/* ---------- champs : 16 px minimum (pas de zoom automatique iOS) ---------- */
input:not([type="checkbox"]):not([type="radio"]), select, textarea { font-size: max(16px, 1em); }

/* ---------- éléments fixes ---------- */
/* Toast : au-dessus de la barre d'accueil iOS, et laisse de la place en bas. */
.kk-fx-toast, .kk-toast { bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
/* Panneau de filtres : hauteur réelle de l'écran (barre d'adresse mobile). */
@media (max-width: 899px) {
  .kk-filters { height: 100vh; height: 100dvh; overscroll-behavior: contain; }
  .kk-filters__foot { padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
}
/* Fond du panier/commande : le bouton principal ne doit pas coller au bord. */
.kk-summary .kk-btn--block { min-height: 52px; }

/* ---------- survols « collants » sur écran tactile ---------- */
/* Sur téléphone, :hover reste actif après un tap : on coupe les effets
   de soulèvement/rotation pour éviter des cartes penchées figées. */
@media (hover: none) {
  .kk-card:hover, .kk-grid > .kk-card:nth-child(even):hover, .kk-shortcut:hover, .kk-shortcut--garcon:hover,
  .kk-age:hover, .kk-age:nth-child(even):hover, .kk-univers:hover, .kk-univers:nth-child(even):hover,
  .kk-perk:hover, .kk-btn:hover { transform: none; }
  .kk-card:hover .kk-card__img, .kk-shortcut:hover .kk-shortcut__icon, .kk-univers:hover .kk-univers__emoji,
  .kk-perk:hover .kk-perk__icon { transform: none; }
  .kk-logo:hover img, .kk-logo:hover .kk-logo__text { animation: none; }
  /* retour visuel au toucher à la place */
  .kk-card:active, .kk-shortcut:active, .kk-age:active, .kk-univers:active { transform: scale(.98); transition: transform .1s; }
}
