/* Quick Quoter v2 · Desktop BOM drawer (Dec 2026). Loaded after theme.css. Desktop only (>= 1100px):
   peek  = a thin rounded tag on the right edge; it widens as the pointer nears (or on hover/focus).
   open  = the BOM slides in as a side drawer; the tab rides on the drawer's left edge.
   wide  = clicking the tab again widens the drawer into a workspace over a scrim.
   Phones/tablets keep the bottom bar + sheet. To remove: delete this file, its <link>, #bomTab/#bomScrim/#bpHide
   in index.html and the "Desktop BOM drawer" block in app.js; the old sticky panel column returns. */

.bomtab, .bomscrim, .bp-hide { display: none; }

@media (min-width: 1100px) {
  :root { --bt-thin: 18px; --bt-near: 60px; --bt-h: 150px; --drawer-w: 400px; --wide-w: min(1240px, calc(100vw - 96px)); }

  /* Catalogue takes the full width; the BOM no longer owns a grid column. */
  .shell { grid-template-columns: minmax(0, 1fr); }
  body.bom-anim .shell { transition: padding-right .28s cubic-bezier(.2, .8, .2, 1); } /* only while the drawer itself moves, never on route changes */
  body[data-bom-ui="open"]:not(.is-home) .shell, body[data-bom-ui="wide"]:not(.is-home) .shell { padding-right: calc(var(--drawer-w) + 24px); }

  /* Drawer */
  .bom-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 30; width: var(--drawer-w); max-height: none; margin: 0;
    border: 0; border-left: 1px solid var(--line); border-radius: 0; box-shadow: -24px 0 48px -28px rgba(12, 26, 49, .55);
    transform: translateX(100%); visibility: hidden;
    transition: transform .28s cubic-bezier(.2, .8, .2, 1), width .28s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .28s; }
  body[data-bom-ui="open"] .bom-panel, body[data-bom-ui="wide"] .bom-panel { transform: none; visibility: visible; transition-delay: 0s; }
  body[data-bom-ui="wide"] .bom-panel { width: var(--wide-w); }
  .bp-head { padding-top: 20px; }
  .bp-hide { display: inline-grid; place-items: center; width: 32px; height: 32px; margin-left: 8px; border: 1px solid rgba(255, 255, 255, .24);
    border-radius: 8px; background: transparent; color: #fff; cursor: pointer; }
  .bp-hide:hover { background: rgba(255, 255, 255, .12); }
  .bp-hide svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

  /* Workspace: lines flow into columns; group headers, warnings and the empty state span the row. */
  body[data-bom-ui="wide"] .bom-panel .bom-lines { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); column-gap: 32px; align-content: start; padding: 4px 24px 16px; }
  body[data-bom-ui="wide"] .bom-panel .bom-lines > .bgroup, body[data-bom-ui="wide"] .bom-panel .bom-lines > .bwarn,
  body[data-bom-ui="wide"] .bom-panel .bom-lines > .bom-empty { grid-column: 1 / -1; }
  body[data-bom-ui="wide"] .bom-panel .qadd { max-width: 640px; }
  body[data-bom-ui="wide"] .bp-foot { grid-template-columns: minmax(0, 1fr) minmax(0, 520px) auto; align-items: end; column-gap: 24px; padding: 14px 24px 18px; }
  body[data-bom-ui="wide"] .bp-foot .btn.primary { min-width: 200px; }

  .bomscrim:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 29; background: rgba(12, 26, 49, .3); animation: bt-fade .2s ease-out; }
  @keyframes bt-fade { from { opacity: 0; } }

  /* Pull-tab: a navy tag with rounded inner corners (the mock-up shape) and the mark gradient on its inner edge. */
  .bomtab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
    position: fixed; right: 0; top: 50%; z-index: 31; width: var(--bt-thin); height: var(--bt-h); padding: 0; transform: translateY(-50%);
    border: 0; background: linear-gradient(160deg, var(--navy-2), var(--navy)); color: #fff; cursor: pointer; overflow: hidden;
    border-radius: 14px 0 0 14px; box-shadow: -10px 16px 30px -14px rgba(12, 26, 49, .6);
    transition: width .2s cubic-bezier(.2, .8, .2, 1), right .28s cubic-bezier(.2, .8, .2, 1); }
  .bomtab::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: linear-gradient(180deg, #00548e, #0097a9 52%, #8bc53f); }
  .bomtab > * { flex: none; transition: opacity .15s; }
  .bt-count { min-width: 26px; height: 26px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center;
    background: var(--accent, #005eb8); font: 700 13px/1 var(--display); font-variant-numeric: tabular-nums; }
  .bt-label { font: 700 12px/1 var(--display); letter-spacing: .14em; writing-mode: vertical-rl; transform: rotate(180deg); }
  .bt-chev { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
  /* Thin: only a small count chip shows; the rest fades in as it widens. */
  .bomtab .bt-label, .bomtab .bt-chev { opacity: 0; }
  .bomtab .bt-count { min-width: 0; width: 10px; height: 10px; padding: 0; font-size: 0; margin-left: 2px; transition: all .15s; }
  .bomtab.near, .bomtab:hover, .bomtab:focus-visible, body[data-bom-ui="open"] .bomtab, body[data-bom-ui="wide"] .bomtab { width: var(--bt-near); }
  .bomtab.near > *, .bomtab:hover > *, .bomtab:focus-visible > *, body[data-bom-ui="open"] .bomtab > *, body[data-bom-ui="wide"] .bomtab > * { opacity: 1; }
  .bomtab.near .bt-count, .bomtab:hover .bt-count, .bomtab:focus-visible .bt-count, body[data-bom-ui="open"] .bomtab .bt-count, body[data-bom-ui="wide"] .bomtab .bt-count {
    min-width: 26px; width: auto; height: 26px; padding: 0 6px; font-size: 13px; margin-left: 0; }
  .bomtab:focus-visible { outline: 2px solid #8fc3ff; outline-offset: 2px; background: linear-gradient(160deg, #1d3a63, var(--navy)); }
  /* Attached to the drawer: rides its left edge; chevron says "widen" (open) or "shrink" (wide). */
  body[data-bom-ui="open"] .bomtab { right: var(--drawer-w); }
  body[data-bom-ui="wide"] .bomtab { right: var(--wide-w); }
  body[data-bom-ui="wide"] .bt-chev { transform: rotate(180deg); }
  body[data-bom-ui="open"] .bomtab .bt-count, body[data-bom-ui="wide"] .bomtab .bt-count { background: rgba(255, 255, 255, .14); }
  .bomtab:hover { background: linear-gradient(160deg, #1a3256, var(--navy)); }
  .bomtab.bump { animation: bt-bump .35s ease-out; }
  @keyframes bt-bump { 40% { width: var(--bt-near); } }

  body.is-home .bomtab, body.is-home .bomscrim { display: none !important; }
}
@media (min-width: 1100px) and (max-width: 1499px) { :root { --drawer-w: 360px; } }
@media (prefers-reduced-motion: reduce) {
  .bomtab, .bomtab > *, .bom-panel, .shell { transition: none !important; }
  .bomtab.bump, .bomscrim { animation: none !important; }
}
