/* Wovenary quick quote: small mobile pill and its hand-off sheet.
   Glass pill to match the floating B header; opaque cream sheet to match the A menus. */
.qr-pill, .qr-sheet { display: none; }

@media (max-width: 980px) {
  /* The pill replaces the full-width bar once this script runs. Without it, the bar stays. */
  html.qr-ready .mobilebar { display: none !important; }
  html.qr-ready body footer.site { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }

  .qr-art {
    --art-patch: #d6e6d8;
    --art-warm: #f4c8ba;
    --art-accent: #b64834;
    --art-paper: #fff;
    --art-stitch: 1;
    --art-stitch-w: 1.6;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
    overflow: visible;
  }
  .qr-art[viewBox="0 0 24 24"] { stroke-width: 1.5; }

  .qr-pill {
    position: fixed;
    right: max(14px, env(safe-area-inset-right, 0px));
    bottom: calc(max(14px, env(safe-area-inset-bottom, 0px)) + var(--qr-lift, 0px));
    z-index: 78;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 52px;
    padding: 6px 18px 6px 8px;
    border: 1px solid rgba(255, 255, 255, .85);
    border-radius: 999px;
    background: rgba(250, 247, 240, .82);
    -webkit-backdrop-filter: blur(14px) saturate(1.3);
    backdrop-filter: blur(14px) saturate(1.3);
    box-shadow: 0 10px 28px -12px rgba(25, 48, 36, .45), 0 0 0 1px rgba(33, 64, 47, .08);
    color: #21402f;
    font: 700 15px/1 "Hanken Grotesk", system-ui, sans-serif;
    letter-spacing: -.005em;
    cursor: pointer;
    transition: opacity 180ms ease, transform 180ms ease, bottom 200ms ease;
  }
  .qr-pill-art {
    width: 38px;
    height: 38px;
    padding: 5px;
    border-radius: 50%;
    background: #fff;
    box-shadow: inset 0 0 0 1px #e3e9df;
  }
  .qr-pill:focus-visible { outline: 3px solid #2e5641; outline-offset: 3px; }
  .qr-pill.is-hidden,
  .qr-pill.qr-hero-visible,
  body.menu-open .qr-pill,
  html.nav-locked .qr-pill,
  body.editing-field .qr-pill,
  body:not([data-quote-page]).main-quote-visible .qr-pill {
    opacity: 0;
    transform: translateY(12px);
    visibility: hidden;
    pointer-events: none;
  }
  /* Avoid an outdated contrast-only fallback for browsers without backdrop blur. */
  @supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .qr-pill { background: #faf7f0; }
  }

  /* ---------- Sheet ---------- */
  .qr-sheet[open] { display: block; }
  .qr-sheet {
    position: fixed;
    inset: auto 0 0;
    width: 100%;
    max-width: 560px;
    max-height: min(88dvh, 640px);
    margin: auto auto 0;
    padding: 0;
    border: 0;
    border-radius: 22px 22px 0 0;
    background: #fffdf8;
    color: #1e2521;
    box-shadow: 0 -18px 50px -20px rgba(20, 40, 30, .45);
    overflow: auto;
    overscroll-behavior: contain;
  }
  .qr-sheet::backdrop { background: rgba(22, 35, 27, .48); }
  .qr-sheet-inner { padding: 10px 20px calc(18px + env(safe-area-inset-bottom, 0px)); }
  .qr-sheet-inner::before {
    content: "";
    display: block;
    width: 40px;
    height: 4px;
    margin: 0 auto 14px;
    border-radius: 4px;
    background: #d9cfb9;
  }
  .qr-head { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 12px; align-items: start; }
  .qr-mark { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: #e9f1eb; color: #21402f; }
  .qr-mark .qr-art { width: 32px; height: 32px; }
  .qr-head h2 { margin: 2px 0 4px; font: 500 23px/1.12 Fraunces, Georgia, serif; letter-spacing: -.02em; color: #21402f; }
  .qr-head p { margin: 0; color: #5c635b; font-size: 13.5px; line-height: 1.45; }
  .qr-close {
    width: 44px; height: 44px; display: grid; place-items: center;
    border: 1px solid #e8e1d3; border-radius: 50%; background: #fff; color: #21402f; cursor: pointer;
  }
  .qr-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

  .qr-group { margin: 18px 0 0; padding: 0; border: 0; min-width: 0; }
  .qr-group legend { padding: 0; margin-bottom: 10px; font: 700 13px/1.3 "Hanken Grotesk", system-ui, sans-serif; color: #1e2521; }
  .qr-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .qr-options[hidden], .qr-context[hidden] { display: none; }
  .qr-opt {
    display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 6px 12px 6px 8px;
    border: 1.5px solid #e3dccb; border-radius: 14px; background: #fff; color: #21402f;
    font: 650 14px/1.2 "Hanken Grotesk", system-ui, sans-serif; text-align: left; cursor: pointer;
  }
  .qr-opt .qr-art { width: 34px; height: 34px; flex: none; }
  .qr-opt-wide { grid-column: 1 / -1; }
  .qr-opt[aria-pressed="true"] { border-color: #21402f; background: #e9f1eb; box-shadow: inset 0 0 0 1px #21402f; }
  .qr-context {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: center;
    padding: 12px 12px 12px 14px; border: 1.5px solid #21402f; border-radius: 14px; background: #e9f1eb;
  }
  .qr-context-label { grid-column: 1; font-size: 12px; font-weight: 700; color: #3e6b54; }
  .qr-context-name { grid-column: 1; font: 600 17px/1.25 Fraunces, Georgia, serif; color: #21402f; }
  .qr-change {
    grid-column: 2; grid-row: 1 / span 2; min-height: 44px; padding: 0 14px;
    border: 1px solid #b9cbbd; border-radius: 999px; background: #fff; color: #21402f;
    font: 700 13px/1 "Hanken Grotesk", system-ui, sans-serif; cursor: pointer;
  }
  .qr-qty { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
  .qr-q {
    min-height: 44px; padding: 0 6px; border: 1.5px solid #e3dccb; border-radius: 999px; background: #fff;
    color: #21402f; font: 700 14px/1 "Hanken Grotesk", system-ui, sans-serif; cursor: pointer;
  }
  .qr-q[hidden] { display: none; }
  .qr-q-wide { grid-column: span 2; }
  .qr-q[aria-pressed="true"] { border-color: #21402f; background: #21402f; color: #fff; }
  .qr-hint { margin: 10px 0 0; color: #5c635b; font-size: 12.5px; line-height: 1.45; }
  /* The action row stays in reach on short screens while the choices scroll. */
  .qr-actions {
    position: sticky;
    bottom: 0;
    z-index: 1;
    display: grid;
    gap: 4px;
    margin: 16px -20px calc(-18px - env(safe-area-inset-bottom, 0px));
    padding: 14px 20px calc(10px + env(safe-area-inset-bottom, 0px));
    background: linear-gradient(rgba(255, 253, 248, 0), #fffdf8 16px);
  }
  .qr-continue {
    display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 54px;
    border-radius: 999px; background: #21402f; color: #fff; text-decoration: none;
    font: 700 16px/1 "Hanken Grotesk", system-ui, sans-serif;
  }
  .qr-continue svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .qr-alt { margin: 0; text-align: center; font-size: 13.5px; color: #5c635b; }
  .qr-alt a { display: inline-flex; align-items: center; min-height: 44px; color: #21402f; font-weight: 700; text-underline-offset: 4px; text-decoration-color: #eba48f; text-decoration-thickness: 2px; }
  .qr-sheet :is(button, a):focus-visible { outline: 3px solid #2e5641; outline-offset: 2px; }

  @media (max-height: 700px) {
    .qr-head p { font-size: 12.5px; }
    .qr-group { margin-top: 12px; }
    .qr-opt { min-height: 46px; }
    .qr-opt .qr-art { width: 28px; height: 28px; }
    .qr-actions { margin-top: 10px; padding-top: 10px; }
    .qr-sheet-inner::before { margin-bottom: 10px; }
  }
}

@media (prefers-reduced-motion: reduce) {
  .qr-pill { transition: none; }
}
