/* Market home: header row + single search bar (field | country | sort | filters | search) + category carousel.
   Colours only through the theme tokens (docs/THEME_SYSTEM.md). Scope: .tl-market.mk-home */

.mk-home .mkh-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 18px; }
.mk-home .mkh-head .page-title { margin: 0; min-width: 0; font-size: clamp(34px, 6vw, 64px); line-height: 1; }
.mk-home .mkh-sell { flex-shrink: 0; min-height: 46px; }
.mk-home .mk-loginhint { margin: 2px 0 14px; font-size: 13px; color: var(--tl-muted, rgba(255, 255, 255, 0.7)); }
.mk-home .mk-loginhint a { color: var(--tl-accent-ink, #ff4d8a); font-weight: 700; }

/* One container, one height (48 px) */
.mk-home .mk-sticky { padding: 8px 0; }
.mk-home .mkh-bar { position: relative; display: flex; align-items: stretch; gap: 0; min-height: 48px; border-radius: var(--tl-r-chip, 9999px); background: var(--tl-field, rgba(255, 255, 255, 0.05)); border: 1px solid var(--tl-input-border, rgba(255, 255, 255, 0.2)); }
.mk-home .mkh-bar:focus-within { border-color: var(--tl-accent, #ff1e6a); }
.mk-home .mkh-field { flex: 1 1 auto; display: flex; align-items: center; gap: 10px; min-width: 0; margin: 0; padding: 0 0 0 18px; opacity: 1; }
.mk-home .mkh-field i { color: var(--tl-muted, rgba(255, 255, 255, 0.7)); font-size: 14px; }
.mk-home .mkh-field input[type=search] { flex: 1; min-width: 0; width: 100%; min-height: 0; height: 46px; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--tl-text, #fff); outline: none; box-shadow: none; }
.mk-home .mkh-pop { position: relative; display: flex; }
.mk-home .mkh-seg { display: inline-flex; align-items: center; gap: 8px; height: 100%; min-height: 46px; padding: 0 14px; border-left: 1px solid var(--tl-line, rgba(255, 255, 255, 0.12)); color: var(--tl-text, #fff); font-size: 14px; font-weight: 600; white-space: nowrap; cursor: pointer; list-style: none; box-sizing: border-box; }
.mk-home .mkh-seg::-webkit-details-marker { display: none; }
.mk-home .mkh-seg:hover, .mk-home .mkh-pop[open] > .mkh-seg { background: rgba(var(--tl-ink-rgb, 255, 255, 255), .06); }
.mk-home .mkh-seg i:not(.mkh-caret) { color: var(--tl-accent-ink, #ff4d8a); }
.mk-home .mkh-seg__txt { max-width: 15ch; overflow: hidden; text-overflow: ellipsis; }
.mk-home .mkh-caret { font-size: 10px; color: var(--tl-muted, rgba(255, 255, 255, 0.7)); }
.mk-home .mkh-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--tl-accent-fill, #ff1e6a); color: var(--tl-on-accent, #fff); font-size: 12px; font-weight: 800; }
.mk-home .mkh-go { display: inline-flex; align-items: center; justify-content: center; gap: 8px; margin: 3px; min-height: 40px; padding: 0 22px; border: 0; border-radius: var(--tl-r-btn, 9999px); background: var(--tl-accent-fill, #ff1e6a); color: var(--tl-on-accent, #fff); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.mk-home .mkh-go:hover { filter: brightness(1.08); }

/* Menus: one panel anchored under its segment */
.mk-home .mkh-panel { position: absolute; z-index: 30; top: calc(100% + 8px); right: 0; width: min(19rem, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 2px; padding: 8px; border-radius: var(--tl-r, 1rem); background: var(--tl-surface, var(--bg-gradient-1)); border: 1px solid var(--tl-line-strong, rgba(255, 255, 255, 0.25)); box-shadow: 0 14px 34px rgba(var(--tl-shade-rgb, 0, 0, 0), .45); }
.mk-home .mkh-panel--wide { width: min(52rem, calc(100vw - 32px)); max-height: calc(100vh - var(--header-height, 80px) - 8rem); overflow-y: auto; padding: 16px; display: block; }
.mk-home .mkh-filters .mkh-panel { right: 0; }
.mk-home .mkh-panel__title { margin: 4px 10px 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--tl-muted, rgba(255, 255, 255, 0.7)); }
.mk-home .mkh-item { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: var(--tl-r-sm, 12px); color: var(--tl-text, #fff); font-size: 14px; text-decoration: none; }
.mk-home .mkh-item i { visibility: hidden; color: var(--tl-accent-ink, #ff4d8a); }
.mk-home .mkh-item.on i { visibility: visible; }
.mk-home .mkh-item small { color: var(--tl-muted, rgba(255, 255, 255, 0.7)); }
.mk-home .mkh-item:hover { background: rgba(var(--tl-ink-rgb, 255, 255, 255), .07); color: var(--tl-text, #fff); }
.mk-home .mkh-pick { display: flex; flex-direction: column; gap: 6px; margin: 6px 4px 4px; padding: 10px 8px 4px; border-top: 1px solid var(--tl-line, rgba(255, 255, 255, 0.12)); font-size: 12px; font-weight: 600; color: var(--tl-muted, rgba(255, 255, 255, 0.7)); }
.mk-home .mkh-pick select { min-height: 42px; border-radius: var(--tl-r-chip, 9999px); }
.mk-home .mkh-filters .mk-filters { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* Category carousel: horizontal scroll, snap, fade at the edges that still have content */
.mk-home .mkh-carousel { scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; padding-right: 8px; }
.mk-home .mkh-carousel > * { scroll-snap-align: start; }
.mk-home .mkh-carousel.mkh-fade-r { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 56px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 56px), transparent); }
.mk-home .mkh-carousel.mkh-fade-l { -webkit-mask-image: linear-gradient(to right, transparent, #000 56px); mask-image: linear-gradient(to right, transparent, #000 56px); }
.mk-home .mkh-carousel.mkh-fade-l.mkh-fade-r { -webkit-mask-image: linear-gradient(to right, transparent, #000 56px, #000 calc(100% - 56px), transparent); mask-image: linear-gradient(to right, transparent, #000 56px, #000 calc(100% - 56px), transparent); }

@media (max-width: 699px) {
    .mk-home .mkh-hide-sm { display: none; }
    .mk-home .mkh-bar { flex-wrap: wrap; border-radius: var(--tl-r, 1rem); overflow: visible; }
    .mk-home .mkh-field { flex: 1 1 100%; min-height: 48px; border-bottom: 1px solid var(--tl-line, rgba(255, 255, 255, 0.12)); }
    .mk-home .mkh-pop.mkh-country { flex: 1 1 auto; min-width: 0; }
    .mk-home .mkh-country .mkh-seg { width: 100%; border-left: 0; }
    .mk-home .mkh-seg__txt { max-width: none; }
    .mk-home .mkh-go { margin: 3px; padding: 0 18px; }
    .mk-home .mkh-pop { position: static; }
    .mk-home .mkh-bar { position: relative; }
    .mk-home .mkh-panel { left: 0; right: 0; width: auto; }
    .mk-home .mkh-panel--wide { width: auto; }
    .mk-home .mkh-sell { padding: 0 16px; }
}
