/* OnlineShop.fyi layout fixes - Claude, 18 Nov 2026 (approved by Jon)
   1. Compact single-row header from 1200px wide (was three rows, 171px);
      compact three-row phone header (was six rows, 319px).
   2. Section snapping: proximity instead of mandatory, and the tall Studio /
      settings-map sections scroll freely so they can be read.
   Loaded after studio.css. Remove this file's link in _Root.Head.cshtml to undo. */

/* 1. Header ------------------------------------------------------------------ */
@media (min-width: 1200px) {
    .osf-header .osf-header-pill { flex-wrap: nowrap; align-items: center; gap: .5rem; padding-block: .45rem; }
    .osf-header .header-lower,
    .osf-header .header-lower:has(.nds-primary) { flex-wrap: nowrap; align-items: center; gap: .5rem; }
    .osf-header .header-upper { flex: 0 0 auto; }
    .osf-header .nds-primary { margin-inline-end: 0; }
    .osf-header .osf-header-nav:not(.nds-primary) { flex-wrap: nowrap; gap: .3rem; margin-inline-start: auto; }
    .osf-header .nds-utility { flex-wrap: nowrap; gap: .3rem; }
    .osf-header .header-lower > *,
    .osf-header .osf-header-nav > *,
    .osf-header .nds-utility > *,
    .osf-header .header-upper,
    .osf-header .osf-header-links > * { flex-shrink: 0; }
    .osf-header .nds-primary,
    .osf-header .osf-theme-switch { flex-wrap: nowrap; }
}

/* Account and cart as icons on desktop; the text stays for screen readers */
@media (min-width: 992px) {
    .osf-header .osf-account-menu > summary > span,
    .osf-header #topcartlink .cart-label {
        position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
    }
}

/* Compact controls: smaller type and padding, text kept for clarity and screen readers */
@media (min-width: 992px) {
    .osf-header .nds-utility label { font-size: .7rem; gap: .25rem; white-space: nowrap; color: var(--text-muted, inherit); }
    .osf-header .nds-utility select { min-height: 1.9rem; padding-block: 0; font-size: .75rem; }
    .osf-header .osf-theme-switch { padding: .15rem; gap: .1rem; }
    .osf-header .osf-theme-switch button { padding: .25rem .45rem; font-size: .66rem; }
    .osf-header .nds-link,
    .osf-header .license-open,
    .osf-header .osf-header-nav:not(.nds-primary) > a { padding: .35rem .6rem; font-size: .78rem; white-space: nowrap; }
    .osf-header .header-links-wrapper,
    .osf-header .osf-header-links { gap: .3rem; }
    .osf-header .osf-account-menu > summary,
    .osf-header #topcartlink { padding: .35rem .6rem; font-size: .78rem; white-space: nowrap; }
    .osf-header .nds-primary summary { padding-block: .35rem; }
}

/* Fixed header is shorter now: pull content up to match */
@media (min-width: 1200px) and (min-height: 650px) and (hover:hover) and (pointer:fine) {
    .onlineshop-fullpage .master-wrapper-page { padding-block-start: 4.5rem; }
}

/* Below 1200px: logo + account/cart icons on one row, the two menus beside them
   (tablet) or underneath (phone), then one swipeable row for Design Studio,
   theme switch, Licensing and Contact. Was 6 rows / 319px on a phone. */
@media (max-width: 1199.98px) {
    .osf-header .osf-header-pill { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .5rem; padding: .5rem .75rem; }
    .osf-header .header-lower { display: contents; }
    .osf-header .osf-brand { order: 0; margin-inline-end: auto; }
    .osf-header .nds-primary { order: 1; flex-wrap: nowrap; margin: 0; }
    .osf-header .header-upper { order: 2; margin-inline-start: 0; flex: 0 0 auto; }
    .osf-header .osf-header-nav:not(.nds-primary) {
        order: 3; flex: 1 0 100%; display: flex; flex-wrap: nowrap; gap: .3rem; margin: 0;
        overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
    }
    .osf-header .osf-header-nav:not(.nds-primary)::-webkit-scrollbar { display: none; }
    .osf-header .nds-utility { order: 0; width: auto; flex-wrap: nowrap; gap: .3rem; }
    .osf-header .nds-utility .nds-link { order: -1; }
    .osf-header .osf-header-nav:not(.nds-primary) > *,
    .osf-header .nds-utility > *,
    .osf-header .osf-header-links > * { flex-shrink: 0; }
    .osf-header .header-upper,
    .osf-header .header-links-wrapper,
    .osf-header .osf-header-links { width: auto; flex-wrap: nowrap; justify-content: flex-end; }
    .osf-header .nds-link,
    .osf-header .license-open,
    .osf-header .osf-header-nav:not(.nds-primary) > a,
    .osf-header .osf-account-menu > summary,
    .osf-header #topcartlink > a,
    .osf-header .nds-primary summary { min-height: 2.5rem; display: inline-flex; align-items: center; }
    .osf-header .osf-theme-switch button { min-height: 2.1rem; }
    .osf-header .osf-account-menu > summary > span,
    .osf-header #topcartlink .cart-label {
        position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
    }
}
@media (max-width: 640px) {
    .osf-header .nds-primary { order: 3; flex: 1 0 100%; }
    .osf-header .osf-header-nav:not(.nds-primary) { order: 4; }
}
/* Fixed two-row header between 992px and 1199px: keep content clear of it */
@media (min-width: 992px) and (max-width: 1199.98px) and (min-height: 650px) and (hover:hover) and (pointer:fine) {
    .onlineshop-fullpage .master-wrapper-page { padding-block-start: 7.75rem; }
}

/* 2. Section snapping ---------------------------------------------------------- */
@media (min-width: 992px) and (min-height: 650px) and (hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference) {
    html.onlineshop-fullpage { scroll-snap-type: y proximity; }
    .fp-stage #hero.fp-section,
    .fp-stage #menu-settings-map.fp-section { scroll-snap-align: none; }
}
