/* DinoCommande v0.5.8 — correctif responsive smartphone
   Uniquement ergonomie mobile. Aucun changement commande/paiement. */
@media (max-width: 600px) {
  html, body {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
    -webkit-text-size-adjust: 100% !important;
    text-size-adjust: 100% !important;
  }

  main {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
  }

  /* Menu principal : cartes moins hautes et mieux proportionnées. */
  .home-grid {
    grid-template-columns: repeat(2, minmax(0,1fr)) !important;
    gap: 9px !important;
  }
  .home-card {
    min-height: 188px !important;
    height: auto !important;
    border-radius: 18px !important;
  }
  .home-card .home-photo {
    height: 108px !important;
    min-height: 108px !important;
  }
  .home-card .home-copy {
    min-height: 80px !important;
    padding: 10px 11px 11px !important;
  }
  .home-card strong {
    font-size: 17px !important;
    line-height: 1.12 !important;
  }
  .home-card small {
    font-size: 11px !important;
    line-height: 1.28 !important;
    margin-top: 5px !important;
    padding-right: 28px !important;
  }
  .home-card em {
    width: 34px !important;
    height: 34px !important;
    right: 9px !important;
    bottom: 9px !important;
  }
  .home-card em::after { font-size: 25px !important; }

  .section-head { margin: 14px 3px 9px !important; }
  .section-head h2 { font-size: 23px !important; line-height: 1.08 !important; }

  /* Fenêtres du bas : toujours entièrement dans l'écran. */
  .sheet {
    left: 5px !important;
    right: 5px !important;
    bottom: 0 !important;
    width: auto !important;
    max-width: calc(100vw - 10px) !important;
    max-height: 84vh !important;
    max-height: 84dvh !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
    padding: 8px 10px calc(16px + var(--safe)) !important;
    border-radius: 22px 22px 0 0 !important;
    transform: translateY(103%) !important;
  }
  .layer.open .sheet { transform: translateY(0) !important; }

  .sheet::before { margin: -1px 42px 7px !important; }
  .handle { width: 54px !important; height: 4px !important; margin-bottom: 8px !important; }

  .close-x {
    width: 38px !important;
    height: 38px !important;
    top: 2px !important;
    border-radius: 12px !important;
    font-size: 19px !important;
  }

  .sheet-title {
    margin: 4px 38px 5px !important;
    max-width: calc(100% - 76px) !important;
    font-size: 22px !important;
    line-height: 1.08 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
  }
  .sheet-intro {
    margin: 0 6px 10px !important;
    font-size: 12px !important;
    line-height: 1.3 !important;
  }

  /* Choix taille / catégories. */
  .choice-grid { gap: 8px !important; }
  .choice-card,
  #categoryChoices .choice-card {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 68px !important;
    grid-template-columns: 48px minmax(0,1fr) 24px !important;
    gap: 8px !important;
    padding: 8px 9px !important;
    border-radius: 15px !important;
    box-sizing: border-box !important;
  }
  .choice-card .choice-icon,
  #categoryChoices .choice-card .choice-icon,
  .choice-icon {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    border-radius: 50% !important;
    font-size: 22px !important;
  }
  .choice-card strong {
    font-size: 15px !important;
    line-height: 1.15 !important;
    white-space: normal !important;
  }
  .choice-card small {
    font-size: 11px !important;
    line-height: 1.22 !important;
    white-space: normal !important;
  }
  .arrow { font-size: 23px !important; }

  /* Fiche produit / suppléments. */
  .detail-hero { height: min(28vh, 215px) !important; }
  .detail-body { padding-top: 10px !important; }
  .detail-title { font-size: 22px !important; }
  .detail-price { font-size: 20px !important; }
  .detail-description { font-size: 13px !important; line-height: 1.42 !important; }
  .selected-mini {
    grid-template-columns: 58px minmax(0,1fr) auto !important;
    padding: 8px !important;
    margin: 9px 0 !important;
  }
  .mini-image { width: 58px !important; height: 52px !important; }
  .supp-card { min-height: 52px !important; padding: 10px 11px !important; }
  .supp-card strong { font-size: 14px !important; }

  /* Fenêtre menu complet et autres popups. */
  .menu-upsell-sheet {
    width: calc(100vw - 10px) !important;
    max-width: calc(100vw - 10px) !important;
    max-height: 84dvh !important;
    padding: 12px 10px calc(18px + var(--safe)) !important;
    border-radius: 22px 22px 0 0 !important;
  }
  .menu-upsell-head h2 { font-size: 21px !important; }
  .menu-upsell-head img { width: 50px !important; height: 50px !important; }
  .menu-upsell-title { font-size: 19px !important; }
  .menu-choice {
    grid-template-columns: 54px minmax(0,1fr) auto !important;
    min-height: 66px !important;
    padding: 7px !important;
  }
  .menu-choice img { width: 54px !important; height: 54px !important; }

  .bottom-nav {
    width: 100% !important;
    max-width: 100% !important;
    left: 0 !important;
    right: 0 !important;
    transform: none !important;
  }
}

@media (max-width: 380px) {
  .home-card { min-height: 174px !important; }
  .home-card .home-photo { height: 98px !important; min-height: 98px !important; }
  .home-card .home-copy { min-height: 76px !important; padding: 9px !important; }
  .home-card strong { font-size: 16px !important; }
  .home-card small { font-size: 10.5px !important; }

  .sheet-title {
    font-size: 20px !important;
    margin-left: 34px !important;
    margin-right: 34px !important;
    max-width: calc(100% - 68px) !important;
  }
  .choice-card,
  #categoryChoices .choice-card {
    min-height: 64px !important;
    grid-template-columns: 44px minmax(0,1fr) 22px !important;
    padding: 7px 8px !important;
  }
  .choice-card .choice-icon,
  #categoryChoices .choice-card .choice-icon,
  .choice-icon {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
  }
}
