/* SnapCloset — retouches téléphone (chargé en dernier par l'app, la page d'accueil et les guides).
   Tout est sous @media (max-width: 760px) : l'affichage ordinateur ne change pas. */

html { background: var(--c-bg, #F6F1EA); }

@media (max-width: 760px) {
  /* ================= APP ================= */

  /* Plus aucune largeur forcée : rien ne dépasse de l'écran */
  .sf-app, .sf-app .sf-main { max-width: 100vw; overflow-x: clip; }
  .sf-app.sc-shell > .sf-main { padding: 16px 16px calc(var(--tabbar-h) + 24px); gap: 18px; }
  .sf-app .sf-title { font-size: 28px; line-height: 1.1; }
  .sf-app .sf-sub { font-size: 15px; }
  .sf-app .sf-card { padding: 16px; }

  /* Sélecteurs à onglets : toute la largeur, boutons égaux, jamais plus larges que l'écran */
  .sf-app .sf-seg { display: flex; width: 100%; max-width: 100%; }
  .sf-app .sf-seg button { flex: 1 1 0; min-width: 0; padding: 0 8px; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; justify-content: center; }
  .sf-app .sf-seg .sc-maint { display: none; }

  /* Étapes de « Nouvelle fiche » : titre sur sa ligne, onglets en dessous */
  .sf-app section.sf-step { padding: 16px 14px; gap: 14px; }
  .sf-app .sf-step-head { flex-wrap: wrap; row-gap: 10px; }
  .sf-app .sf-step-head > .sf-seg { flex: 1 1 100%; margin-left: 0; }
  .sf-app .sf-step-title { flex: 1; min-width: 0; font-size: 18px; }
  .sf-app .sc-shein { padding: 14px; gap: 10px; }
  .sf-app .sc-steps3 { grid-template-columns: 1fr; gap: 6px; }
  .sf-app .sc-steps3 li { padding: 10px; font-size: 13.5px; }

  /* Liste « Tes articles vus » : fenêtre défilante au lieu de 3 écrans de long */
  .sf-app .sf-step .sf-queue { max-height: 336px; overflow-y: auto; overscroll-behavior: contain; padding-right: 2px;
    -webkit-mask-image: linear-gradient(#000 85%, transparent); mask-image: linear-gradient(#000 85%, transparent); }
  .sf-app .sf-qitem { padding: 8px; gap: 10px; }
  .sf-app .sf-qitem .sf-photo { width: 44px; height: 58px; flex: none; }

  /* Pastilles (tailles, états, types) : plus serrées */
  .sf-app .sf-chips { gap: 6px; }
  .sf-app .sf-chip { min-height: 38px; padding: 0 12px; font-size: 14px; }

  /* Barre « 4 photos à générer » : au-dessus du menu du bas, jamais dessous */
  .sf-app .sf-actionbar { bottom: var(--tabbar-h); margin: 0 -16px; padding: 10px 16px 12px; border-radius: 16px 16px 0 0; gap: 8px; }
  .sf-app .sf-actionbar .sf-cost { width: 100%; justify-content: center; font-size: 14px; }
  .sf-app .sf-actionbar .sf-btn.primary { width: 100%; min-height: 50px; }

  /* Grilles de fiches : toujours 2 colonnes (accueil, Mes fiches, modèles, décors) */
  .sf-app .sf-cards { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 14px 10px; }
  .sf-app .sf-fcard-title { font-size: 13.5px; }
  .sf-app .sf-fcard .sf-photo-tag { transform: scale(.9); transform-origin: top left; }

  /* Accueil : carte « Nouvelle fiche » plus compacte */
  .sf-app .sc-newcard-drop { height: 104px; }

  /* Mes fiches : filtres sur une seule ligne qui défile */
  .sf-app .sf-row.wrap:has(> .sf-search) > .sf-chips { flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px; scrollbar-width: none; }
  .sf-app .sf-row.wrap:has(> .sf-search) > .sf-chips::-webkit-scrollbar { display: none; }
  .sf-app .sf-row.wrap:has(> .sf-search) > .sf-chips .sf-chip { flex: none; }
  .sf-app .sf-row.wrap:has(> .sf-search) > .sf-seg { width: auto; margin-left: auto; }
  .sf-app .sf-row.wrap:has(> .sf-search) > .sf-seg button { flex: none; padding: 0 12px; }

  /* En-têtes de page : boutons en ligne, sur toute la largeur */
  .sf-app .sf-head { align-items: stretch; gap: 12px; }
  .sf-app .sf-head-actions { width: 100%; flex-wrap: nowrap; gap: 8px; }
  .sf-app .sf-head-actions > .sf-btn:not(.icon) { flex: 1 1 0; min-width: 0; justify-content: center; padding: 0 10px; }
  .sf-app .sf-head-actions > .sf-btn:not(.icon) > span, .sf-app .sf-head-actions > .sf-btn:not(.icon) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  /* Fiche : titre lisible, original et photos côte à côte */
  .sf-app .sf-g-result { gap: 16px; }
  .sf-app .sf-g-compare { gap: 12px; }
  .sf-app .sf-g-compare > :first-child { max-width: 112px; }
  .sf-app .sf-gallery { gap: 8px; }
  .sf-app .sf-photo-tools { gap: 4px; }
  .sf-app .sf-photo-tools .sf-btn { min-height: 36px; padding: 0 8px; font-size: 13px; }
  .sf-app aside.sf-card.loose { padding: 16px 14px; }

  /* Menu du bas : jamais plus large que l'écran */
  .sc-tabbar { width: 100%; max-width: 100vw; }

  /* ================= PAGE D'ACCUEIL PUBLIQUE ================= */
  .lp .lp-sec { padding: 52px 0; }
  .lp .lp-hero { padding-top: 24px !important; padding-bottom: 44px !important; gap: 32px !important; }
  .lp .lp-hero-cta > .btn { flex: 1 1 100% !important; max-width: none !important; }
  .lp .lp-hero-cta > .btn-secondary { display: none; }
  .lp .lp-h1 { font-size: 34px; }
  .lp .lp-h2 { font-size: 28px; }

  /* Barre du bas : apparaît seulement après le haut de page (les boutons y sont déjà) */
  .lp .lp-sticky { transition: transform .25s ease, opacity .25s ease; }
  .lp .lp-sticky:not(.is-on) { transform: translateY(100%); opacity: 0; pointer-events: none; position: fixed; left: 0; right: 0; }
  .lp .lp-sticky.is-on { position: fixed; left: 0; right: 0; bottom: 0; padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .lp footer { padding-bottom: 76px; }

  /* Téléphone de la vidéo : un peu moins haut */
  .lp #video .lp-in > div:first-child { width: min(290px, 74vw) !important; }

  /* Étapes : numéro à gauche, carte compacte */
  .lp .lp-steps { gap: 10px !important; }
  .lp .lp-steps > li.card { display: grid !important; grid-template-columns: 30px minmax(0, 1fr); column-gap: 14px; row-gap: 4px !important; padding: 18px !important; }
  .lp .lp-steps > li.card > .price { grid-row: 1 / 3; font-size: 36px !important; }
  .lp .lp-steps > li.card > h3 { font-size: 18px; margin: 0; }
  .lp .lp-steps > li.card > p { margin: 0; font-size: 15px; }

  /* Galerie, tarifs, guides : carrousels horizontaux au lieu de longues piles */
  .lp .lp-rail { display: flex !important; flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px !important;
    margin: 0 -20px; padding: 4px 20px 12px; scroll-padding: 0 20px; scrollbar-width: none; }
  .lp .lp-rail::-webkit-scrollbar { display: none; }
  .lp .lp-rail > * { flex: 0 0 auto; scroll-snap-align: start; }
  .lp .lp-rail.is-styles > * { width: 42vw; }
  .lp .lp-rail.is-plans > * { width: 80vw; }
  .lp .lp-rail.is-guides > * { width: 74vw; }
  .lp .lp-rail.is-objects > * { width: 82vw; }
  .lp .lp-rail-hint { display: flex !important; align-items: center; gap: 6px; font-size: 13px; color: var(--c-ink-3); margin-top: -8px; }
}
.lp-rail-hint { display: none; }

@media (max-width: 380px) {
  .sf-app .sf-seg button { font-size: 12.5px; padding: 0 6px; }
  .lp .lp-h1 { font-size: 31px; }
}

/* Champ « choisir un fichier » : bouton aux couleurs de l'app au lieu du bouton système */
.sf-app input[type="file"] { font: 500 14px var(--font-body); color: var(--c-ink-3); max-width: 100%; }
.sf-app input[type="file"]::file-selector-button { margin-right: 10px; min-height: 40px; padding: 0 14px; border: 1px solid var(--c-line-strong); border-radius: var(--r-sm); background: var(--c-surface); color: var(--c-ink); font: 600 14px var(--font-body); cursor: pointer; }

/* Étiquette sombre en lien (« Compatible SHEIN ») : texte clair, lisible */
.sc a.tag-ink, .sc a.tag-ink:hover { color: var(--c-on-inverse); }
