/* Issue 1369 (folds in issue 1368), the pinned stack. Rajeev, 15 Nov 2026: "approve layout 1369 pinned stack: yes" and "build pinned stack: yes". Ported from the approved mock (shoot_n55_slim.py).
   Loaded ONLY when params['site.pinnedStack'] is on (or the private preview cookie is set) and the original top band is showing (PinnedStack::on()); every rule is scoped under body.dc-hdr-orig, which only that band puts on the page.
   ONE variable, --dc-hdr-h, is the bottom edge of the header as it is right now (0 when a phone header is hidden). js/site-stack.js sets it; the defaults below make the first paint right before the script runs.
   --dc-stack-sp is the top of the Maker | Shop bar, --dc-stack-tab the tab bar's distance under it, --dc-stack-swb the height of the Shop bar's title row, --dc-stack-swbrow the height of the tabs row that stays pinned, --dc-stack-pad the room an anchor jump leaves.
   Mode "line" (width 1280 and up, height 500 and up): the header becomes ONE slim 64 px line after 8 px of scroll and stays pinned.
   Mode "compact" (everything else: phones, tablets, short landscape screens): after 8 px the menu row and tagline go (the bar alone, 56 px under 768, 64 px from 768); the header hides on scroll down and returns on scroll up; the five sections are in the drawer.
   The older sheets (profile-spacing.css, profile-nav.css, shop-white-bar.css, section-bars.css, search-panel.css) are not edited: their hard-coded offsets (85, 117, 141, 120, 56, 116) are overridden here, so with the switch off nothing changes. */
:root { --dc-hdr-h: 117px; --dc-hdr-full: 117px; --dc-stack-base: var(--dc-hdr-h); --dc-stack-sp: var(--dc-stack-base); --dc-stack-tab: 56px; --dc-stack-tabh: 44px; --dc-stack-swb: 0px; --dc-stack-swbrow: 0px; --dc-stack-pad: 0px; }
@media (min-width: 1280px) { :root { --dc-stack-tab: 3px; } }
@media (max-width: 767px) { :root { --dc-hdr-h: 93px; --dc-hdr-full: 93px; } }
@media (max-width: 480px) { :root { --dc-stack-sp: max(0px, calc(var(--dc-stack-base) - 8px)); } } /* today the Maker | Shop bar sits 8 px above the header's bottom on a phone (85 against 93); kept at the top of the page */
:root.dcs-moved { --dc-stack-sp: var(--dc-stack-base); } /* once the header has lost its menu row the bars sit exactly under it */
/* --dc-stack-base is where the bars start: the header as it is now, or, on a screen under 500 px tall, the full in-flow header (the bars are not pinned there, see below) */
@media (max-height: 499px) { :root { --dc-stack-base: var(--dc-hdr-full); } }
:root { scroll-padding-top: var(--dc-stack-pad); }

/* the header: fixed; the spacer (markup, _site_header_original.php) keeps the page where the in-flow header kept it */
.dco-spacer { height: 117px; }
@media (max-width: 767px) { .dco-spacer { height: 93px; } }
body.dc-hdr-orig .dco { position: fixed !important; top: 0; left: 0; right: 0; width: auto !important; z-index: 1000; transition: transform .22s ease, box-shadow .2s ease; }
body.dc-hdr-orig .dco.dcs-hide { transform: translateY(-101%); }
body.dc-hdr-orig .dco.dcs-shadow { box-shadow: 0 2px 8px rgba(20,23,26,.10); }
/* a link in a hidden phone header takes focus: js/site-stack.js brings the header back (nobody tabs to links they cannot see) and keeps it while keyboard focus is inside it; no :focus-within rule here, so the class and --dc-hdr-h cannot disagree */
body.dc-hdr-orig .dc-skip:focus { position: fixed; z-index: 1100; } /* the "Skip to the page" link of the help-style pages must not sit under the header */

