/* book-bar.css - phone sticky booking bar (<=640px). Replaces est-mobile.css.
   Part 1 is est-mobile.css's phone estimator layout (presets + service cards) carried over unchanged,
   so removing est-mobile.css loses nothing. Part 2 is the bar. Desktop: the bar is display:none. */

/* ================================================================ part 1: phone estimator layout (from est-mobile.css) */
@media (max-width: 640px) {
  html { scroll-padding-bottom: 5rem; }
  #estimator .est-summary { scroll-margin-top: 5rem; }

  /* ---------- presets: one 3-way row ---------- */
  #estimator .estimator__presets-bar {
    display: block;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
  }
  #estimator .estimator__presets-label {
    display: block;
    margin-bottom: .6rem;
    font-size: .75rem;
  }
  #estimator .estimator__presets {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 4px;
    border-radius: 22px;
    background: rgb(31 31 31 / .07);
  }
  #estimator .est-preset {
    flex-direction: column;
    justify-content: center;
    gap: 0;
    min-width: 0;
    min-height: 56px;
    padding: .4rem .35rem;
    border-radius: 18px;
    background: transparent;
    font-size: .875rem;
    line-height: 1.2;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
    -webkit-tap-highlight-color: transparent;
  }
  #estimator .est-preset:hover { background: rgb(255 255 255 / .6); }
  #estimator .est-preset.is-active,
  #estimator .est-preset.is-active:hover {
    background: var(--ink);
    color: #fff;
    box-shadow: 0 2px 8px rgb(31 31 31 / .22);
  }
  /* the tick sits inline before the first word instead of its own line */
  #estimator .est-preset__check { display: inline; margin-right: .3em; font-size: .75rem; }
  #estimator .est-preset:has(.est-preset__check) { display: block; padding-top: .55rem; }

  /* ---------- service cards: dense, calm ---------- */
  #estimator .estimator__list { gap: 8px; padding-bottom: 4.5rem; }
  #estimator .estimator__grid { gap: .5rem; }
  #estimator .service-card {
    align-items: flex-start;
    gap: .75rem;
    padding: .8rem .9rem;
    background: #fff;
    border: 1.5px solid var(--line);
    border-radius: 14px;
    -webkit-tap-highlight-color: transparent;
  }
  #estimator .service-card:hover { border-color: var(--line); }
  #estimator .service-card.is-selected,
  #estimator .service-card.is-selected:hover {
    background: #fff;
    border-color: color-mix(in srgb, var(--mint) 55%, var(--mint-ink));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mint) 55%, var(--mint-ink));
  }
  #estimator .service-card__check {
    width: 24px; height: 24px; margin-top: 1px;
  }
  #estimator .service-card__info { gap: .15rem; min-width: 0; }
  #estimator .service-card__top { gap: .75rem; align-items: baseline; }
  #estimator .service-card__name {
    font-size: 1.15rem;
    line-height: 1.15;
  }
  #estimator .service-card__price { font-size: 1.15rem; }
  #estimator .service-card__desc {
    font-size: .9rem;
    line-height: 1.35;
  }
  #estimator .service-card__unit {
    font-size: .6875rem;
    line-height: 1.2;
    letter-spacing: .07em;
    white-space: nowrap;
  }
}


/* ================================================================ part 2: the sticky booking bar */
.book-bar { display: none; }

