/* Compact spacing (owner 2026-11-28, approved mockup https://claude.ai/artifact/1caSUbMTYZfrz6sGEPcvJk "as shown").
   Pages fill the screen like the big marketplaces: smaller side margins, tighter gaps, more products per row.
   - Applies when <html data-density> is set, which is now the normal look for everyone: "tight" on the marketplace and seller shops
     (spacing only: text and button sizes stay as they are), "compact" on admin / seller / support work pages (the older compact rules
     in site.css etc. also shrink text there, as before). Covers marketplace, seller pages, admin,
     seller shops on megakhan.com, on their own domain and on the Megakhan business address, every portal and shop theme).
     "Expand view" in the globe menu removes it (wwwroot/js/site.js, key mk.density2).
   - Loaded LAST on every page (its own <link> after mk-bundle-b.min.css in Views/Shared/_Layout.cshtml, so also on seller shops that use
     the older design), and the selectors repeat [data-density] to carry 6 attributes, one more than mk-ui2.css, so these numbers win everywhere.
   - Never smaller than 44px for anything you tap; text sizes do not change. */

/* P = html[data-density][data-density][data-density][data-density][data-density][data-density] (6 attributes, mk-ui2.css uses 5) */

/* 1. page width and side margins */
html[data-density]{--page-max:1920px;--page-gutter:clamp(8px,1.25vw,20px)}
html[data-density][data-density][data-density][data-density][data-density][data-density]{--mk2-row1:60px;--mk2-row2:44px;--mk2-radius:10px}

/* 2. space above and below each part of a page */
html[data-density][data-density][data-density][data-density][data-density][data-density] main .section,
html[data-density][data-density][data-density][data-density][data-density][data-density] main section.section{padding-block:16px!important}
html[data-density][data-density][data-density][data-density][data-density][data-density] main .section+.section{padding-top:0!important}
html[data-density][data-density][data-density][data-density][data-density][data-density] body footer{margin-top:24px!important}
html[data-density][data-density][data-density][data-density][data-density][data-density] body footer .footergrid{padding-block:24px!important;gap:20px!important}

/* 2b. home welcome banner: about 420 -> 300px tall on PC (text size unchanged) */
html[data-density][data-density][data-density][data-density][data-density][data-density] .hero-grid{min-height:300px!important;padding-block:16px!important}
@media (max-width:860px){html[data-density][data-density][data-density][data-density][data-density][data-density] .hero-grid{min-height:0!important;padding-block:12px!important}}

/* 3. page titles */
html[data-density][data-density][data-density][data-density][data-density][data-density] main{--mk2-h1:24px}
html[data-density][data-density][data-density][data-density][data-density][data-density] main :is(.page-head,.sectionhead,.admin-heading,.mk-page-head,.r23-head){margin-bottom:8px!important;gap:8px 12px!important}
html[data-density][data-density][data-density][data-density][data-density][data-density] main .sectionhead h2{margin-block:0!important}

/* 4. product grids: narrowest card 170px, 8px gaps (7 per row at 1280-1440, 10 at 1920) */
html[data-density][data-density][data-density][data-density][data-density][data-density] main .product-grid:not([data-view]),
html[data-density][data-density][data-density][data-density][data-density][data-density] main #products .product-grid:not([data-view]){grid-template-columns:repeat(auto-fill,minmax(min(100%,170px),1fr))!important;gap:8px!important;padding-inline:0!important;margin-bottom:16px!important}
html[data-density][data-density][data-density][data-density][data-density][data-density] main .product-grid[data-view=large]{gap:10px!important}
html[data-density][data-density][data-density][data-density][data-density][data-density] main #products :is(.view-toolbar,.catalog-more,.catalog-page-info,.sectionhead){padding-inline:0!important}

/* 5. product cards: less space inside, the photo nearer the edge */
html[data-density][data-density][data-density][data-density][data-density][data-density] main .product-card{min-height:0!important}
html[data-density][data-density][data-density][data-density][data-density][data-density] main .product-card .product-image{margin:4px!important;max-width:calc(100% - 8px)!important}
html[data-density][data-density][data-density][data-density][data-density][data-density] main .product-card .product-body{padding:2px 8px 8px!important;gap:3px!important}
html[data-density][data-density][data-density][data-density][data-density][data-density] main .product-card .product-body .product-actions{padding-top:6px!important;gap:6px!important}

/* 6. product page */
html[data-density][data-density][data-density][data-density][data-density][data-density] main .product-detail-v2{gap:24px!important}
html[data-density][data-density][data-density][data-density][data-density][data-density] main .az-head>*{margin-top:8px!important}
html[data-density][data-density][data-density][data-density][data-density][data-density] main .az-head>:first-child{margin-top:0!important}
html[data-density][data-density][data-density][data-density][data-density][data-density] main .az-head>.mk2-seller{padding:10px 12px!important}
html[data-density][data-density][data-density][data-density][data-density][data-density] main .mk2-ptabs{margin-top:16px!important}

/* 7. account and seller pages: side menu 208px, boxes and fields closer together */
html[data-density][data-density][data-density][data-density][data-density][data-density] main .mk2-acct{grid-template-columns:208px minmax(0,1fr);gap:12px;padding-block:12px 4px}
/* owner 2026-12-04 ("the side menu, when collapsed, did not stretch the page - it leaves an empty area"): the folded menu is 64px wide,
   so the page takes the rest; the 208px above is for the open menu only (phones: one column, section 9) */
