/* Navigation tactile : téléphone, tablette et orientations paysage. */
.mch-action-bar,
.mch-hero-call { display: none; }

@media (max-width: 1100px), (hover: none) and (pointer: coarse) {
  :root { --mch-dock-height: 124px; }
  html { scroll-padding-bottom: calc(var(--mch-dock-height) + env(safe-area-inset-bottom, 0px) + 16px); }
  body { padding-bottom: calc(var(--mch-dock-height) + env(safe-area-inset-bottom, 0px)); }
  .mch-action-bar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: 44px 52px;
    gap: 8px;
    position: fixed;
    z-index: 1000;
    inset: auto 0 0;
    height: calc(var(--mch-dock-height) + env(safe-area-inset-bottom, 0px));
    padding: 9px max(10px, env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(10px, env(safe-area-inset-left, 0px));
    background: rgba(255, 255, 255, .98);
    border-top: 1px solid #d9e5ef;
    box-shadow: 0 -5px 20px rgba(12, 47, 79, .1);
  }
  .mch-action-bar .mch-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-width: 0;
    min-height: 48px;
    margin: 0;
    padding: 6px 12px;
    border: 1px solid transparent;
    border-radius: 10px;
    font: 800 14px/1.3 Inter, system-ui, sans-serif;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
  body .mch-action-bar a.mch-action-call[href^="tel:"] {
    display: flex !important;
    grid-column: 1 / -1;
    grid-row: 1;
    min-height: 44px;
    background: #ff5a12;
    border-color: #ff5a12;
    color: #fff;
    font-size: 20px;
    white-space: nowrap;
  }
  .mch-action-callback { background: #0a3d78; color: #fff; }
  .mch-action-bar .mch-action-simulate { background: #fff; border-color: #0a3d78; color: #0a3d78; }
  .mch-action-bar svg { width: 22px; height: 22px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .mch-action-bar button:hover,
  .mch-action-bar a:hover { filter: brightness(.96); }
  .mch-action-bar :focus-visible { outline: 3px solid #ff975f; outline-offset: 2px; }
  body:has(dialog[open], .sr-action-modal:not([hidden]), .sr-insurance-modal:not([hidden]), .sr-success-modal:not([hidden])) .mch-action-bar,
  body[data-mch-keyboard="open"] .mch-action-bar { visibility: hidden; pointer-events: none; }

  /* The call button above the hero simulator is reserved for phones/tablets. */
  body a.mch-hero-call[href^="tel:"] {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 14px;
    width: 100%;
    max-width: 620px;
    min-height: 64px;
    margin: 0 auto 14px;
    padding: 8px 16px;
    border: 1px solid #0a3d78;
    border-radius: 12px;
    background: #0a3d78;
    color: #fff;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 6px 18px rgba(10, 61, 120, .12);
    touch-action: manipulation;
  }
  .mch-hero-call svg { width: 25px; height: 25px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .mch-hero-call strong { display: block; font-size: clamp(22px, 3.2vw, 27px); line-height: 1.2; font-weight: 900; white-space: nowrap; font-variant-numeric: tabular-nums; }
  .mch-hero-call small { display: block; margin-top: 5px; font-size: 11px; line-height: 1.4; }
  .mch-hero-call:hover { background: #083367; }
  .mch-hero-call:focus-visible { outline: 3px solid #ff975f; outline-offset: 3px; }
  .desktop-phone-card,
  .hero-scene .call-card,
  .hero .sr-fixed-actions,
  .sr-hero .sr-fixed-actions { display: none !important; }
  .mch-footer,
  .mch-legal-page .mch-footer { padding-bottom: 24px; }

  .menu-toggle { width: 44px; height: 44px; }
  .mobile-menu a { display: flex; align-items: center; min-height: 44px; }
  .hero-left, .sr-hero-copy, .sr-service, .sr-price-grid article { min-width: 0; }
  .hero h1, .sr-hero h1 { overflow-wrap: break-word; }
  .sr-head p, .sr-head-wide p { font-size: 13px; line-height: 1.55; }
  .sr-card-more, .sr-price-more, .sr-back { min-height: 44px; }

  .modal,
  .mch-network-dialog { max-height: calc(100dvh - 24px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); overflow-y: auto; overscroll-behavior: contain; }
  .modal { width: min(620px, calc(100% - 24px)); max-width: none; }
  .modal-card, .request-card { max-height: none; }
  .sr-action-modal, .sr-insurance-modal, .sr-success-modal {
    padding: max(12px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) max(12px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
    height: 100dvh;
  }
  .sr-action-card, .sr-simulator-card, .sr-insurance-modal-card, .sr-success-card {
    max-width: 100%;
    max-height: calc(100dvh - 24px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .sr-action-card, .sr-simulator-card { width: min(620px, 100%); }
  .modal-close, .sr-action-x, .mch-network-close { min-width: 44px; min-height: 44px; z-index: 3; }
  .modal-card h2, .sr-action-card h3 { padding-right: 22px; }
  .sr-step input, .sr-callback-fields input, .sr-repair-contact input,
  .home-hero-simulator .sr-step input, .modal-card input:not([type="radio"]):not([type="checkbox"]), .modal-card select,
  .mch-network-fields input:not([type="radio"]) { font-size: 16px !important; min-height: 46px; }
  .sr-step input, .modal-card input, .modal-card select { scroll-margin: 70px 0; }
  .sr-privacy-note, .home-hero-simulator .sr-privacy-note { font-size: 11px !important; line-height: 1.5 !important; }
  .sr-tariff-simulator .sr-issue, .home-hero-simulator .sr-tariff-simulator .sr-issue { min-width: 0; overflow-wrap: anywhere; }
  .sr-city-option { min-height: 44px; }
  .modal-card .choice { min-height: 44px; }
  .modal-card label, .modal-card legend { font-size: 12px; }
  .toast { bottom: calc(var(--mch-dock-height) + env(safe-area-inset-bottom, 0px) + 16px); max-width: calc(100% - 24px); }
}

/* Phones, including touch phones held horizontally. */
@media (max-width: 767.98px), (hover: none) and (pointer: coarse) and (max-height: 500px) {
  .mch-action-bar .mch-action { gap: 7px; padding: 5px 6px; font-size: 12px; border-radius: 9px; }
  .mch-action-callback > span > span,
  .mch-action-simulate > span > span { display: block; }
  .mch-action-bar svg { width: 19px; height: 19px; }
  .modal-card { padding: 24px 18px; }
  .modal-card h2 { margin-right: 24px; font-size: 23px; }
  .modal-services { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .modal-services button, .problem-list button { min-height: 48px; font-size: 13px; }
  .request-nav { flex-wrap: wrap; }
  .sr-hero h1 { font-size: clamp(29px, 7.5vw, 42px); line-height: 1.08; }
  .hero h1 { font-size: clamp(29px, 7.5vw, 42px); line-height: 1.08; }
  .hero-lead, .sr-lead { font-size: 14px; line-height: 1.55; }
  .sr-sim-head p, .home-hero-simulator .sr-sim-head p { font-size: 12px; line-height: 1.5; }
}

@media (max-height: 500px) {
  .sr-action-card, .sr-insurance-modal-card, .sr-success-card { max-height: calc(100dvh - 16px); }
  .sr-action-modal, .sr-insurance-modal, .sr-success-modal { padding-top: 8px; padding-bottom: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

@media (max-width: 1100px), (hover: none) and (pointer: coarse) {
  .network-panel,
  .sr-network { grid-template-columns: minmax(100px, 150px) minmax(0, 1fr); column-gap: 16px; }
  .network-panel > img,
  .sr-network > .fox { max-width: 100%; margin-left: 0; }
  .network-panel .france-map,
  .sr-network .sr-map {
    display: grid;
    grid-column: 1 / -1;
    place-items: center;
    justify-self: center;
    align-self: center;
    position: static;
    width: min(100%, 320px);
    max-width: 100%;
    height: auto;
    margin: 18px auto;
    padding: 0;
    transform: none;
  }
  .network-panel .france-map img,
  .sr-network .sr-map img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0;
    object-fit: contain;
    object-position: center;
    transform: none;
  }
  .how-premium .steps-three .step:not(:last-child)::after {
    content: none;
    display: none;
  }
}

/* Extra in-page call actions: phones only, including touch landscape. */
.mch-mobile-call { display: none; }
@media (max-width: 767.98px), (hover: none) and (pointer: coarse) and (max-height: 500px) {
  .mch-mobile-call {
    display: block;
    width: 100%;
    max-width: 620px;
    margin: 10px auto;
    padding: 0 max(14px, env(safe-area-inset-right, 0px)) 0 max(14px, env(safe-area-inset-left, 0px));
  }
  body .mch-mobile-call a.mch-section-call[href^="tel:"] { margin: 0; }
}
