/* Mobile conversion layer (9 Nov 2026). Phones only (max-width 767px): nothing here changes the desktop site.
   Goal: the quote form first, WhatsApp and call always one tap away, and nothing floating over the content.
   Added to every public page by mobile_cro.py, after the glass theme. body[data-mcro] = full | talk | form. */

.mcro-bar, .mcro-talk { display: none; }
@media (min-width: 768px) { .mcro-m { display: none !important; } }

@media (max-width: 767px) {
  body[data-mcro] .mcro-d { display: none !important; }

  /* ---------- one bottom bar: quote, WhatsApp, call ---------- */
  body[data-mcro] .mcro-bar {
    position: fixed; z-index: 2147482000; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 30px;
    background: rgba(255,255,255,.62); border: 1px solid rgba(255,255,255,.78);
    -webkit-backdrop-filter: blur(26px) saturate(185%); backdrop-filter: blur(26px) saturate(185%);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.95), 0 18px 40px -14px rgba(16,32,70,.4);
    transition: transform .45s cubic-bezier(.22,1,.36,1), opacity .3s;
  }
  body[data-mcro] .mcro-bar a {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; border-radius: 999px;
    font: 600 16px/1 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Archivo, Arial, sans-serif;
    letter-spacing: -.01em; text-decoration: none !important; -webkit-tap-highlight-color: transparent;
    transition: transform .15s;
  }
  body[data-mcro] .mcro-bar a:active { transform: scale(.96); }
  body[data-mcro] .mcro-bar a:focus-visible { outline: 3px solid #0b3f8f; outline-offset: 2px; }
  body[data-mcro] .mcro-q {
    flex: 1 1 auto; min-width: 0; padding: 0 16px; color: #fff !important; white-space: nowrap;
    background: linear-gradient(180deg, #2a78e4, #1456d9);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 8px 18px -8px rgba(20,86,217,.7);
  }
  body[data-mcro] .mcro-i { flex: 0 0 50px; width: 50px; }
  body[data-mcro] .mcro-wa { background: #1faa55; color: #fff !important; }
  body[data-mcro] .mcro-tel { background: rgba(255,255,255,.92); color: #1d1d1f !important; box-shadow: inset 0 0 0 1px rgba(60,60,67,.16); }
  /* pages where the main button would compete with the page's own form: WhatsApp and call, with words */
  body[data-mcro="talk"] .mcro-i { flex: 1 1 0; width: auto; padding: 0 14px; }
  body[data-mcro] .mcro-i span { display: none; }
  body[data-mcro="talk"] .mcro-i span { display: inline; }

  /* the bar steps aside: before the hero buttons scroll away, inside a form, while typing, under menus and sheets */
  body[data-mcro] .mcro-bar[data-wait]:not(.on),
  body[data-mcro].mcro-inform .mcro-bar, body[data-mcro].mcro-typing .mcro-bar, body[data-mcro].cs-docked .mcro-bar,
  html.menu-open body[data-mcro] .mcro-bar, body[data-mcro]:has(.nav-links.open) .mcro-bar,
  body[data-mcro]:has(.jc.open) .mcro-bar, body[data-mcro]:has(#cc.show) .mcro-bar, body[data-mcro]:has(dialog[open]) .mcro-bar {
    transform: translateY(calc(100% + 24px)); opacity: 0; pointer-events: none;
  }
  @media (prefers-reduced-motion: reduce) { body[data-mcro] .mcro-bar { transition: none; } }
  @media print { body[data-mcro] .mcro-bar { display: none !important; } }

  /* the new bar replaces the old two-button bar and the floating WhatsApp button */
  body[data-mcro] .mobile-cta, body[data-mcro] .wa-fab { display: none !important; }
  body[data-mcro="full"] .jc, body[data-mcro="talk"] .jc { bottom: calc(88px + env(safe-area-inset-bottom, 0px)) !important; }
  body[data-mcro].mcro-inform .jc-fab, body[data-mcro].mcro-typing .jc-fab,
  body[data-mcro] .mcro-bar[data-wait]:not(.on) ~ .jc .jc-fab { opacity: 0 !important; pointer-events: none !important; }
  body[data-mcro][data-mcro-pad] { padding-bottom: calc(86px + env(safe-area-inset-bottom, 0px)); }

  /* ---------- cookie banner: a short sheet, not a third of the screen ---------- */
  body[data-mcro] #cc.cc {
    bottom: calc(10px + env(safe-area-inset-bottom, 0px)) !important;
    width: calc(100% - 20px) !important; padding: 14px 14px 12px !important; border-radius: 24px !important; gap: 10px !important;
  }
  body[data-mcro] #cc.cc h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); margin: 0 !important; }
  body[data-mcro] #cc.cc p { font-size: 12.5px !important; line-height: 1.4 !important; margin: 0 !important; }
  body[data-mcro] #cc.cc .cc-actions { display: grid !important; grid-template-columns: 1fr 1fr 1fr; gap: 8px !important; margin-top: 10px !important; }
  body[data-mcro] #cc.cc .cc-btn { min-height: 44px !important; padding: 0 8px !important; font-size: 14px !important; width: 100% !important; }

  /* ---------- homepage hero: headline, promise, picture and the quote button on the first screen ---------- */
  body[data-mcro-home] .apple-hero .hero-inner { display: flex !important; flex-direction: column !important; align-items: center !important; }
  body[data-mcro-home] .apple-hero .hero-inner > * { order: 9; }
  body[data-mcro-home] .apple-hero .eyebrow { order: 1; }
  body[data-mcro-home] .apple-hero #hero-title { order: 2; }
  body[data-mcro-home] .apple-hero .hero-promise { order: 3; margin: 8px 0 0 !important; font-size: 16px !important; line-height: 1.3 !important; font-weight: 500 !important; text-wrap: balance; }
  body[data-mcro-home] .apple-hero .product-stage { order: 4; margin-top: -4px !important; margin-bottom: -14px !important; }
  body[data-mcro-home] .apple-hero .hero-actions { order: 5; width: 100%; margin-top: 0 !important; position: relative; z-index: 1; }
  body[data-mcro-home] .apple-hero .hero-actions .btn.mcro-m { display: flex !important; }
  body[data-mcro-home] .apple-hero .hero-actions { display: flex !important; flex-direction: column !important; gap: 10px !important; }
  body[data-mcro-home] .apple-hero .hero-actions .btn { width: 100% !important; min-height: 54px !important; font-size: 17px !important; }
  body[data-mcro-home] .apple-hero .mcro-reassure { order: 6; margin: 12px 0 0 !important; font-size: 13.5px !important; line-height: 1.4; color: #3c3c43; text-align: center; }
  body[data-mcro-home] .apple-hero .hero-trust { order: 7; width: 100%; margin-top: 18px !important; padding: 10px 16px !important; gap: 2px !important; }
  body[data-mcro-home] .apple-hero .hero-trust li { font-size: 14.5px !important; }
  body[data-mcro-home] .apple-hero .hero-caption { order: 8; margin-top: 12px !important; }

  /* homepage order on phones: how it works, the cars, why trust us, the quote form; the supercar auctions come after */
  body[data-mcro-home] main#main { display: flex; flex-direction: column; }
  body[data-mcro-home] main#main > * { order: 20; }
  body[data-mcro-home] main#main > .hero, body[data-mcro-home] main#main > .quick-wrap { order: 1; }
  body[data-mcro-home] main#main > #journey { order: 2; }
  body[data-mcro-home] main#main > #models { order: 3; }
  body[data-mcro-home] main#main > #confidence { order: 4; }
  body[data-mcro-home] main#main > #enquire { order: 5; }
  body[data-mcro-home] main#main > #live-auctions { order: 6; }
  body[data-mcro-home] main#main > #enroute { order: 7; }
  body[data-mcro-home] main#main > #questions { order: 8; }

  /* ---------- /start-search/ (where the ads land): the form is on the first screen ---------- */
  body[data-mcro="form"] #enquire { padding-top: 84px !important; }
  body[data-mcro="form"] #enquire .enquiry-grid { display: flex !important; flex-direction: column !important; gap: 0 !important; }
  body[data-mcro="form"] #enquire .ss-intro { display: contents !important; }
  body[data-mcro="form"] #enquire .ss-intro > * { order: 6 !important; }
  body[data-mcro="form"] #enquire .ss-intro > .eyebrow { order: 1 !important; font-size: 12px !important; }
  body[data-mcro="form"] #enquire .ss-intro > .ss-h1 { order: 2 !important; font-size: clamp(26px, 7.6vw, 32px) !important; line-height: 1.1 !important; margin: 6px 0 0 !important; }
  body[data-mcro="form"] #enquire .ss-intro > .mcro-sub { order: 3 !important; margin: 8px 0 14px !important; font-size: 15.5px !important; line-height: 1.4 !important; color: #3c3c43; }
  body[data-mcro="form"] #enquire .form-card { order: 4; }
  body[data-mcro="form"] #enquire .mcro-talk { order: 5; align-self: stretch; width: 100%; box-sizing: border-box; }
  body[data-mcro="form"] #enquire .ss-intro > p:not(.fine):not(.mcro-sub) { display: none !important; }
  body[data-mcro="form"] #enquire .form-card { align-self: stretch; }
  body[data-mcro="form"] #enquire .ss-intro > .mcro-what { margin: 34px 0 0 !important; font-size: 22px !important; line-height: 1.2 !important; letter-spacing: -.02em; }
  body[data-mcro="form"] .jc-fab { display: none !important; }
  /* the step button stays within reach on the long first step */
  body[data-mcro="form"] #brief-form .form-panel > .form-actions {
    position: sticky; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); z-index: 6;
    margin-inline: -8px; padding: 8px; border-radius: 30px;
    background: rgba(255,255,255,.7); border: 1px solid rgba(255,255,255,.8);
    -webkit-backdrop-filter: blur(22px) saturate(180%); backdrop-filter: blur(22px) saturate(180%);
    box-shadow: 0 14px 30px -14px rgba(16,32,70,.38);
  }
  body[data-mcro="form"] #brief-form .form-panel > .form-actions .btn { min-height: 52px !important; }
  body[data-mcro="form"].mcro-typing #brief-form .form-panel > .form-actions { position: static; }

  body[data-mcro] .mcro-talk {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 16px 0 0; padding: 14px; border-radius: 24px;
    background: rgba(255,255,255,.55); border: 1px solid rgba(255,255,255,.78);
  }
  body[data-mcro] .mcro-talk p { grid-column: 1 / -1; margin: 0 0 2px; font-size: 14.5px; line-height: 1.35; color: #1d1d1f; font-weight: 600; text-align: center; }
  body[data-mcro] .mcro-talk a {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; border-radius: 999px;
    font-size: 15px; font-weight: 600; text-decoration: none !important;
  }
  body[data-mcro] .mcro-talk .mcro-wa { background: #1faa55; color: #fff !important; }
  body[data-mcro] .mcro-talk .mcro-tel { background: #fff; color: #1d1d1f !important; box-shadow: inset 0 0 0 1px rgba(60,60,67,.18); }
}