/* line mode: one slim 64 px line */
@media (min-width: 1280px) and (min-height: 500px) {
body.dc-hdr-orig .dco.dcs-slim { height: 64px; display: flex; align-items: center; padding: 0 max(24px, calc((100% - 1344px) / 2 + 24px)); border-bottom: 1px solid rgba(26,26,26,.12); }
body.dc-hdr-orig .dco.dcs-slim .dco-bar { display: contents; }
body.dc-hdr-orig .dco.dcs-slim .dco-logo { order: 1; }
body.dc-hdr-orig .dco.dcs-slim .dco-wm { height: 40px; }
body.dc-hdr-orig .dco.dcs-slim .dco-desc, body.dc-hdr-orig .dco.dcs-slim .dco-sp { display: none; }
body.dc-hdr-orig .dco.dcs-slim .dco-row { order: 2; flex: 1; height: 64px; border-top: 0; gap: 24px; justify-content: center; }
body.dc-hdr-orig .dco.dcs-slim .dco-row a { font-size: 13px; }
body.dc-hdr-orig .dco.dcs-slim .dco-grp { order: 3; position: static !important; transform: none !important; margin: 0 0 0 8px; gap: 8px; }
body.dc-hdr-orig .dco.dcs-slim .dco-find { width: 170px !important; height: 40px !important; }
body.dc-hdr-orig .dco.dcs-slim .dco-start { height: 40px !important; padding: 0 14px !important; }
body.dc-hdr-orig .dco.dcs-slim .dco-lnk { order: 4; margin-left: 8px; }
body.dc-hdr-orig .dco.dcs-slim .dco-cart { order: 5; }
body.dc-hdr-orig .dco.dcs-slim .dco-menu { order: 6; }
body.dc-hdr-orig .dco-sec { display: none; } /* the menu row is on screen: the drawer does not repeat it */
}
@media (min-width: 1440px) and (min-height: 500px) {
body.dc-hdr-orig .dco.dcs-slim .dco-row { gap: 28px; }
body.dc-hdr-orig .dco.dcs-slim .dco-find { width: 190px !important; }
body.dc-hdr-orig .dco.dcs-slim .dco-start { padding: 0 16px !important; }
}
/* compact mode: after 8 px only the bar is left (56 px on a phone, 64 px from 768) */
body.dc-hdr-orig .dco.dcs-pslim .dco-row, body.dc-hdr-orig .dco.dcs-pslim .dco-desc { display: none; }
body.dc-hdr-orig .dco.dcs-pslim .dco-bar { height: 56px; }
@media (min-width: 768px) { body.dc-hdr-orig .dco.dcs-pslim .dco-bar { height: 64px; } }
/* the five sections at the top of the drawer, in the drawer's own style, a thin line under them */
body.dc-hdr-orig .dco-sec--last { border-bottom: 1px solid rgba(26,26,26,.15) !important; }
@media (max-width: 1279px), (max-height: 499px) {
/* a long drawer scrolls inside itself on a short screen */
body.dc-hdr-orig .dco .dco-sheet { max-height: calc(100vh - var(--dc-hdr-h) - 8px); max-height: calc(100dvh - var(--dc-hdr-h) - 8px); overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
}

/* bars that are fixed today: their top comes from the variable. Maker | Shop on top; the tab bar sits --dc-stack-tab under it (56 px on a phone, today's 3 px offset from 1280) */
body.dc-hdr-orig .spNav.profile-clear { top: var(--dc-stack-sp) !important; transition: top .22s ease; }
body.dc-hdr-orig .spNav.profile-clear.detail-bar { top: var(--dc-stack-base) !important; }
body.dc-hdr-orig #profileNav, body.dc-hdr-orig .scrollNav.proRelTab.profile-clear { top: calc(var(--dc-stack-sp) + var(--dc-stack-tab)) !important; transition: top .22s ease; }
/* from 1280 px (js sets dcs-tabtop when the page has both bars) the profile tab bar is the top bar and Maker | Shop hangs under it; until then Maker | Shop was covered by the tab bar (approved 16 Nov 2026, "approve layout 1369 additions: yes") */
:root.dcs-tabtop body.dc-hdr-orig #profileNav, :root.dcs-tabtop body.dc-hdr-orig .scrollNav.proRelTab.profile-clear { top: var(--dc-stack-base) !important; }
:root.dcs-tabtop body.dc-hdr-orig .spNav.profile-clear:not(.detail-bar) { top: calc(var(--dc-stack-base) + var(--dc-stack-tabh)) !important; }

/* Shop white bar: its tabs row (All crafts, Collections, Gifts, Men, Women) stays pinned under the header; the title row slides under the header and the ordering note scrolls on.
   The bar's own box turns into no box so the sticky row can ride in the page wrapper; the white ground and the hairline move to the row and the note. Markup is not touched (js/shop-sector.js still finds .swb-how in the bar). */
body.dc-hdr-orig #exTab1.shop-standard-bar { display: contents; }
body.dc-hdr-orig #shop-white-bar { display: contents; }
body.dc-hdr-orig #shop-white-bar .swb-in { position: sticky; top: calc(var(--dc-hdr-h) - var(--dc-stack-swb)); z-index: 900; background: #fff; margin: 0 !important; padding-left: 48px; padding-right: 48px; transition: top .22s ease; }
body.dc-hdr-orig #shop-white-bar .swb-in.dcs-stuck { box-shadow: 0 1px 0 #dfe3e6; }
body.dc-hdr-orig #shop-white-bar .swb-note { margin: 0 !important; padding-left: 48px; padding-right: 48px; background: #fff; border-bottom: 1px solid #dfe3e6; }
@media (max-width: 767px) {
body.dc-hdr-orig #shop-white-bar .swb-in, body.dc-hdr-orig #shop-white-bar .swb-note { padding-left: 16px; padding-right: 16px; }
}

/* category and collection listings: the Filter / Sort row (css/shop.css: sticky at top 45 px, from the days of a 45 px header) hangs under the header and the Shop tabs row instead of floating over the page */
body.dc-hdr-orig .filterWrap .filterCnt { top: calc(var(--dc-hdr-h) + var(--dc-stack-swbrow)) !important; transition: top .22s ease; }
/* other hard-coded sticky offsets (coverage report, section 4): the product page side panel (sticky above 770 px, was 80 px) and the collaborate-start side panel (was 16 px) hang under the header */
@media (min-width: 771px) { body.dc-hdr-orig .pdpTopWrap .pdpWrap .pdpCntDisp { top: calc(var(--dc-hdr-h) + 16px) !important; } }
body.dc-hdr-orig .collab-start .cn-side { top: calc(var(--dc-hdr-h) + 16px) !important; }

/* phone profile (issue 1368): the Work with button joins the tabs row, one 44 px bar instead of 104 */
@media (max-width: 480px) {
  body.dc-hdr-orig #profileNav.profile-nav { flex-wrap: nowrap !important; height: 44px !important; }
  body.dc-hdr-orig #profileNav .profile-nav-tabs { flex: 1 1 auto !important; min-width: 0 !important; }
  body.dc-hdr-orig #profileNav .profile-nav-work { flex: none !important; margin: 4px 8px 4px 4px !important; padding: 0 10px !important; min-height: 36px !important; line-height: 36px !important; max-width: 46% !important; }
  body.dc-hdr-orig #profileNav ~ .snCntWrap.pvptopCnt.profile-clear { padding-top: 143px !important; }
}

/* a screen under 500 px tall (a phone on its side, 200 % zoom): ONLY the header is pinned. The bars stay where they sit at the top of the page and scroll away with it (approved 16 Nov 2026). */
@media (max-height: 499px) {
body.dc-hdr-orig .spNav.profile-clear, body.dc-hdr-orig #profileNav, body.dc-hdr-orig .scrollNav.proRelTab.profile-clear { position: absolute !important; transition: none !important; }
/* --dc-stack-opy (js): the page distance of the bar's containing block, so "top" lands where the bar sat at the top of the page */
body.dc-hdr-orig .spNav.profile-clear { top: calc(var(--dc-stack-sp) - var(--dc-stack-opy, 0px)) !important; }
body.dc-hdr-orig .spNav.profile-clear.detail-bar { top: calc(var(--dc-stack-base) - var(--dc-stack-opy, 0px)) !important; }
body.dc-hdr-orig #profileNav, body.dc-hdr-orig .scrollNav.proRelTab.profile-clear { top: calc(var(--dc-stack-sp) + var(--dc-stack-tab) - var(--dc-stack-opy, 0px)) !important; }
:root.dcs-tabtop body.dc-hdr-orig #profileNav, :root.dcs-tabtop body.dc-hdr-orig .scrollNav.proRelTab.profile-clear { top: calc(var(--dc-stack-base) - var(--dc-stack-opy, 0px)) !important; }
:root.dcs-tabtop body.dc-hdr-orig .spNav.profile-clear:not(.detail-bar) { top: calc(var(--dc-stack-base) + var(--dc-stack-tabh) - var(--dc-stack-opy, 0px)) !important; }
body.dc-hdr-orig #shop-white-bar .swb-in, body.dc-hdr-orig .filterWrap .filterCnt { position: relative !important; top: 0 !important; transition: none !important; } /* relative, not static: they keep their stacking order above the page */
}

/* the open search panel (desktop) hangs under whatever the header is showing; on a phone it is full screen and unaffected */
body.dc-hdr-orig .dcsp { top: var(--dc-hdr-h) !important; }
@media (max-width: 767px) { body.dc-hdr-orig .dcsp { top: 0 !important; } }

@media (prefers-reduced-motion: reduce) {
body.dc-hdr-orig .dco, body.dc-hdr-orig .spNav.profile-clear, body.dc-hdr-orig #profileNav, body.dc-hdr-orig .scrollNav.proRelTab.profile-clear, body.dc-hdr-orig #shop-white-bar .swb-in, body.dc-hdr-orig .filterWrap .filterCnt { transition: none !important; }
}