@media (max-width: 640px) {
  /* room so the bar never covers the last content or the footer links */
  html.has-book-bar body { padding-bottom: calc(5.25rem + env(safe-area-inset-bottom, 0px)); }
  html.has-book-bar { scroll-padding-bottom: 6rem; }

  .book-bar {
    position: fixed;
    z-index: 40;                       /* above page content; below the header (50) and the open menu (49) */
    left: 12px;
    right: 12px;
    bottom: max(10px, env(safe-area-inset-bottom, 0px));
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 60px;
    padding: 6px 6px 6px 6px;
    box-sizing: border-box;
    border: 1px solid rgb(255 255 255 / .85);
    border-radius: 999px;
    color: #1a1a1a;
    background:
      
      linear-gradient(180deg, #fff, #fafafa);
    -webkit-backdrop-filter: blur(18px) saturate(1.6);
    backdrop-filter: blur(18px) saturate(1.6);
    box-shadow:
      0 0 0 1px rgb(0 0 0 / .1),
      inset 0 1px 0 #fff,
      inset 0 -10px 14px -10px rgb(0 0 0 / .12),
      0 16px 32px -14px rgb(0 0 0 / .45),
      0 4px 10px -6px rgb(0 0 0 / .25);
    font-family: inherit;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(calc(100% + 1.25rem));
    transition: transform .28s cubic-bezier(.22, .61, .36, 1), opacity .18s, visibility 0s linear .28s;
  }
  .book-bar[data-state="show"] {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    transition: transform .28s cubic-bezier(.22, .61, .36, 1), opacity .18s, visibility 0s;
  }

  /* left: the live estimate. A real button (tap = scroll to the estimator). */
  .book-bar__est {
    flex: 1 1 0;
    min-width: 0;
    min-height: 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 1px;
    margin: 0;
    padding: 0 6px 0 14px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #1a1a1a;
    font: inherit;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .book-bar__cap {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .6875rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    line-height: 1.1;
    color: #4a4a4a;
  }
  /* Signature saving caption: sentence case and no tracking, so "Signature · économisez 30 $" fits at 360px */
  .book-bar__cap[data-save] { text-transform: none; letter-spacing: 0; font-size: .65rem; color: #2e5755; }
  .book-bar__main {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 1.1875rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -.01em;
    font-variant-numeric: lining-nums tabular-nums;
    color: #1a1a1a;
  }

  /* right: the call to action. Label centred in the pill. */
  .book-bar__cta {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    min-width: 44px;
    padding: 0 18px;
    box-sizing: border-box;
    border: 1px solid rgb(255 255 255 / .55);
    border-radius: 999px;
    background:
      radial-gradient(140% 110% at 50% -14%, rgb(255 255 255 / .28), rgb(255 255 255 / 0) 60%),
      linear-gradient(180deg, #4d6478 0%, #3a4f62 52%, #31455a 100%);
    color: #fff;
    font-size: .875rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: .005em;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    box-shadow:
      0 0 0 1px rgb(36 54 69 / .35),
      inset 0 1px 0 rgb(255 255 255 / .55),
      inset 0 -10px 14px -10px rgb(0 0 0 / .5),
      0 8px 16px -8px rgb(36 54 69 / .6);
    -webkit-tap-highlight-color: transparent;
    transition: transform .14s ease, filter .14s ease;
  }
  .book-bar__cta:active { transform: scale(.97); filter: brightness(1.08); }
  .book-bar__est:active .book-bar__main { opacity: .7; }

  .book-bar__est:focus-visible,
  .book-bar__cta:focus-visible { outline: 3px solid #5f7a90; outline-offset: 2px; }

  /* 360px class phones: drop the currency tag and tighten the CTA so French fits */
  @media (max-width: 379px) {
    .book-bar { left: 8px; right: 8px; gap: 4px; }
    .book-bar__est { padding-left: 12px; }
    .book-bar__cta { padding: 0 13px; font-size: .8125rem; }
  }

  @media (prefers-reduced-motion: reduce) {
    .book-bar, .book-bar[data-state="show"] { transition: opacity .01ms, visibility 0s; }
    .book-bar__cta { transition: none; }
  }
  /* no backdrop-filter support: solid white */
  @supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
    .book-bar { background: #f4f4f4; }
  }
  @media (prefers-reduced-transparency: reduce) {
    .book-bar {
      background: #f4f4f4;
      -webkit-backdrop-filter: none;
      backdrop-filter: none;
    }
  }
}

@media print { .book-bar { display: none !important; } }
