/* Règles mobile transversales — PACE Outlet */

body.panel-open {
  overflow: hidden;
}

.u-mt-10 { margin-top: 10px; }
.u-mt-12 { margin-top: 12px; }
.u-mt-32 { margin-top: 32px; }
.u-text-center { text-align: center; }
.u-justify-center { justify-content: center; }
.error-actions.u-justify-center { justify-content: center; }
.u-inline-block { display: inline-block; }
.u-mb-12 { margin-bottom: 12px; }

@media (max-width: 768px) {
  #filter-panel.open {
    max-height: min(72dvh, calc(100dvh - 120px));
  }
  /* Évite le zoom automatique iOS sur les champs */
  input,
  select,
  textarea {
    font-size: 16px;
  }

  /* Zones tactiles minimales */
  .btn,
  button:not(.mob-nav-item),
  a.btn {
    min-height: 44px;
  }

  /* Pages légales & 404 */
  .legal-header {
    padding: 12px 16px;
    padding-top: calc(12px + env(safe-area-inset-top));
    position: sticky;
    top: 0;
    z-index: 40;
  }

  .legal-main {
    padding: 28px 16px calc(88px + env(safe-area-inset-bottom));
  }

  .legal-main h1 {
    font-size: 1.75rem;
  }

  .legal-main h2 {
    font-size: 1rem;
    margin-top: 24px;
  }

  .legal-footer {
    padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  }

  .suivi-form {
    padding: 20px 16px;
  }

  .suivi-form input {
    padding: 14px 16px;
    font-size: 16px;
  }

  .suivi-form .btn {
    width: 100%;
    padding: 16px;
  }

  /* Barre bas sur pages sans nav native index */
  body.has-mobile-nav.legal-page,
  body.has-mobile-nav[data-page="mail"] {
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
  }

  /* OAuth pleine largeur */
  .oauth-login-stack,
  .oauth-slot,
  .oauth-btn {
    width: 100%;
  }

  .oauth-btn {
    min-height: 48px;
  }

  /* Compte — Google + e-mail tactile */
  .auth-card {
    overflow: visible;
  }

  .oauth-slot--google {
    width: 100%;
    min-height: 0;
  }

  .pace-google-touch-btn,
  .pace-google-register-btn {
    display: flex !important;
    width: 100%;
    min-height: 52px;
    box-sizing: border-box;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    font-size: 0.9375rem;
  }

  #auth-email-btn,
  #auth-email-btn-register {
    display: flex !important;
    min-height: 52px;
    width: 100%;
  }

  .catalogue-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .catalogue-header .sort-select {
    width: 100%;
  }

  .price-offer-card h3 {
    font-size: 1.5rem;
  }

  .pace-payment-logos {
    justify-content: center;
  }

  .auth-email-cta {
    min-height: 52px !important;
  }

  .auth-tab {
    min-height: 52px;
  }

  .auth-form:not([hidden]),
  #register-flow:not([hidden]),
  #login-form:not([hidden]) {
    padding-bottom: 8px;
  }

  .form-error:not(:empty) {
    padding: 10px 12px;
    background: #fef2f2;
    border-radius: 8px;
    margin-bottom: 12px;
  }

  body.pace-mobile-auth .auth-divider {
    margin: 16px 0 12px;
  }

  body.pace-mobile-auth .pace-auth-visible {
    animation: paceAuthIn 0.25s ease;
  }

  @keyframes paceAuthIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
  }

  #google-signin-btn:empty {
    min-height: 52px;
  }

  .pace-google-native {
    width: 100%;
    min-height: 44px;
    display: flex;
    justify-content: center;
  }

  .pace-google-native iframe {
    max-width: 100% !important;
  }

  /* Programme parrainage — code bien visible */
  #panel-referral .referral-code-display {
    flex-wrap: wrap;
    padding: 14px 16px;
    background: #ecfdf5;
    border: 1px solid #bbf7d0;
    border-radius: 12px;
    margin-bottom: 14px;
  }

  #panel-referral .referral-code-display strong {
    font-size: 1.25rem;
    word-break: break-all;
  }

  #register-referral-section .referral-input-row .btn {
    min-height: 48px;
    touch-action: manipulation;
  }

  #register-ref-code {
    font-size: 16px;
  }

  body.has-mobile-nav .dashboard {
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
  }

  body.has-mobile-nav #panel-referral.active {
    scroll-margin-bottom: 88px;
  }

  /* Inscription 3 étapes */
  .reg-progress--3 {
    gap: 4px;
    padding: 0;
    margin-bottom: 24px;
  }

  .reg-progress--3 .reg-progress-step small {
    font-size: 0.5625rem;
    max-width: 72px;
    text-align: center;
    line-height: 1.2;
  }

  .reg-progress--3 .reg-progress-line {
    max-width: 28px;
    margin: 0 6px 18px;
  }

  .reg-progress-step span {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
  }

  /* Checkout : bouton payer au-dessus de la barre bas */
  body.has-mobile-nav.checkout-page #pay-btn {
    bottom: calc(60px + env(safe-area-inset-bottom));
    z-index: 85;
  }

  body.has-mobile-nav.checkout-page .checkout-main {
    padding-bottom: calc(150px + env(safe-area-inset-bottom));
  }

  body.checkout-page.checkout-success-open .mobile-bottom-bar,
  body.checkout-page.checkout-success-open #pay-btn {
    display: none !important;
  }

  /* Mail */
  body.has-mobile-nav[data-page="mail"] .mail-page {
    padding-bottom: calc(88px + env(safe-area-inset-bottom));
  }

  body.has-mobile-nav[data-page="mail"] .account-topbar {
    padding: 12px 16px;
  }

  body.has-mobile-nav[data-page="mail"] .account-topnav {
    display: none;
  }

  /* 404 */
  .error-actions {
    flex-direction: column;
  }

  .error-actions .btn {
    width: 100%;
    justify-content: center;
  }
}