/* Mobile-first refinements for TeamWork Billetterie & inscriptions.
   Scoped at runtime to /billetterie and /billet routes only. */
@media (max-width: 767px) {
  body[data-ticketing-route="true"] {
    overflow-x: hidden;
  }

  body[data-ticketing-route="true"] .container-app {
    width: 100%;
    padding-left: 14px;
    padding-right: 14px;
  }

  body[data-ticketing-route="true"] h1 {
    overflow-wrap: anywhere;
  }

  body[data-ticketing-route="true"] main.grid {
    gap: 18px;
  }

  body[data-ticketing-route="true"] form,
  body[data-ticketing-route="true"] main > section > div,
  body[data-ticketing-route="true"] main > aside > div {
    border-radius: 20px !important;
  }

  /* 16px avoids Safari/iOS zooming the viewport when focusing a field. */
  body[data-ticketing-route="true"] form input,
  body[data-ticketing-route="true"] form select,
  body[data-ticketing-route="true"] form textarea,
  body[data-ticketing-route="true"] form button {
    font-size: 16px;
  }

  body[data-ticketing-route="true"] form input:not([type="checkbox"]):not([type="radio"]),
  body[data-ticketing-route="true"] form select {
    min-height: 50px;
    width: 100%;
  }

  body[data-ticketing-route="true"] form textarea {
    width: 100%;
    min-height: 132px;
  }

  body[data-ticketing-route="true"] form input[type="checkbox"] {
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
  }

  /* Ticket categories: name, price and quantity stack cleanly on phones. */
  body[data-ticketing-route="true"] form div[class*="grid-cols-[1fr_110px_110px]"] {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #f8fafc;
  }

  /* Upload surface is easier to tap from a phone gallery/camera. */
  body[data-ticketing-route="true"] form label:has(input[type="file"]) {
    min-height: 170px !important;
    width: 100%;
    padding: 18px !important;
    border-radius: 18px !important;
  }

  body[data-ticketing-route="true"] form label:has(input[type="file"]) img {
    max-width: 100%;
    max-height: 280px !important;
  }

  /* Pricing mode pills become comfortable full-width touch targets. */
  body[data-ticketing-route="true"] form div.flex.flex-wrap.gap-2 > button[type="button"] {
    min-height: 44px;
    flex: 1 1 140px;
  }

  /* Primary submit / payment actions stay easy to reach. */
  body[data-ticketing-route="true"] form > button[type="submit"],
  body[data-ticketing-route="true"] form > button:not([type]) {
    min-height: 52px;
    border-radius: 14px !important;
  }

  /* Ticket purchase cards and payment choices. */
  body[data-ticketing-route="true"] form button[type="button"] {
    touch-action: manipulation;
  }

  body[data-ticketing-route="true"] a[href="/billetterie/soumettre"] {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  body[data-ticketing-route="true"] img[alt="QR du billet"] {
    width: min(68vw, 220px) !important;
    height: min(68vw, 220px) !important;
  }

  body[data-ticketing-route="true"] .grid.grid-cols-2.gap-3 {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 390px) {
  body[data-ticketing-route="true"] .container-app {
    padding-left: 10px;
    padding-right: 10px;
  }

  body[data-ticketing-route="true"] form {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  body[data-ticketing-route="true"] h1 {
    font-size: 1.75rem !important;
    line-height: 1.12 !important;
  }
}
