/* Home marketplace chrome, isolated from Seller and from page content. */
.kg-customer-chrome {
    --ch-bg: #f5f7fc; --ch-search: #edf1fa; --ch-ink: #152033; --ch-muted: #64748b;
    --ch-line: #d9e1ee; --ch-accent: #6052ff; --ch-hover: #edf1fa;
    position: sticky; top: 0; z-index: 40; min-width: 0;
    font-family: Inter, system-ui, sans-serif; color: var(--ch-ink);
}
.dark .kg-customer-chrome { --ch-bg:#111c2b; --ch-search:#1b283c; --ch-ink:#f3f5fc; --ch-muted:#9aa9bf; --ch-line:#2a3a50; --ch-hover:#1b283c; }
body .kg-customer-chrome .kg-customer-header {
    --kg-nav-bg: var(--ch-bg) !important; --kg-nav-ink: var(--ch-ink) !important;
    --kg-nav-muted: var(--ch-muted) !important; --kg-nav-line: var(--ch-line) !important;
    --kg-nav-hover: var(--ch-hover) !important; --kg-nav-accent: var(--ch-accent) !important;
    display: block !important; position: static; background: var(--ch-bg) !important;
    color: var(--ch-ink); border-bottom: 1px solid var(--ch-line); min-width: 0;
}
.kg-customer-header-inner { display: grid; grid-template-columns: auto minmax(180px, 1fr) auto; align-items: center; gap: 32px; width: min(1320px,100%); min-height: 72px; margin-inline: auto; padding: 0 32px; }
.kg-customer-chrome .kg-brand { font-size: 22px; font-weight: 800; letter-spacing: -.7px; white-space: nowrap; color: var(--ch-ink); }
.kg-customer-chrome .kg-brand span { color: #7867ff; }
body .kg-customer-chrome .kg-customer-search { display: flex; align-items: center; gap: 8px; min-width: 0; border: 1px solid var(--ch-line); border-radius: 10px; background: var(--ch-search); padding: 0 0 0 16px; }
body .kg-customer-chrome .kg-customer-search input { flex: 1; min-width: 0; width: 100%; min-height: 42px; padding: 0; border: 0; outline: 0; background: transparent; color: var(--ch-ink); font-size: 12px; }
.kg-customer-chrome .kg-customer-search input::placeholder { color: var(--ch-muted); opacity: 1; }
.kg-customer-chrome .kg-customer-search button { flex: none; min-height: 44px; padding: 10px 22px; border: 0; border-radius: 9px; background: linear-gradient(135deg,#6d5aff,#4f40ef); color: #fff; font-size: 12px; font-weight: 600; }
.kg-customer-chrome .kg-header-actions { display: flex; align-items: center; gap: 10px; width: auto; min-width: 0; margin: 0; }
body .kg-customer-chrome .kg-customer-header :is(.kg-header-icon-button,[aria-label="Menu akun"]) { display: inline-flex; align-items: center; justify-content: center; position: relative; flex: none; width: 40px; height: 40px; min-width: 40px; min-height: 40px; padding: 0; border: 0; border-radius: 10px; background: transparent; color: var(--ch-ink); font-size: 18px; box-shadow: none; transition: background-color .16s,color .16s; }
body .kg-customer-chrome .kg-customer-header :is(.kg-header-icon-button,[aria-label="Menu akun"]):hover { background: var(--ch-hover); color: var(--ch-ink); }
.kg-customer-chrome :is(button,a,input):focus-visible { outline: 2px solid #9e8aff; outline-offset: 2px; }
.kg-customer-chrome .kg-customer-search:focus-within { outline: 2px solid #9e8aff; outline-offset: 2px; }
.kg-customer-chrome .kg-customer-search input:focus-visible { outline: 0; }
.kg-customer-chrome .kg-theme-toggle > i { font-size: 19px; line-height: 1; }
.kg-customer-chrome .kg-header-mobile-search { display: none !important; }
.kg-customer-chrome .kg-header-mobile-only { display: none !important; }
.kg-header-menu-count { margin-left: auto; border-radius: 999px; padding: 1px 6px; background: #ef4444; color: #fff; font-size: 10px; }
.kg-customer-page-heading { display: flex; align-items: center; gap: 8px; width: min(640px,100%); margin-inline: auto; padding: 8px 12px; min-height: 56px; }
.kg-customer-chrome .kg-account-menu { background: var(--ch-bg); border-color: var(--ch-line); color: var(--ch-ink); max-height: calc(100dvh - 88px); overflow-y: auto; }
.kg-customer-chrome .kg-header-count-badge { position: absolute; top: 1px; right: 0; display: flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 3px; border-radius: 999px; background: #ef4444; color: white; font-size: 10px; line-height: 1; }
.kg-customer-chrome .kg-desktop-avatar { display: inline-flex; flex: none; align-items: center; justify-content: center; position: relative; width: 28px; height: 28px; overflow: hidden; border-radius: 50%; background: var(--ch-hover); color: var(--ch-accent); font-size: 13px; font-weight: 700; }
.kg-customer-chrome .kg-desktop-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.kg-customer-chrome .kg-header-login { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px; border: 1px solid var(--ch-line); border-radius: 10px; color: var(--ch-ink); font-size: 12px; }
.kg-customer-category-nav { border-bottom: 1px solid var(--ch-line); background: color-mix(in srgb,var(--ch-search) 50%,var(--ch-bg)); color: var(--ch-ink); }
.kg-customer-category-inner { display: flex; align-items: center; gap: 10px; width: min(1320px,100%); min-height: 48px; margin-inline: auto; padding-inline: 32px; overflow-x: auto; scrollbar-width: none; }
.kg-customer-category-inner button { display: inline-flex; flex: 1 0 auto; align-items: center; justify-content: center; gap: 10px; min-height: 44px; padding: 0 16px; border-radius: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.kg-customer-category-inner button i { color: #8a7cff; font-size: 12px; }
.kg-customer-category-inner button:is(:hover,[aria-pressed=true]) { background: var(--ch-hover); color: var(--ch-accent); }
.kg-customer-chrome.is-compact .kg-customer-header-inner { grid-template-columns: auto auto 1fr auto; gap: 20px; }
.kg-header-back { display: inline-flex; align-items: center; gap: 10px; color: var(--ch-muted); font-size: 12px; min-height: 44px; }
.kg-checkout-header-title { justify-self: end; font-size: 13px; font-weight: 600; color: var(--ch-muted); }
.kg-customer.kg-homepage .kg-announcement.kg-announcement-home { display: block !important; position: static; background: #152033; color: #fff; font-size: 12px; }
.kg-announcement-home > div { width: min(1320px,100%); margin-inline: auto; padding: 8px 32px; }
@media (min-width:900px) and (max-width:1100px) {
    .kg-customer-header-inner { gap: 16px; padding-inline: 24px; min-height: 64px; }
    .kg-customer-chrome .kg-brand { font-size: 20px; }
    .kg-customer-chrome .kg-header-actions { gap: 2px; }
    .kg-customer-category-inner { padding-inline: 24px; }
}
@media (max-width:899px) {
    .kg-customer-header-inner { grid-template-columns: minmax(0,1fr) auto; gap: 8px; min-height: 60px; padding: 6px 12px; }
    .kg-customer-chrome .kg-brand { font-size: 18px; letter-spacing: -.6px; }
    .kg-customer-chrome .kg-header-actions { gap: 2px; }
    body .kg-customer-chrome .kg-customer-search { display: none; grid-row: 2; grid-column: 1 / -1; margin: 2px 0 6px; }
    body .kg-customer-chrome .kg-customer-search.is-open { display: flex; }
    body .kg-customer-chrome .kg-customer-search input { font-size: 16px; }
    body .kg-customer-chrome .kg-header-mobile-search { display: inline-flex !important; }
    body .kg-customer-chrome .kg-customer-header :is(.kg-header-icon-button,[aria-label="Menu akun"]) { width: 36px; height: 40px; min-width: 36px; min-height: 40px; }
    .kg-customer-chrome .kg-header-actions > .kg-chat-button,
    .kg-customer-chrome .kg-header-account,
    .kg-customer-chrome .kg-header-login { display: none !important; }
    .kg-customer-chrome .kg-header-login { width: 36px; height: 40px; padding: 0; border: 0; }
    .kg-customer-chrome .kg-header-login-label { display: none; }
    .kg-customer-chrome .kg-header-mobile-only { display: flex !important; }
    .kg-customer-category-inner { min-height: 42px; gap: 4px; padding-inline: 12px; }
    .kg-customer-category-inner button { flex: none; min-height: 40px; padding-inline: 12px; font-size: 11px; }
    .kg-customer-chrome.is-compact .kg-customer-header-inner { grid-template-columns: auto minmax(0,1fr) auto; gap: 12px; }
    .kg-header-back span,.kg-checkout-header-title { display: none; }
    .kg-header-back { width: 32px; justify-content: center; font-size: 18px; }
    .kg-customer-chrome .kg-notification-menu { position: fixed; right: 12px; top: 60px; width: min(360px,calc(100vw - 24px)); }
    .kg-customer-chrome .kg-account-menu { max-width: calc(100vw - 24px); }
}
@media (prefers-reduced-motion:reduce) { .kg-customer-chrome * { transition: none !important; } }

/* The account entry lives in bottom navigation on mobile. */
.kg-account-mobile-heading { display: none; }
@media (max-width:899px) {
    body .kg-customer-chrome .kg-customer-header .kg-header-icon-button { width:40px; min-width:40px; }
    .kg-customer-chrome .kg-brand { font-size:16px; }
    .kg-customer-chrome .kg-header-actions { gap:0; }
    .kg-customer-chrome .kg-header-actions > .kg-desktop-notifications { order:1; }
    .kg-customer-chrome .kg-header-actions > :has(> [aria-label="Room Rekber"]),
    .kg-customer-chrome .kg-header-actions > [aria-label^="Pesan RekBer"] { order:2; }
    .kg-customer-chrome .kg-header-actions > .kg-theme-toggle { order:3; }
    .kg-account-mobile-heading { display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; }
    .kg-account-mobile-heading h1 { font-size:20px; font-weight:700; }
    .kg-account-settings { display:inline-flex; width:44px; height:44px; align-items:center; justify-content:center; font-size:21px; border-radius:10px; color:inherit; }
    .kg-account-settings:focus-visible { outline:2px solid #9e8aff; outline-offset:2px; }
}

@media (max-width:899px) {
    body.kg-customer .kg-customer-chrome { z-index:95; }
    body.kg-customer:has(.kg-customer-chrome) .dm-page { top:60px; }
    body.kg-customer:has(.kg-customer-chrome) .regular-chat:is(.is-mobile-inbox,.is-mobile-room) { top:calc(var(--regular-top,0px) + 60px); height:calc(var(--regular-height,100dvh) - var(--regular-nav-height,0px) - 60px); }
    body.kg-customer:has(.kg-customer-chrome) .rekber-mobile-room { top:calc(var(--room-top,0px) + 60px); height:calc(var(--room-height,100dvh) - 60px); }
}

/* Account mobile actions and identity. */
@media (max-width:899px) {
    body .kg-customer-chrome.is-account .kg-header-mobile-search { display:none !important; }
    .kg-customer-chrome.is-account .kg-header-actions > [x-data="shopCartBadge()"] { display:block !important; order:3; }
    .kg-customer-chrome.is-account .kg-account-header-settings { order:4; }
    .kg-customer-chrome.is-account .kg-brand { font-size:15px; }
    .kg-customer-chrome.is-account .kg-customer-header-inner { padding-inline:8px; gap:4px; }
    .kg-account-mobile-heading { justify-content:flex-start; gap:14px; padding:12px 0; }
    .kg-account-mobile-heading h1 { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
    .kg-account-customer-avatar { position:relative; display:inline-flex; align-items:center; justify-content:center; flex:none; width:64px; height:64px; border-radius:50%; overflow:hidden; background:#e3e5ff; color:#6b60f5; font-size:30px; }
    .kg-account-customer-avatar img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
    .kg-mobile-settings-shell > .kg-customer-page-heading { position:sticky; top:0; z-index:40; background:#f5f7fc; border-bottom:1px solid #d9e1ee; }
    .dark .kg-mobile-settings-shell > .kg-customer-page-heading { background:#111c2b; border-color:#2a3a50; }
}

.kg-account-menu-mobile-header { display:none; }
body.kg-customer .kg-customer-page-heading.kg-mobile-back-heading { display:flex; flex-direction:row; align-items:center; gap:8px; }
.kg-mobile-back-heading > a { display:inline-flex; align-items:center; justify-content:center; width:44px; height:44px; flex:none; }
.kg-mobile-back-heading > h1 { margin:0; line-height:1.3; }
@media (max-width:899px) {
    body.kg-customer .kg-account-menu-desktop-chrome { display:none !important; }
    .kg-account-menu-mobile-header { display:block; position:sticky; top:0; z-index:40; background:#f5f7fc; border-bottom:1px solid #d9e1ee; }
    .dark .kg-account-menu-mobile-header { background:#111c2b; border-color:#2a3a50; }
    body.kg-customer:has(.kg-account-menu-mobile-header) .kw-page-head,
    body.kg-customer:has(.kg-account-menu-mobile-header) .kg-help-desktop-heading { display:none; }
}

.kg-destination-root-heading { display:none; }
@media(max-width:899px) {
    .kg-destination-desktop-chrome { display:none !important; }
    .kg-destination-root-heading { display:block; }
    .kg-mobile-destination :is(.kg-help-desktop-heading,.kg-room-desktop-heading) { display:none; }
    body.kg-customer:has(.kg-destination-desktop-chrome) .regular-chat:is(.is-mobile-inbox,.is-mobile-room) { top:var(--regular-top,0px); height:calc(var(--regular-height,100dvh) - var(--regular-nav-height,0px)); }
    body.kg-customer:has(.kg-destination-desktop-chrome) .rekber-mobile-room { top:var(--room-top,0px); height:var(--room-height,100dvh); }
    body.kg-customer:has(.kg-destination-desktop-chrome) .dm-page { top:0; }
    body.kg-notification-center-page .kg-customer-chrome,
    body.kg-notification-center-page .kg-account-menu-mobile-header { display:none !important; }
}

@media(max-width:899px) {
    body.kg-customer:has(.rekber-mobile-room) .kg-customer-chrome { display:none !important; }
    body.kg-customer:has(.rekber-mobile-room) .rekber-mobile-room { top:var(--room-top,0px); height:var(--room-height,100dvh); }
}

/* Theme control belongs to the Home welcome bar on every screen size. */
.kg-announcement-home > div { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:52px; padding-block:4px; }
.kg-announcement-home .kg-theme-toggle { display:inline-flex; flex:none; align-items:center; gap:7px; min-height:36px; padding:0 4px; border:0; border-radius:6px; background:transparent; color:#64748b; font-size:13px; cursor:pointer; }
.kg-announcement-home .kg-theme-symbol { display:inline-flex; align-items:center; justify-content:center; width:18px; height:18px; flex:none; background:transparent; color:#eabf38; }
.kg-announcement-home .kg-theme-symbol svg { display:block; width:18px; height:18px; flex:none; }
.kg-announcement-home .kg-theme-toggle:hover { background:rgb(148 163 184 / .08); }
.dark .kg-announcement-home .kg-theme-toggle { color:#cbd5e1; }
.dark .kg-announcement-home .kg-theme-symbol { background:transparent; color:#cbd5e1; }
.kg-announcement-home .kg-theme-toggle:focus-visible { outline:2px solid #9e8aff; outline-offset:3px; border-radius:6px; }
.kg-customer.kg-homepage .kg-announcement.kg-announcement-home { background:#f5f7fc; color:#64748b; }
.dark .kg-customer.kg-homepage .kg-announcement.kg-announcement-home { background:#111827; color:#a5b4fc; }
@media(max-width:899px) {
    .kg-announcement-home > div { padding-inline:12px; min-height:48px; }
    .kg-announcement-home .kg-theme-toggle { font-size:12px; }
    .kg-customer-chrome .kg-header-actions > [x-data="shopCartBadge()"] { display:block !important; order:3; }
}

.kg-product-mobile-heading { display:none; }
@media(max-width:899px) {
    .kg-product-chrome .kg-brand,
    .kg-product-chrome .kg-customer-category-nav { display:none; }
    .kg-product-mobile-heading { display:flex; align-items:center; gap:4px; min-width:0; }
    .kg-product-mobile-heading strong { min-width:0; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; font-size:14px; font-weight:600; }
    .kg-product-chrome .kg-customer-header-inner { padding-inline:8px; gap:4px; }
    .kg-product-chrome .kg-header-actions > :not(.kg-header-mobile-search):not(.kg-product-share):not([x-data="shopCartBadge()"]) { display:none !important; }
    .kg-product-chrome .kg-product-share { order:2; }
}
