/* =========================================================
       KK HEADER — DESKTOP ONLY
       Мобильную версию (mobile) убрали из этого файла.
       Этот хедер скрывается на ширине < 1024px.
    ========================================================= */

    :root {
      --kk-mainbar-h: 76px;

      --kk-mainbar-pad-x: 28px;
      --kk-topbar-pad-x: 28px;

      /* отступ слева (left padding) */
      --kk-mainbar-pad-left: 16px;

      --kk-icon-size: 22px;

      --kk-accent: #FF3BA6;
      --kk-accent-soft: rgba(255, 59, 166, .14);
      --kk-hairline: 1px solid rgba(15, 23, 42, .08);

      /* ЛОГО: max width (logo max width) */
      --kk-logo-max-w: 480px;

      /* Сдвиг PNG внутри (shift inside PNG) */
      --kk-logo-shift-x: -46px;

      /* ПОИСК: max width (search max width) */
      --kk-search-max-w: clamp(620px, 46vw, 1120px);

      /* gap между блоками (center gap) */
      --kk-center-gap: 18px;
    }

    html, body {
      margin: 0 !important;
      padding: 0 !important;
      overflow-x: hidden;
      width: 100%;
    }

    /* ===== Desktop-only gating: скрываем весь header на мобилке ===== */
    @media (max-width: 1023.98px) {
      .kk-header-desktop-only { display: none !important; }
    }
    @media (min-width: 1024px) {
      .kk-header-desktop-only { display: block; }
    }

    /* ============ TOPBAR (ЧЁРНАЯ ПОЛОСА) ============ */
    .kk-topbarA {
      background: #000;
      color: #fff;
      height: 42px;
      line-height: 1;
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 60;
      width: 100%;
      position: relative;
      margin-top: 0 !important;
      padding: 0 !important;
    }

    .kk-topbarA .kk-wrap {
      height: 100%;
      width: 100%;
      max-width: 1320px;
      margin: 0 auto;
      padding: 0 var(--kk-topbar-pad-x);
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 28px;
      box-sizing: border-box;
    }

    .kk-topbarA__nav {
      display: inline-flex;
      gap: 32px;
      justify-content: center;
      white-space: nowrap;
    }

    .kk-topbarA__nav a {
      color: #fff;
      text-decoration: none;
      opacity: .95;
      font-size: 14px;
      transition: opacity .2s ease, text-decoration .2s ease;
      padding: 4px 0;
    }

    .kk-topbarA__nav a:hover {
      opacity: 1;
      text-decoration: underline;
      text-underline-offset: 4px;
    }

    .kk-topbarA__lang {
      display: inline-flex;
      gap: 12px;
      justify-content: center;
      white-space: nowrap;
    }

    .kk-topbarA__lang button {
      height: 30px;
      padding: 0 14px;
      border-radius: 16px;
      border: 1px solid rgba(255, 255, 255, .3);
      background: rgba(255, 255, 255, .06);
      color: #fff;
      font-size: 13px;
      cursor: pointer;
      transition: all .2s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .kk-topbarA__lang button:hover {
      background: rgba(255, 255, 255, .18);
      transform: translateY(-1px);
      box-shadow: 0 2px 8px rgba(255, 255, 255, .2);
    }

    .kk-topbarA__lang .is-active {
      background: #fff;
      color: #000;
      border-color: #fff;
      font-weight: 600;
    }

    /* ============ MAINBAR (БЕЛАЯ ПОЛОСА) ============ */
    .kk-mainbar {
      background: #ffffff;
      color: #111827;
      height: var(--kk-mainbar-h);
      display: flex;
      align-items: center;
      border-bottom: var(--kk-hairline);
      z-index: 55;
      line-height: 1;
      box-shadow: 0 6px 18px rgba(15, 23, 42, .04);
      width: 100%;
      position: relative;
      margin-top: 0 !important;
      padding: 0 !important;
    }

    .kk-mainbar .kk-wrap {
      height: 100%;
      display: flex;
      align-items: stretch;
      justify-content: space-between;
      width: 100%;
      padding: 0 var(--kk-mainbar-pad-x);
      padding-left: var(--kk-mainbar-pad-left);
      max-width: 100%;
      margin: 0;
      gap: 0;
      box-sizing: border-box;
    }

    /* ===== Left: logo ===== */
    .kk-header-left {
      display: flex;
      align-items: stretch;
      flex: 0 0 auto;
      width: auto;
      min-width: 0;
      justify-content: flex-start;
      max-width: var(--kk-logo-max-w);
    }

    .kk-logo {
      display: flex;
      align-items: stretch;
      height: 100%;
      width: auto;
      margin: 0;
    }

    .kk-logo-link {
      display: flex;
      align-items: stretch;
      width: auto;
      height: 100%;
      line-height: 0;
      text-decoration: none;
      overflow: hidden;
      max-width: var(--kk-logo-max-w);
    }

    .kk-logo-link img {
      display: block;
      height: 100%;
      width: auto;
      max-width: none;
      object-fit: contain;
      object-position: left center;
      transform: translateX(var(--kk-logo-shift-x));
      transform-origin: left center;
    }

    /* ===== Center: search ===== */
    .kk-header-center {
      display: flex;
      align-items: center;
      flex: 1 1 auto;
      justify-content: center;
      margin: 0 var(--kk-center-gap);
      max-width: none;
      min-width: 0;
    }

    .kk-main-search-form {
      width: 100%;
      max-width: var(--kk-search-max-w);
      margin: 0 auto;
    }

    .kk-main-search-inner {
      display: flex;
      align-items: center;
      border-radius: 999px;
      border: 1.5px solid var(--kk-accent);
      background: #ffffff;
      padding: 0 4px 0 14px;
      box-shadow: 0 8px 24px rgba(255, 59, 166, .22);
      width: 100%;
      max-width: none;
    }

    .kk-main-search-inner .kk-main-search-input {
      flex: 1 1 auto;
      border: none !important;
      outline: none !important;
      box-shadow: none !important;
      height: 38px;
      font-size: 14px;
      padding: 0 10px;
      background: transparent;
      color: #111827;
      min-width: 260px;
    }

    .kk-main-search-inner .kk-main-search-input::placeholder {
      color: #9ea3af;
    }

    .kk-mainbar .kk-main-search-inner .kk-main-search-btn {
      all: unset;
      box-sizing: border-box;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 0 18px;
      margin: 0 4px 0 2px;
      height: 34px;
      border-radius: 999px;
      font-family: inherit;
      font-size: 14px;
      font-weight: 600;
      line-height: 1;
      white-space: nowrap;
      cursor: pointer;
      color: var(--kk-accent);
      background: transparent;
      -webkit-appearance: none;
      appearance: none;
      transition: background .15s ease, color .15s ease, transform .08s ease, box-shadow .18s ease;
    }

    .kk-mainbar .kk-main-search-inner .kk-main-search-btn:hover,
    .kk-mainbar .kk-main-search-inner .kk-main-search-btn:focus-visible {
      background: var(--kk-accent-soft);
      color: var(--kk-accent);
      transform: translateY(-1px);
      box-shadow: 0 4px 12px rgba(255, 59, 166, .30);
      outline: none;
    }

    /* ===== Right: contacts + icons ===== */
    .kk-header-right {
      display: flex;
      align-items: center;
      flex: 0 0 auto;
      justify-content: flex-end;
      min-width: 360px;
      gap: 24px;
    }

    .kk-header-contacts {
      display: flex;
      align-items: center;
      gap: 20px;
      margin-right: 24px;
      white-space: nowrap;
      padding: 8px 0;
    }

    .kk-phone-link {
      font-weight: 700;
      text-decoration: none;
      color: #111827;
      white-space: nowrap;
      font-size: 15px;
      padding: 8px 12px;
      border-radius: 8px;
      transition: all .2s ease;
      position: relative;
    }

    .kk-phone-link:before {
      content: '';
      position: absolute;
      top: 50%;
      left: -8px;
      transform: translateY(-50%);
      width: 4px;
      height: 4px;
      background: var(--kk-accent);
      border-radius: 50%;
      opacity: 0;
      transition: opacity .2s ease;
    }

    .kk-phone-link:hover {
      color: var(--kk-accent);
      background: rgba(255, 59, 166, .05);
      padding-left: 24px;
    }

    .kk-phone-link:hover:before {
      opacity: 1;
    }

    .kk-header-icons {
      display: flex;
      align-items: center;
      gap: 16px;
    }

    .kk-icon-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 44px;
      height: 44px;
      border-radius: 999px;
      border: none;
      background: rgba(0, 0, 0, .02);
      text-decoration: none;
      cursor: pointer;
      transition: all .2s cubic-bezier(0.4, 0, 0.2, 1);
      position: relative;
    }

    .kk-icon-btn:hover {
      background: var(--kk-accent-soft);
      transform: translateY(-2px);
      box-shadow: 0 6px 20px rgba(255, 59, 166, .3);
    }

    .kk-icon {
      width: var(--kk-icon-size);
      height: var(--kk-icon-size);
      display: inline-block;
    }

    .kk-icon svg {
      width: 100%;
      height: 100%;
      display: block;
      stroke: var(--kk-accent);
      transition: stroke .2s ease;
    }

    .kk-icon-btn:hover .kk-icon svg {
      stroke: #ff1a8c;
    }

    .kk-icon-img img {
      width: 100%;
      height: 100%;
      display: block;
      object-fit: contain;
      transition: transform .2s ease;
    }

    .kk-icon-btn:hover .kk-icon-img img {
      transform: scale(1.1);
    }

    .kk-header-contacts .kk-social {
      width: 40px;
      height: 40px;
      background: rgba(255, 59, 166, .08);
      border: 1px solid rgba(255, 59, 166, .15);
    }

    .kk-header-contacts .kk-social:hover {
      background: rgba(255, 59, 166, .15);
      border-color: var(--kk-accent);
    }

    .kk-fav-link {
      background: rgba(255, 59, 166, .08);
    }

    .kk-fav-link .kk-icon svg {
      stroke: var(--kk-accent);
      fill: rgba(255, 59, 166, .2);
    }

    .kk-fav-link:hover {
      background: rgba(255, 59, 166, .15);
    }

    /* Divider */
    .kk-divider {
      display: block;
      height: 2px;
      background: linear-gradient(90deg, transparent, var(--kk-accent), transparent);
      margin: 0;
      box-sizing: border-box;
      width: 100%;
      opacity: .3;
    }

    /* Badge */
    .kk-icon-badge {
      position: absolute;
      top: -4px;
      right: -4px;
      background: var(--kk-accent);
      color: white;
      font-size: 10px;
      font-weight: 700;
      min-width: 18px;
      height: 18px;
      border-radius: 9px;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 0 4px;
      box-shadow: 0 2px 6px rgba(255, 59, 166, .4);
      transition: transform .2s ease;
    }

    .kk-icon-badge.kk-pulse {
      animation: kk-badge-pulse .35s ease;
    }

    @keyframes kk-badge-pulse {
      0%   { transform: scale(1); }
      50%  { transform: scale(1.4); }
      100% { transform: scale(1); }
    }

    /* =========================================================
       PROTECTION OVERRIDES — защита от перебивающего CSS
       =========================================================
       Если на странице товара (single-product.css или другой CSS,
       подгружаемый позже шапки) перебивает наш бейдж/иконки —
       эти правила побеждают за счёт:
         (а) высокой специфичности (3 класса + body)
         (б) !important на критичных свойствах (размер, позиция, цвет)
       Только размеры и позиции защищены — анимации и hover остаются
       управляемыми обычным CSS выше.
    ========================================================= */

    body .kk-header-desktop-only .kk-icon-btn {
      width: 44px !important;
      height: 44px !important;
      border-radius: 999px !important;
      position: relative !important;
      display: inline-flex !important;
      align-items: center !important;
      justify-content: center !important;
      box-sizing: border-box !important;
    }

    body .kk-header-desktop-only .kk-header-contacts .kk-social {
      width: 40px !important;
      height: 40px !important;
    }

    body .kk-header-desktop-only .kk-icon {
      width: var(--kk-icon-size) !important;
      height: var(--kk-icon-size) !important;
      display: inline-block !important;
    }

    body .kk-header-desktop-only .kk-icon svg {
      width: 100% !important;
      height: 100% !important;
      display: block !important;
    }

    body .kk-header-desktop-only .kk-icon-img img {
      width: 100% !important;
      height: 100% !important;
      display: block !important;
      object-fit: contain !important;
    }

    body .kk-header-desktop-only .kk-icon-badge {
      position: absolute !important;
      top: -4px !important;
      right: -4px !important;
      left: auto !important;
      bottom: auto !important;
      background: var(--kk-accent) !important;
      color: #ffffff !important;
      font-size: 10px !important;
      font-weight: 700 !important;
      min-width: 18px !important;
      width: auto !important;
      height: 18px !important;
      max-height: 18px !important;
      border-radius: 9px !important;
      display: flex !important;
      align-items: center !important;
      justify-content: center !important;
      padding: 0 4px !important;
      margin: 0 !important;
      line-height: 1 !important;
      box-sizing: border-box !important;
      box-shadow: 0 2px 6px rgba(255, 59, 166, .4) !important;
      text-decoration: none !important;
      pointer-events: none !important;
      z-index: 2 !important;
    }

    /* Когда счётчик скрыт через display:none из JS — пусть будет точно скрыт */
    body .kk-header-desktop-only .kk-icon-badge[style*="display: none"],
    body .kk-header-desktop-only .kk-icon-badge[style*="display:none"] {
      display: none !important;
    }

    /* Убираем стили Elementor (Elementor reset) */
    .elementor-location-header,
    .elementor-location-header > .elementor-section.elementor-top-section:first-child,
    .elementor-location-header .elementor-section-wrap > .elementor-section:first-child,
    .elementor-location-header .elementor-container,
    .elementor-location-header .elementor-row,
    .elementor-location-header .elementor-column,
    .elementor-location-header .elementor-widget-wrap,
    .elementor-location-header .elementor-widget-container {
      margin-top: 0 !important;
      padding-top: 0 !important;
      border-top: none !important;
    }

    /* ============================================================
       v2.0.1: ЗАЩИТА ОТ ЧУЖИХ СЧЁТЧИКОВ КОРЗИНЫ ВНУТРИ НАШЕЙ ШАПКИ
       ============================================================
       Проблема: тема (или другой плагин) рендерит СВОЙ счётчик
       внутри/рядом с нашей кнопкой-иконкой корзины. У него свой CSS
       — обычно красный фон (#dc2626/#ef4444). Визуально выглядит как
       второй кружок поверх нашего розового, и обновляется он по своим
       правилам (часто не обновляется вообще на архивных страницах).
       Решение: прячем любой счётчик внутри .kk-icon-btn, кроме нашего
       .kk-icon-badge / .kk-cart-count / .kk-wishlist-count.
       ============================================================ */
    .kk-header-icons .kk-icon-btn .cart-contents-count,
    .kk-header-icons .kk-icon-btn .cart-count,
    .kk-header-icons .kk-icon-btn .cart-counter,
    .kk-header-icons .kk-icon-btn .cart-items-count,
    .kk-header-icons .kk-icon-btn .cart_count,
    .kk-header-icons .kk-icon-btn .mini-cart-counter,
    .kk-header-icons .kk-icon-btn .header-cart-count,
    .kk-header-icons .kk-icon-btn .menu-cart-count,
    .kk-header-icons .kk-icon-btn .woocommerce-cart-count,
    .kk-header-icons .kk-icon-btn .cart-link__count,
    .kk-header-icons .kk-icon-btn .wd-tools-count,
    .kk-header-icons .kk-icon-btn .basel-mini-cart-count,
    .kk-header-icons .kk-icon-btn .elementor-button-icon-qty,
    .kk-header-icons .kk-icon-btn .yith-wcwl-items-count,
    .kk-header-icons .kk-icon-btn [data-cart-count]:not(.kk-cart-count):not(.kk-icon-badge),
    .kk-header-icons .kk-icon-btn .count:not(.kk-cart-count):not(.kk-wishlist-count):not(.kk-icon-badge) {
      display: none !important;
      visibility: hidden !important;
      width: 0 !important;
      height: 0 !important;
      padding: 0 !important;
      margin: 0 !important;
      opacity: 0 !important;
      pointer-events: none !important;
    }
