/* KDVito v6: isolated shared header */
.kd-site-header,.kd-site-header *,.kd-location-backdrop,.kd-location-backdrop *{box-sizing:border-box}
.kd-site-header{background:var(--kd-surface,#fff);border-bottom:1px solid var(--kd-border,#e4eaf4);position:relative;z-index:30;font-family:system-ui,-apple-system,"Segoe UI",Arial,sans-serif;color:var(--kd-link,#17233a)}
.kd-site-header__inner{max-width:1230px;min-height:76px;margin:auto;padding:12px 22px;display:flex;align-items:center;gap:22px}
.kd-site-header a{text-decoration:none!important}.kd-site-header button{font:inherit;cursor:pointer}
.kd-site-header__logo{font-size:30px;font-weight:850;letter-spacing:-1.5px;color:var(--kd-link,var(--kd-brand))!important;white-space:nowrap;line-height:1}.kd-site-header__logo span{color:var(--kd-text,#18243b)}
.kd-site-header__location{display:flex;align-items:center;gap:6px;min-width:0;max-width:255px;border:0;background:var(--kd-surface,#f4f7fc);border-radius:10px;padding:10px 11px;color:var(--kd-link,#324461);font-size:13px!important;font-weight:650;white-space:nowrap}
.kd-site-header__location span#kd-current-city{overflow:hidden;text-overflow:ellipsis}.kd-site-header__chevron{font-size:19px}
.kd-site-header__location svg{width:17px;height:17px;flex-shrink:0;fill:none;stroke:var(--kd-link,var(--kd-brand));stroke-width:1.8}
.kd-site-header__nav{display:flex;align-items:center;gap:8px;margin-left:auto}.kd-site-header__nav a,.kd-site-header__icon-button{display:flex;align-items:center;justify-content:center;position:relative;width:40px;height:40px;border:0;background:transparent;border-radius:11px;color:var(--kd-link,#33445f)!important}.kd-site-header__nav a:hover,.kd-site-header__icon-button:hover{background:var(--kd-surface-soft,#eff5ff);color:var(--kd-light-link,var(--kd-link,var(--kd-brand)))!important}
.kd-site-header__nav svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.kd-header-badge{position:absolute;right:-3px;top:-3px;background:#e33447;color:white;border:2px solid var(--kd-border,white);min-width:19px;height:19px;padding:0 3px;border-radius:12px;display:flex;align-items:center;justify-content:center;font-size:10px;font-weight:800}.kd-header-badge[hidden]{display:none}
.kd-site-header__post{display:flex;align-items:center;justify-content:center;gap:6px;padding:12px 15px;background:var(--kd-brand);color:#fff!important;font-size:13px;font-weight:750;border-radius:11px;white-space:nowrap}.kd-site-header__post:hover{background:#0f55c7}
.kd-bell-panel{position:absolute;right:max(15px,calc((100vw - 1230px)/2 + 80px));top:70px;max-width:320px;padding:18px;background:var(--kd-surface,#fff);box-shadow:0 15px 45px #13294b30;border:1px solid var(--kd-border,#e3eaf5);border-radius:14px;font-size:14px;z-index:60}.kd-bell-panel p{font-size:13px;color:var(--kd-text-muted,#6a7890);line-height:1.5}.kd-bell-panel[hidden]{display:none}
.kd-location-backdrop{position:fixed;inset:0;z-index:2147483001;background:#0b1a36a8;display:flex;justify-content:center;align-items:center;padding:16px;font-family:system-ui,-apple-system,"Segoe UI",Arial,sans-serif}.kd-location-backdrop[hidden]{display:none}
.kd-location-modal{width:min(100%,510px);max-height:90vh;overflow:auto;background:var(--kd-surface,#fff);border-radius:20px;padding:24px;color:var(--kd-link,#1b2b44);box-shadow:0 25px 70px #071b3b45}
.kd-location-modal__head{display:flex;justify-content:space-between;align-items:center;gap:15px}.kd-location-modal__head h2{font-size:22px;line-height:1.3;margin:0}.kd-location-modal__head button{border:0;background:var(--kd-surface,#f2f5fa);width:34px;height:34px;border-radius:9px;font-size:26px;cursor:pointer}.kd-location-hint{color:var(--kd-text-muted,#6e7b90);font-size:13px;margin:8px 0 17px}
#kd-location-search{display:block;width:100%;padding:13px 14px;border:1px solid var(--kd-border,#dce5f2);border-radius:11px;font-size:15px;outline-color:var(--kd-brand)}.kd-location-detect{border:0;background:var(--kd-surface,#f1f6ff);color:var(--kd-light-link,var(--kd-link,var(--kd-brand)));padding:11px 14px;border-radius:10px;font-weight:700;cursor:pointer;margin-top:12px;width:100%;text-align:left}.kd-location-status{font-size:12px;color:var(--kd-text-muted,#65748c);min-height:17px;margin:8px 0}.kd-location-list{max-height:260px;overflow:auto;border:1px solid var(--kd-border,#e8edf6);border-radius:11px}.kd-location-option{display:flex;justify-content:space-between;width:100%;padding:11px 14px;background:var(--kd-surface,#fff);border:0;border-bottom:1px solid var(--kd-border,#f0f2f6);text-align:left;cursor:pointer;color:var(--kd-link,#263650);font-size:14px}.kd-location-option:hover,.kd-location-option[aria-selected="true"]{background:var(--kd-surface-soft,#eef5ff);color:var(--kd-light-link,var(--kd-link,var(--kd-brand)))}.kd-location-confirm{margin-top:15px;width:100%;border:0;background:var(--kd-brand);color:#fff;padding:13px;border-radius:11px;font-size:14px;font-weight:750;cursor:pointer}
@media(max-width:850px){.kd-site-header__inner{gap:12px;padding:10px 15px}.kd-site-header__location{max-width:180px}.kd-site-header__nav{gap:2px}.kd-site-header__post{padding:10px}}
@media(max-width:640px){.kd-site-header__inner{min-height:62px;gap:6px;padding:8px}.kd-site-header__logo{font-size:23px}.kd-site-header__location{max-width:105px;font-size:11px!important;padding:7px 5px}.kd-site-header__location svg{width:13px}.kd-site-header__nav a,.kd-site-header__icon-button{width:30px;height:34px}.kd-site-header__nav svg{width:19px;height:19px}.kd-site-header__post{padding:8px 9px}.kd-site-header__post-label{display:none}.kd-location-modal{padding:17px}}
@media(max-width:390px){.kd-site-header__location{max-width:80px}.kd-site-header__nav a,.kd-site-header__icon-button{width:27px}}

/* v7: компактное местоположение и гарантированная видимость счётчика */
.kd-site-header__location{max-width:205px;gap:5px;padding:8px 10px}
.kd-site-header__location span#kd-current-city{display:block;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.kd-site-header__chevron{display:none!important}
.kd-header-badge:not([hidden]){display:flex!important}
.kd-header-badge[hidden]{display:none!important}
@media(max-width:640px){.kd-site-header__location{max-width:116px;padding:7px 6px}}

@media(max-width:640px){.kd-site-header__nav a[href="/profile.php?section=wallet"]{display:none}}

/* Global search, desktop and mobile. */
.kd-site-header__inner{flex-wrap:wrap;gap:14px;max-width:1440px}.kd-site-header__location{max-width:180px}.kd-header-search{display:flex;align-items:stretch;flex:1 1 250px;min-width:210px;position:relative;margin:0;border:1px solid var(--kd-border,#dce5f2);border-radius:12px;background:var(--kd-surface,#f5f8fc);height:44px}.kd-header-search .smart-search-wrap{position:relative;flex:1;min-width:0;display:flex}.kd-header-search input{font:inherit;font-size:13px;min-width:0;width:100%;border:0;background:transparent;padding:10px 13px;outline-offset:2px;border-radius:12px}.kd-header-search__submit{border:0;border-radius:9px;background:var(--kd-brand);color:white;margin:4px;padding:0 12px;font-size:12px!important}.kd-header-search .smart-search-options{position:absolute;left:0;right:-75px;top:calc(100% + 10px);max-height:min(65vh,490px);overflow:auto;padding:8px;background:var(--kd-surface,white);border:1px solid var(--kd-border,#dce5f2);border-radius:14px;box-shadow:0 20px 55px #193c6b2b;z-index:110}.kd-header-search .smart-search-options[hidden]{display:none}.kd-header-search .smart-search-option{display:flex;align-items:center;width:100%;border:0;background:var(--kd-surface,white);border-radius:9px;text-align:left;color:var(--kd-link,#17233a)}.kd-header-search .smart-search-option:hover,.kd-header-search .smart-search-option[aria-selected=true]{background:var(--kd-surface-soft,#eff5ff)}.kd-header-search .smart-search-empty{padding:12px;color:var(--kd-text-muted,#758197);font-size:13px}
.kd-header-search .smart-search-options{left:0;right:0;top:calc(100% + 10px);max-height:min(65vh,490px);padding:10px;box-shadow:0 20px 55px #193c6b2b;border-radius:17px;z-index:110}
.kd-header-search .smart-search-group{padding:12px 12px 7px;font-size:11px;letter-spacing:.07em;text-transform:uppercase;font-weight:800;color:var(--kd-text-muted,#75849b)}
.kd-header-search .smart-search-divider{height:1px;background:var(--kd-surface-soft,#e8edf5);margin:9px 10px}
.kd-header-search .smart-search-option{padding:12px 13px;gap:12px;justify-content:flex-start;min-height:55px}
.kd-header-search .smart-search-icon{display:grid;place-items:center;width:34px;height:34px;flex:0 0 34px;border-radius:10px;background:var(--kd-surface-soft,#f0f5ff);color:var(--kd-light-link,var(--kd-link,#3469c5));font-size:19px}
.kd-header-search .smart-search-option-content{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}
.kd-header-search .smart-search-option-label{font-size:14px;font-weight:650;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.kd-header-search .smart-search-kind{font-size:12px;color:var(--kd-text-muted,#8390a3);white-space:normal}
.kd-header-search .smart-search-arrow{color:var(--kd-text-muted,#9ca8b8);font-size:20px}
.kd-header-search .smart-search-footer{display:block;width:100%;border:0;border-top:1px solid var(--kd-border,#e8edf5);background:var(--kd-surface,#fff);color:var(--kd-light-link,var(--kd-link,var(--kd-brand)));font-weight:700;padding:14px;text-align:left;border-radius:0 0 10px 10px}
.kd-header-search .smart-search-footer:hover{background:var(--kd-surface-soft,#eff5ff)}
@media(max-width:600px){.kd-header-search .smart-search-options{left:-6px;right:-80px;max-height:65vh;padding:6px}.kd-header-search .smart-search-option{padding:10px 8px}.kd-header-search .smart-search-option-label{font-size:13px}}
@media(max-width:1000px){.kd-site-header__location{max-width:150px}.kd-site-header__post-label{display:none}.kd-site-header__post{padding:9px 13px}.kd-site-header__inner{gap:10px}.kd-site-header__nav{gap:2px}}
@media(max-width:760px){.kd-site-header__inner{padding:12px 14px;gap:10px}.kd-header-search{order:5;flex-basis:100%;min-width:0;width:100%}.kd-site-header__location{max-width:130px}.kd-site-header__nav{margin-left:auto}.kd-site-header__nav a,.kd-site-header__icon-button{width:32px;height:36px}.kd-header-search .smart-search-options{left:0;right:-65px}.kd-site-header__post{padding:8px}.kd-site-header__logo{font-size:25px}.kd-bell-panel{top:65px}}
@media(max-width:440px){.kd-site-header__location{order:4;max-width:none;flex:1 1 100%;font-size:11px!important;padding:6px 10px}.kd-site-header__post{margin-left:0}.kd-site-header__inner{gap:7px}}

/* Keep the search input and submit button stable while editing and autofilling. */
.kd-public-page .kd-site-header form.kd-header-search{height:44px;box-sizing:border-box;border:1px solid var(--kd-border,#dce5f2);background:var(--kd-surface,#f5f8fc);box-shadow:none;outline:none}
.kd-public-page .kd-site-header form.kd-header-search:focus-within{border-color:var(--kd-border,#a8b8cb);background:var(--kd-surface,#f5f8fc);box-shadow:0 0 0 2px #102a4308;outline:none}
.kd-site-header form.kd-header-search .smart-search-wrap{flex:1 1 0%;min-width:0}
.kd-site-header form.kd-header-search #smart-search-input,.kd-site-header form.kd-header-search #smart-search-input:focus,.kd-site-header form.kd-header-search #smart-search-input:focus-visible{box-sizing:border-box;min-width:0;width:100%;border:0;outline:none;box-shadow:none;background:transparent;color:var(--kd-link,#172b4d);font-size:14px;font-weight:400;padding:10px 13px}
.kd-site-header form.kd-header-search #smart-search-input:-webkit-autofill{-webkit-text-fill-color:#172b4d;-webkit-box-shadow:0 0 0 1000px #f5f8fc inset}
.kd-site-header form.kd-header-search .kd-header-search__submit,.kd-site-header form.kd-header-search:focus-within .kd-header-search__submit{flex:0 0 auto;min-width:72px;width:auto;box-sizing:border-box;border:0;border-radius:8px;margin:4px;padding:0 16px;background:var(--kd-brand);color:#fff;font:inherit;font-size:13px!important;font-weight:600;line-height:1;box-shadow:none;outline:none}
.kd-site-header form.kd-header-search .kd-header-search__submit:focus-visible{outline:2px solid #52749f;outline-offset:3px}
.kd-site-header form.kd-header-search .smart-search-options{left:0;right:0;min-width:0}

/* Category-aware smart search, KD 1.0.23. */
.kd-search-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.kd-header-search .smart-search-icon svg{width:21px;height:21px;display:block}
.kd-header-search .smart-search-option-label{white-space:normal;overflow-wrap:anywhere;font-size:14px;font-weight:550;line-height:1.4}
.kd-header-search .smart-search-kind{font-size:12px;line-height:1.5;color:var(--kd-text-muted,#778aa5)}
.kd-header-search .smart-search-option-label mark{background:transparent;color:inherit;font-weight:750}
.kd-header-search .smart-search-footer-option{border-top:1px solid var(--kd-border,#e7eef8);margin-top:8px;color:var(--kd-light-link,var(--kd-link,var(--kd-brand)));background:var(--kd-surface,#f5f9ff)}
.kd-header-search .smart-search-option[aria-selected=true]{background:var(--kd-surface-soft,#edf4ff);box-shadow:inset 3px 0 var(--kd-brand)}
.kd-header-search .smart-search-options{overscroll-behavior:contain;scrollbar-width:thin}
@media(max-width:600px){.kd-header-search .smart-search-option{min-height:58px}.kd-header-search .smart-search-kind{font-size:11px}}

/* Align suggestions to the complete search bar, including the submit button. */
.kd-site-header form.kd-header-search .smart-search-wrap{position:static}