@media (min-width:901px){html[data-density][data-density][data-density][data-density][data-density][data-density].mk2-nav-min main .mk2-acct{grid-template-columns:64px minmax(0,1fr)}}
/* owner 2026-12-04 ("in all admin pages the back to top icon is not displayed"): admin and seller work pages fill the whole width, so a field
   or button was always under the back-to-top button and it hid itself (it never covers something to press). A free strip on the right
   keeps its corner clear; with "Expand view" (no data-density) too */
@media (min-width:901px){html main .mk2-acct.mk2-sell,html[data-density][data-density][data-density][data-density][data-density][data-density] main .mk2-acct.mk2-sell{padding-inline-end:48px}}
html[data-density][data-density][data-density][data-density][data-density][data-density] main .mk2-acctnav{padding:6px}
html[data-density][data-density][data-density][data-density][data-density][data-density] main :is(.form-card,.admin-panel,.table-card,.plan-card,.card,.panel,.r23-card){padding:14px!important}
html[data-density][data-density][data-density][data-density][data-density][data-density] main :is(.form-card,.admin-panel,.r23-card)+:is(.form-card,.admin-panel,.r23-card){margin-top:12px!important}
html[data-density][data-density][data-density][data-density][data-density][data-density] main :is(.form-grid,.r23-grid,.r23-two){gap:10px!important}
html[data-density][data-density][data-density][data-density][data-density][data-density] main :is(.form-card,.r23-card) label{margin-block:0 4px}

/* 8. seller shops (every shop theme, on megakhan.com, own domain and business address) */
html[data-density][data-density][data-density][data-density][data-density][data-density] .sd-hero{padding-block:24px!important}
html[data-density][data-density][data-density][data-density][data-density][data-density] .sd-hero.has-img{padding:0!important}
html[data-density][data-density][data-density][data-density][data-density][data-density] main .vendor-store-page .product-grid{gap:8px!important;margin-bottom:16px!important}
html[data-density][data-density][data-density][data-density][data-density][data-density] .sd-footer{margin-block-start:24px!important}
html[data-density][data-density][data-density][data-density][data-density][data-density] .sd-foot{padding-block:16px!important;gap:16px!important}

/* 9. phone: 8px side margin (the extra 12px from mk-mobile.css is dropped), 6px gaps, two products per row */
@media (max-width:860px){
  html[data-density][data-density][data-density][data-density][data-density][data-density] main .section{padding-block:10px!important}
  html[data-density][data-density][data-density][data-density][data-density][data-density] main .mk2-acct{grid-template-columns:minmax(0,1fr);gap:8px;padding-top:8px}
  html[data-density][data-density][data-density][data-density][data-density][data-density] main :is(.form-card,.admin-panel,.table-card,.plan-card,.card,.panel,.r23-card){padding:12px!important}
  html[data-density][data-density][data-density][data-density][data-density][data-density] .sd-hero{padding-block:20px!important}
}
@media (max-width:640px){
  html[data-density][data-density][data-density][data-density][data-density][data-density] main .product-grid:not([data-view]),
  html[data-density][data-density][data-density][data-density][data-density][data-density] main #products .product-grid:not([data-view]){grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:6px!important}
}
@media (max-width:560px){
  html[data-density][data-density][data-density][data-density][data-density][data-density] main :is(.container,.section){padding-inline:0!important}
}
@media (max-width:360px){
  html[data-density][data-density][data-density][data-density][data-density][data-density] body main :is(.product-grid,.vendor-grid){grid-template-columns:minmax(0,1fr)!important}
}

/* 10. globe menu: Layout = Compact view | Expand view (two buttons, the chosen one marked) */
html[data-ui][data-ui][data-ui][data-ui][data-ui] body .topbar .mk2-prefs .selectors>.mk2-density{order:5!important;display:flex;flex-direction:column;gap:4px;width:100%}
html[data-ui][data-ui][data-ui][data-ui][data-ui] .mk2-density .mk2-seg{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px;padding:3px;border:1.5px solid var(--border);border-radius:var(--mk2-pill,999px);background:var(--surface)}
html[data-ui][data-ui][data-ui][data-ui][data-ui] .mk2-density .mk2-seg-btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:44px;padding:0 10px;border:0;border-radius:var(--mk2-pill,999px);background:transparent;color:var(--text);font:inherit;font-size:13px;font-weight:600;white-space:nowrap;cursor:pointer}
html[data-ui][data-ui][data-ui][data-ui][data-ui] .mk2-density .mk2-seg-btn svg{width:18px;height:18px;flex:none;fill:none;stroke:currentColor;stroke-width:1.8}
html[data-ui][data-ui][data-ui][data-ui][data-ui] .mk2-density .mk2-seg-btn[aria-pressed=true]{background:var(--primary);color:var(--on-primary,#fff)}
html[data-ui][data-ui][data-ui][data-ui][data-ui] .mk2-density .mk2-seg-btn:focus-visible{outline:2px solid var(--focus,#2563eb);outline-offset:2px}

/* owner 2026-12-04 ("labels on the product pages are not correct in mobile view; they contradict each other" - "both labels in red above the product
   image ... select compact view"): in the Compact product view the tiles are too narrow for the red "SALE 5%" label - it was cut to "SA..." and ran
   into the wishlist heart, while the price line under it already shows the same "-5%" in red. Compact tiles keep only the price line's "-5%". */
html .product-grid[data-view=compact] .product-card .product-image .discount-badge{display:none!important}
