/* v2-modal.css — ONE popup system (Oct 2026). Reference = "Choose a model" (#castOv).
   Header: gold kicker 13/600 .14em · title clamp(32–44)/700 -.02em · sub clamp(16–20) secondary · 36px bordered ×.
   Filter bar: .mFilt > .ctG (label .ctL + chips .mSeg) between hairlines. Cards: .mGrid > .mCardIt (3:4 photo, name, meta, gold sel + tick).
   Footer: .mDock centred Continue that appears after a pick. Small utility popups (sign-in, measurements) keep the same header at 28px.
   Phone overrides stay in v2-mobile.css. */
:root{--m-bg:#1b1a17;--m-bd:rgba(245,244,240,.14);--m-line:rgba(245,244,240,.1)}
html body .mOv{background:rgba(10,9,7,.66);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px)}
html body .mCard{background:var(--m-bg);border:1px solid var(--m-bd);box-shadow:0 24px 60px rgba(0,0,0,.55);font-family:Inter,sans-serif}
/* kicker */
html body .mK,html body .castK,html body .mCard .wdK,html body .wdDlgC .wdK{display:block;font-size:13px!important;font-weight:600;letter-spacing:.14em;color:var(--gold,#E5A82E);margin:0 0 8px!important;text-transform:uppercase}
html body .mCard.cast.wdStep .castK{display:none}
/* title + sub: small popups */
html body .mCard .mT,html body .wdDlgC>b{font-size:28px!important;font-weight:700;letter-spacing:-.02em;line-height:1.15;margin:0 0 6px!important;padding-right:48px}
html body .mCard .mS,html body .wdDlgC .wdDlgS{font-size:15px!important;line-height:1.5;color:var(--ts,#B8B2A7);margin:0 0 20px!important}
/* title + sub: large popups (model, wardrobe, demo picker) */
html body .mCard.cast:not(.wdStep) .mT,html body .mCard.cast.wdStep .wdHd b,html body .mCard.mLg .mT{font-size:clamp(32px,3vw,44px)!important;line-height:1.1}
html body .mCard.cast:not(.wdStep) .mS,html body .mCard.cast.wdStep .wdHd>span:last-child,html body .mCard.mLg .mS{font-size:clamp(16px,1.3vw,20px)!important;margin:0!important}
/* close */
html body .mX,html body .coCard .mX{position:absolute;top:16px;right:16px;width:36px;height:36px;border-radius:8px;border:1px solid var(--tilebd,rgba(245,244,240,.18));background:none;color:var(--ts,#B8B2A7);font-size:18px;line-height:1;padding:0 0 2px;display:flex;align-items:center;justify-content:center;cursor:pointer;z-index:20}
html body .cc4 .mX{position:static}
html body .mX:hover{border-color:var(--gold,#E5A82E);color:var(--gold,#E5A82E);background:none}
html body .mX:focus-visible{outline:2px solid var(--gold,#E5A82E);outline-offset:2px}
/* large card shell */
html body .mCard.mLg{width:min(1420px,calc(100vw - 64px));max-width:none;max-height:90vh;overflow-y:auto;padding:40px 32px 28px;border-radius:8px;scrollbar-gutter:stable}
/* filter bar */
.mFilt{display:flex;flex-wrap:wrap;align-items:flex-start;margin:28px 0 24px;padding:20px 0;border-top:1px solid var(--m-line);border-bottom:1px solid var(--m-line);gap:16px 0}
.mFilt .ctG{min-width:0}
.mSeg{display:flex;flex-wrap:wrap;gap:8px}
.mSeg button{display:inline-flex;align-items:center;gap:6px;min-height:42px;padding:0 18px;border-radius:8px;border:1px solid rgba(245,244,240,.16);background:none;color:var(--tp,#F5F4F0);font:500 14px Inter,sans-serif;cursor:pointer}
.mSeg button:hover{border-color:rgba(245,244,240,.4)}
.mSeg button.on{border-color:var(--gold,#E5A82E);color:var(--gold,#E5A82E);font-weight:600}
.mSeg button:focus-visible{outline:2px solid var(--gold,#E5A82E);outline-offset:2px}
/* sticky filter bar → compacts once the card scrolls (same as castTop.stuck) */
html body .mCard .mFilt{position:sticky;top:-40px;z-index:6;background:var(--m-bg);box-shadow:0 0 0 100vmax var(--m-bg);clip-path:inset(0 -100vmax);transition:padding .15s}
html body .mCard .mFilt.stuck{padding-top:10px;padding-bottom:10px;border-top-color:transparent}
html body .mCard .mFilt.stuck .ctL{display:none}
html body .mCard .mFilt.stuck .ctG{gap:0}
html body .mCard .mFilt.stuck .mSeg button{min-height:32px;padding:0 12px;font-size:13px}
/* card grid */
.mGrid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:14px}
@media (max-width:1300px){.mGrid{grid-template-columns:repeat(4,minmax(0,1fr))}}
.mCardIt{position:relative;display:flex;flex-direction:column;text-align:left;padding:0;border-radius:8px;background:#1d1b18;border:1px solid rgba(245,244,240,.12);color:inherit;font:inherit;cursor:pointer;overflow:hidden;transition:border-color .15s,box-shadow .15s}
.mCardIt:hover{border-color:rgba(245,244,240,.32)}
.mCardIt:focus-visible{outline:2px solid var(--gold,#E5A82E);outline-offset:2px}
.mCardIt.sel{border-color:var(--gold,#E5A82E);box-shadow:0 0 0 1px var(--gold,#E5A82E),0 0 22px rgba(229,168,46,.18)}
.mCardIt .mPh{display:block;aspect-ratio:3/4;background:#fff;overflow:hidden}
.mCardIt .mPh img{width:100%;height:100%;object-fit:cover;display:block}
.mCardIt .mBd{display:flex;flex-direction:column;gap:6px;padding:14px 16px 18px}
.mCardIt .mNm{font-size:17px;font-weight:600;line-height:1.25}
.mCardIt .mPh.cut{background:radial-gradient(120% 90% at 50% 40%,#34312b 0%,#24221e 70%)}.mCardIt .mPh.cut img{object-fit:contain;padding:12%;box-sizing:border-box;filter:drop-shadow(0 10px 18px rgba(0,0,0,.35))}
.mCardIt .mMt{font-size:14px;line-height:1.45;color:var(--ts,#B8B2A7)}
.mCardIt .mTk{position:absolute;top:12px;right:12px;width:28px;height:28px;border-radius:50%;background:var(--gold,#E5A82E);color:#141210;display:none;align-items:center;justify-content:center}
.mCardIt.sel .mTk{display:flex}
.mCardIt .mTag{position:absolute;top:12px;left:12px;padding:4px 8px;border-radius:8px;background:rgba(20,18,16,.78);color:#F5F4F0;font-size:11px;font-weight:600;letter-spacing:.08em;text-transform:uppercase}
.mEmpty{grid-column:1/-1;padding:40px 0;text-align:center;color:var(--ts,#B8B2A7);font-size:15px}
/* floating Continue */
.mDock{position:sticky;bottom:0;display:flex;justify-content:center;padding-top:20px;pointer-events:none}
.mDock .cta{pointer-events:auto;margin:0;width:auto;padding:16px 40px;font-size:19px;border-radius:8px;box-shadow:0 12px 30px rgba(0,0,0,.4);display:inline-flex;align-items:center;gap:10px}
.mDock[hidden]{display:none}
/* describe-it dialog card */
html body .wdDlgC{background:var(--m-bg);border:1px solid var(--m-bd);border-radius:8px;box-shadow:0 24px 60px rgba(0,0,0,.55)}
@media (max-width:760px){
  html body .mCard.mLg{width:100vw;height:100%;max-height:none;border-radius:0;padding:20px var(--mob-g,16px) 0}
  .mFilt{flex-direction:column;gap:14px;margin:18px 0 16px;padding:14px 0}
  .mFilt .ctG{padding:0!important;border-left:0!important}html body .mCard .mFilt{top:-20px}html body .mCard .mFilt.stuck{flex-direction:row;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;gap:0 12px}
  .mSeg{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none}.mSeg button{flex:0 0 auto;min-height:40px}
  .mGrid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .mCardIt .mBd{padding:10px 10px 12px}.mCardIt .mNm{font-size:14px}.mCardIt .mPh.cut{background:radial-gradient(120% 90% at 50% 40%,#34312b 0%,#24221e 70%)}.mCardIt .mPh.cut img{object-fit:contain;padding:12%;box-sizing:border-box;filter:drop-shadow(0 10px 18px rgba(0,0,0,.35))}
.mCardIt .mMt{font-size:12px}
  .mDock{margin:0 calc(-1 * var(--mob-g,16px));padding:12px var(--mob-g,16px) calc(12px + env(safe-area-inset-bottom,0px));background:linear-gradient(180deg,rgba(27,26,23,0),#1b1a17 30%)}
  .mDock .cta{width:100%;justify-content:center;font-size:17px;padding:0 20px;min-height:52px}
}

/* close button pinned while the card scrolls (v2-modal.js) */
html body .mXpin{background:var(--m-bg)!important;box-shadow:0 4px 14px rgba(0,0,0,.45);z-index:30!important}
/* sticky offsets are measured from the card's padding edge (spec: scrollport minus padding) — hence the negative top: ≈16px from the card edge on desktop (40px padding), ≈8px on phone (20px) */
/* close button = sticky first child of the scrolling card: stays top-right while content scrolls, never moves/lags.
   margin-bottom:-36px so it takes no space (titles already reserve 48px on the right); works in block and flex-column cards. */
html body :is(.mCard,.pfM)>.mX{position:sticky!important;top:-20px!important;right:auto!important;left:auto!important;transform:none!important;display:flex;margin:-24px 0 -36px auto!important;align-self:flex-end;z-index:30;flex:0 0 auto}
html body :is(.mCard,.pfM):has(>.mX){overflow-x:hidden!important;overscroll-behavior-x:none}
html body .cc4 .mX{position:static!important;margin:0!important}
@media (max-width:760px){html body :is(.mCard,.pfM)>.mX{top:-12px!important;margin:-12px 0 -44px auto!important;width:44px;height:44px}}
@media (max-width:760px){html body .mFilt .ctG{width:100%;max-width:100%;min-width:0;box-sizing:border-box}html body .mFilt .mSeg{max-width:100%;min-width:0}}
/* scrolled popup = standard sticky header: once content scrolls, the × row becomes a solid full-width bar (band painted by the
   button's own shadow, clipped to its row) and the filter bar pins BELOW it — nothing overlaps, chips keep the full width. */
html body :is(.mCard,.pfM)>.mX.mXpin{box-shadow:0 0 0 100vmax var(--m-bg),0 12px 0 100vmax var(--m-bg)!important;clip-path:inset(-20px -100vmax -10px -100vmax);border-color:var(--tilebd,rgba(245,244,240,.18))}
html body :is(.mCard,.pfM):has(>.mX) :is(.mFilt,.castTop,.wdOpts2),html body #castOv .mCard.cast:not(.wdStep) .castTop,html body #castOv .mCard.cast.wdStep .wdOpts2{top:26px!important}
@media (max-width:760px){
html body :is(.mCard,.pfM)>.mX.mXpin{clip-path:inset(-10px -100vmax -8px -100vmax)}
html body :is(.mCard,.pfM):has(>.mX) :is(.mFilt,.castTop,.wdOpts2),html body #castOv .mCard.cast:not(.wdStep) .castTop,html body #castOv .mCard.cast.wdStep .wdOpts2{top:40px!important}
}
