/* ===================================================================
   Mobile Polish — LUXURY v2 (brand-safe, uses ::after overlay)
   Load AFTER all your CSS. Mobile-only. Keeps your fonts/colors/photos.
   Optional density: add class "lux-compact" or "lux-comfort" to <body>.
   =================================================================== */
@media (max-width: 820px) {
  /* Density tokens */
  :root {
    --lux-pad-x: clamp(14px, 4.5vw, 22px);
    --lux-pad-y: clamp(20px, 6.5vw, 42px);
    --lux-gap: clamp(10px, 3.2vw, 18px);
    --lux-radius: 16px;
    --lux-radius-small: 12px;
    --lux-shadow-ambient: 0 12px 28px rgba(0,0,0,.08);
    --lux-shadow-press: 0 8px 22px rgba(0,0,0,.12);
    --lux-hairline: 1px solid color-mix(in oklab, Canvas 72%, transparent);
  }
  body.lux-compact { --lux-pad-y: clamp(16px, 5.4vw, 34px); --lux-gap: clamp(8px, 2.6vw, 14px); }
  body.lux-comfort { --lux-pad-y: clamp(22px, 7vw, 46px); }

  /* Rendering & rhythm */
  html, body { -webkit-text-size-adjust: 100%; text-rendering: optimizeLegibility; }
  body { line-height: 1.58; }
  h1, h2, h3 { text-wrap: balance; letter-spacing: -0.012em; margin-top: 0; }
  p, ul, ol { margin: 0 0 clamp(12px, 2.8vw, 18px) 0; }
  .wrap, .container, .section { padding-inline: max(var(--lux-pad-x), env(safe-area-inset-left), env(safe-area-inset-right)) !important; }
  .section { padding-block: var(--lux-pad-y) !important; }
  .grid { display: grid; gap: var(--lux-gap) !important; grid-template-columns: 1fr !important; }
  .center { text-align: center !important; }

  /* Hero/header overlay: use ::after (their ::before is used for the photo) */
  .header, .hero { position: relative; overflow: hidden; }
  .header::after, .hero::after {
    content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
    background: linear-gradient(180deg, rgba(0,0,0,.28) 0%, rgba(0,0,0,.16) 46%, rgba(0,0,0,.10) 100%);
    mix-blend-mode: multiply;
  }
  .header, .hero { padding-top: calc(18px + env(safe-area-inset-top)) !important; padding-bottom: calc(14px + env(safe-area-inset-bottom)) !important; }
  .header h1, .hero h1, .header .lead, .hero .lead { text-shadow: 0 2px 18px rgba(0,0,0,.22); position: relative; z-index: 1; }

  /* Type scale */
  h1 { font-size: clamp(1.7rem, 5.4vw + 1rem, 2.45rem); line-height: 1.16; }
  h2 { font-size: clamp(1.34rem, 3.6vw + .9rem, 1.85rem); line-height: 1.22; }
  h3 { font-size: clamp(1.18rem, 2.3vw + .8rem, 1.4rem);  line-height: 1.26; }
  .lead { font-size: clamp(1rem, 2.6vw + .6rem, 1.14rem); }

  /* Cards & tiles */
  .card, .panel, .tile {
    position: relative; border-radius: var(--lux-radius); overflow: hidden;
    box-shadow: var(--lux-shadow-ambient);
    border: var(--lux-hairline);
    background-clip: padding-box;
  }
  .card::after, .panel::after, .tile::after {
    content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
    box-shadow: inset 0 0 0 1px color-mix(in oklab, Canvas 40%, transparent);
  }
  .card img, .panel img, .tile img, .img-rounded, .gallery img { border-radius: var(--lux-radius-small); }

  /* Feature pills / badges */
  .pillbar, .features, .badges, .tags, .zonechips {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: var(--lux-gap);
  }
  .pill, .feature, .badge, .tag, .zonechips > * {
    border-radius: 999px; padding: 10px 14px; text-align: center;
    backdrop-filter: saturate(115%) blur(2px); -webkit-backdrop-filter: saturate(115%) blur(2px);
    box-shadow: 0 6px 18px rgba(0,0,0,.06);
  }

  /* Buttons / CTAs */
  :where(.btn, .cta, .wapp, .rdv, a.button, [role="button"]) {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 44px; padding: 12px 16px; border-radius: 16px;
    font-weight: 800; text-decoration: none; letter-spacing: .01em;
    box-shadow: 0 10px 26px rgba(0,0,0,.10);
    transition: transform .08s ease, box-shadow .25s ease, filter .25s ease;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
    will-change: transform, box-shadow, filter;
  }
  :where(.btn, .cta, .wapp, .rdv, a.button):hover { filter: saturate(112%); box-shadow: 0 14px 34px rgba(0,0,0,.12); }
  :where(.btn, .cta, .wapp, .rdv, a.button):active { transform: translateY(1px); box-shadow: var(--lux-shadow-press); }
  :where(.btn, .cta, .wapp, .rdv, a.button):focus-visible {
    outline: 2px solid currentColor; outline-offset: 2px;
    box-shadow: 0 0 0 4px color-mix(in oklab, currentColor 22%, transparent), 0 10px 26px rgba(0,0,0,.10);
  }
  :where(.cta, .rdv, [data-cta*="rdv"], [aria-label*="RDV" i]) {
    animation: lux-pulse 2.4s ease-in-out infinite;
  }
  @keyframes lux-pulse { 0%,100%{transform:scale(1);filter:saturate(100%)} 50%{transform:scale(1.015);filter:saturate(112%)} }

  /* Forms */
  input, select, textarea { width: 100%; min-height: 44px; font-size: 16px; border-radius: 12px; box-shadow: inset 0 2px 8px rgba(0,0,0,.035); }
  label { display: block; margin: 6px 0 6px; }

  /* Stickybar (glass + compact) */
  .stickybar {
    position: sticky; bottom: 0; left: 0; right: 0;
    display: flex !important; flex-wrap: nowrap !important; align-items: center;
    gap: 8px !important; padding: 8px 10px !important;
    padding-bottom: calc(8px + env(safe-area-inset-bottom)) !important;
    background: color-mix(in oklab, Canvas 70%, transparent);
    border-top: var(--lux-hairline);
    box-shadow: 0 -12px 30px rgba(0,0,0,.12);
    backdrop-filter: saturate(120%) blur(10px);
    -webkit-backdrop-filter: saturate(120%) blur(10px);
  }
  .stickybar a { flex: 1 1 0; min-height: 40px; padding: 10px 12px; border-radius: 14px; font-weight: 800; text-align: center; }
  .stickybar .call, .stickybar a[href^="tel:"] { display: none !important; }

  /* Avoid overlap with stickybar */
  .stickybar + * { scroll-margin-bottom: 90px; }
  main, .wrap, .container, .section { padding-bottom: max(20px, env(safe-area-inset-bottom)) !important; }
}

/* Motion safety */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
