/* ---------- Marketplace v2 — device breakpoints ----------
 * 1024–1279 iPad landscape · 768–1023 iPad portrait · ≤767 iPhone · ≤480 2-up cards
 * · ≤380 SE / mini · ≤300 fold cover · landscape phones · dual-screen segments.
 */
/* ===== iPad landscape / small laptops (1024–1279) ===== */
@media (min-width: 1024px) and (max-width: 1279px) {
    .mkt-body { padding: 0 24px 96px; }
    .mkt-layout { gap: 20px; }
    html:not([data-theme="light"]) .mkt #filterSidebar { width: 240px; padding: 18px; }
    .mkt #productGrid:not(.dash-compact-grid) { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
    html:not([data-theme="light"]) .mkt #dashListingPanel:not(.is-compact-view) .dash-card__handle { font-size: 21px; }
}
/* ===== iPad portrait & below: sidebar becomes the drawer ===== */
@media (max-width: 1023px) {
    .mkt-hero { padding: 56px 24px 40px; }
    .mkt-hero__ring--2 { display: none; }
    .mkt-hero__coin--a { inset-inline-start: 2%; top: 20px; }
    .mkt-hero__coin--b { inset-inline-end: 1%; top: 110px; }
    .mkt-search { margin-top: 36px; max-width: 600px; }
    .mkt-body { padding: 0 24px 88px; }
    .mkt #productGrid:not(.dash-compact-grid) { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
    html:not([data-theme="light"]) .mkt #filterSidebar { background: #0a0a0b; border-inline-end: 1px solid var(--mkt-line); }
}
@media (min-width: 768px) and (max-width: 1023px) {
    .mkt #productGrid:not(.dash-compact-grid) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    html:not([data-theme="light"]) .mkt #dashListingPanel:not(.is-compact-view) .dash-card__handle { font-size: 20px; }
}
/* ===== Phones ===== */
@media (max-width: 767px) {
    .mkt-hero { padding: 36px 16px 28px; }
    .mkt-hero__glow { width: 900px; height: 640px; top: -320px; }
    .mkt-hero__ring--1 { width: 420px; height: 420px; }
    .mkt-hero__coin--a { width: 78px; top: 6px; inset-inline-start: -14px; opacity: .55; }
    .mkt-hero__coin--b { width: 92px; top: 64px; inset-inline-end: -18px; opacity: .55; }
    .mkt-hero__title { font-size: clamp(44px, 14vw, 64px); }
    .mkt-search { margin-top: 26px; }
    .mkt-search__in { height: 56px; gap: 10px; padding-inline: 18px 6px; }
    .mkt-search__input { font-size: 16px; }
    .mkt-search__btn { height: 44px; padding: 0 18px; font-size: 13.5px; }
    .mkt-body { padding: 0 16px 72px; }
    .mkt #productGrid:not(.dash-compact-grid) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    html:not([data-theme="light"]) .mkt #dashListingPanel:not(.is-compact-view) .dash-card { gap: 14px; padding: 14px 12px; border-radius: 18px; }
    html:not([data-theme="light"]) .mkt .dash-card__avatar { width: 32px; height: 32px; border-radius: 10px; font-size: 12px; }
    html:not([data-theme="light"]) .mkt .dash-card__user-link { gap: 9px; }
    html:not([data-theme="light"]) .mkt #dashListingPanel:not(.is-compact-view) .dash-card__handle { font-size: 18px; }
    html:not([data-theme="light"]) .mkt #dashListingPanel:not(.is-compact-view) .dash-card__price-row .dash-card__price { font-size: 19px; }
    html:not([data-theme="light"]) .mkt .dash-card__head { gap: 6px; }
    html:not([data-theme="light"]) .mkt .dash-card__actions { gap: 4px; flex-shrink: 0; }
    html:not([data-theme="light"]) .mkt .dash-card__icon-btn { width: 28px; height: 28px; border-radius: 9px; }
    html:not([data-theme="light"]) .mkt .dash-card__platform { min-width: 0; padding: 4px 8px; font-size: 10px; letter-spacing: 0; }
    html:not([data-theme="light"]) .mkt .dash-card__divider,
    html:not([data-theme="light"]) .mkt .dash-card__fee-label { margin-bottom: -10px; }
    html:not([data-theme="light"]) .mkt #dashListingPanel:not(.is-compact-view) .dash-product-buy { height: 40px; font-size: 13px; }
}
/* 2-up phone cards: the platform icon beside the handle already names the platform,
   so drop the badge instead of truncating it. */
@media (max-width: 480px) {
    html:not([data-theme="light"]) .mkt #dashListingPanel:not(.is-compact-view) .dash-card__platform { display: none; }
    html:not([data-theme="light"]) .mkt .dash-card__head { justify-content: flex-end; }
}
/* iPhone SE / mini / fold cover: icon-only search button, single-column cards */
@media (max-width: 380px) {
    .mkt-hero__title { font-size: 42px; }
    .mkt-search__in { padding-inline: 16px 5px; }
    .mkt-search__btn { width: 44px; padding: 0; justify-content: center; }
    .mkt-search__btn-ico { display: inline; }
    .mkt-search__btn-txt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .mkt-search__icon { display: none; }
    .mkt-body { padding: 0 12px 64px; }
    html:not([data-theme="light"]) .mkt #dashListingPanel:not(.is-compact-view) .dash-card { padding: 12px; }
    html:not([data-theme="light"]) .mkt #dashListingPanel:not(.is-compact-view) .dash-card__handle { font-size: 17px; }
}
@media (max-width: 300px) {
    .mkt-hero__coin { display: none; }
    .mkt-hero__title { font-size: 36px; }
    .mkt #productGrid:not(.dash-compact-grid) { grid-template-columns: minmax(0, 1fr); }
}
/* Landscape phones: compact hero so results are reachable */
@media (max-height: 500px) and (orientation: landscape) and (max-width: 1023px) {
    .mkt-hero { padding: 24px 24px 20px; }
    .mkt-hero__title { font-size: 40px; }
    .mkt-hero__line { display: inline; }
    .mkt-hero__coin { display: none; }
    .mkt-search { margin-top: 16px; }
    .mkt #productGrid:not(.dash-compact-grid) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
/* Dual-screen: hero on one segment is too cramped; keep the grid clear of the hinge */
@media (horizontal-viewport-segments: 2) {
    .mkt #productGrid:not(.dash-compact-grid) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: calc(env(viewport-segment-left 1 0, 50vw) - env(viewport-segment-right 0 0, 50vw) + 12px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .mkt-hero__coin { animation: none; }
    html:not([data-theme="light"]) .mkt #dashListingPanel:not(.is-compact-view) .dash-card { transition: none; }
}
