﻿.mobile-menu-button {
      display: none;
    }

    .nav-icon,
    .nav-chevron,
    .nav-submenu,
    .products-toggle {
      display: none;
    }

    .nav-desktop-only {
      display: none;
    }

    .products-megamenu {
      display: none;
    }

      @media (min-width: 1024px) {
      .nav-desktop-only {
        display: inline;
      }

      .header-promo {
        margin: 0;
        border-radius: 0;
      }

      header {
        overflow: visible !important;
      }

      .header-main {
        min-height: 6.5rem !important;
      }

      .header-main > a img {
        width: auto !important;
        height: 64px !important;
        max-width: 200px !important;
        object-fit: contain;
      }

      .header-main > nav > a,
      .nav-products > .nav-desktop-only {
        position: relative;
        z-index: 100;
        padding: 12px 18px !important;
      }

      .header-main > .header-actions {
        position: relative;
        z-index: 100;
      }

      .electric-promo {
        min-height: 42px;
        padding: 11px 18px !important;
      }

      .nav-products {
        position: static;
      }

      .products-desktop-toggle {
        display: inline-flex;
        align-items: center;
        gap: 0.35rem;
        border: 0;
        border-radius: 9999px;
        background: transparent;
        color: inherit;
        font: inherit;
        cursor: var(--cursor-click);
        transition: background .2s ease, color .2s ease;
      }

      .products-desktop-toggle:hover,
      .nav-products.is-open .products-desktop-toggle {
        background: rgba(255, 255, 255, .05);
        color: #f87171;
      }

      .products-desktop-chevron {
        display: grid;
        width: 14px;
        height: 14px;
        place-items: center;
        transition: transform .28s cubic-bezier(.4, 0, .2, 1);
      }

      .products-desktop-chevron svg {
        width: 14px;
        height: 14px;
      }

      .nav-products.is-open .products-desktop-chevron {
        transform: rotate(180deg);
      }

      .products-megamenu {
        display: block;
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        z-index: 90;
        padding: 0 var(--page-gutter);
        pointer-events: none;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-6px);
        transition:
          opacity .22s ease,
          transform .22s ease,
          visibility .22s ease;
      }

      .nav-products.is-open .products-megamenu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
      }

      .products-megamenu__inner {
        display: grid;
        grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
        gap: 0;
        max-width: var(--page-max);
        margin-inline: auto;
        max-height: min(68vh, 520px);
        overflow: visible;
        border: 1px solid rgba(255, 255, 255, .1);
        border-top: 0;
        border-radius: 0 0 18px 18px;
        background: #141516;
        box-shadow: 0 24px 48px rgba(0, 0, 0, .55);
        pointer-events: none;
        position: relative;
      }

      /* Hover bridge under the header — must not block sibling nav clicks */
      .products-megamenu__inner::before {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        bottom: 100%;
        height: 6.5rem;
        pointer-events: none;
      }

      .nav-products.is-open .products-megamenu__inner {
        pointer-events: auto;
      }

      .products-megamenu__mains {
        display: flex;
        flex-direction: column;
        gap: 2px;
        min-height: 0;
        height: 100%;
        max-height: min(68vh, 520px);
        padding: 10px;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        border-right: 1px solid rgba(255, 255, 255, .08);
        border-radius: 0 0 0 17px;
        background: rgba(255, 255, 255, .02);
        scrollbar-width: thin;
        scrollbar-color: rgba(255, 255, 255, .28) transparent;
      }

      .products-megamenu__mains::-webkit-scrollbar {
        width: 6px;
      }

      .products-megamenu__mains::-webkit-scrollbar-thumb {
        border-radius: 9999px;
        background: rgba(255, 255, 255, .28);
      }

      .products-megamenu__main {
        --cut: 1.5px;
        --active: 0;
        --galaxy-hue: 0;
        --galaxy-spark: 1.8s;
        --galaxy-transition: 0.22s;
        display: flex;
        align-items: center;
        gap: 10px;
        width: 100%;
        padding: 7px 10px;
        border: 0;
        border-radius: 12px;
        background: transparent;
        color: #d4d4d8;
        font: inherit;
        font-size: 0.875rem;
        font-weight: 500;
        text-align: left;
        cursor: var(--cursor-click);
        position: relative;
        flex-shrink: 0;
        transition: background .18s ease, color .18s ease;
      }

      .products-megamenu__main:hover,
      .products-megamenu__main.is-active {
        background: rgba(239, 68, 68, .12);
        color: #fff;
      }

      .products-megamenu__thumb {
        width: 36px;
        height: 36px;
        flex-shrink: 0;
        overflow: hidden;
        border-radius: 8px;
        background: #27272a;
      }

      .products-megamenu__thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
      }

      .products-megamenu__main-label {
        flex: 1;
        line-height: 1.25;
      }

      .products-megamenu__main-arrow {
        width: 12px;
        height: 12px;
        flex-shrink: 0;
        opacity: .45;
      }

      .products-megamenu__main.is-active .products-megamenu__main-arrow {
        opacity: .8;
        color: #f87171;
      }

      .products-megamenu__panels {
        position: relative;
        min-width: 0;
        min-height: 0;
        height: 100%;
        max-height: min(68vh, 520px);
        overflow: hidden;
        border-radius: 0 0 17px 0;
      }

      .products-megamenu__panel {
        display: none;
        flex-direction: column;
        height: 100%;
        max-height: min(68vh, 520px);
        padding: 18px 20px 20px;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: thin;
        scrollbar-color: rgba(255, 255, 255, .28) transparent;
      }

      .products-megamenu__panel::-webkit-scrollbar {
        width: 6px;
      }

      .products-megamenu__panel::-webkit-scrollbar-thumb {
        border-radius: 9999px;
        background: rgba(255, 255, 255, .28);
      }

      .products-megamenu__panel.is-active {
        display: flex;
      }

      .products-megamenu__panel-title {
        margin: 0 0 14px;
        font-size: 1rem;
        font-weight: 600;
        color: #fff;
      }

      .products-megamenu__links {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 4px 16px;
        margin: 0;
        padding: 0;
        list-style: none;
      }

      .products-megamenu__links a {
        display: block;
        padding: 7px 0;
        color: #a1a1aa;
        font-size: 0.875rem;
        text-decoration: none;
        transition: color .15s ease;
      }

      .products-megamenu__links a:hover {
        color: #f87171;
      }

      .products-megamenu__group {
        margin-top: 14px;
        padding-top: 12px;
        border-top: 1px solid rgba(255, 255, 255, .08);
      }

      .products-megamenu__group:first-of-type {
        margin-top: 8px;
      }

      .products-megamenu__group-title {
        display: block;
        margin-bottom: 8px;
        color: #fff;
        font-size: 0.875rem;
        font-weight: 600;
        text-decoration: none;
      }

      .products-megamenu__group-title:hover {
        color: #f87171;
      }

      .products-megamenu__nested {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        margin: 0;
        padding: 0;
        list-style: none;
      }

      .products-megamenu__nested a {
        display: inline-flex;
        align-items: center;
        padding: 5px 10px;
        border: 1px solid rgba(255, 255, 255, .1);
        border-radius: 9999px;
        background: rgba(255, 255, 255, .03);
        color: #a1a1aa;
        font-size: 0.75rem;
        text-decoration: none;
        transition: border-color .15s ease, color .15s ease, background .15s ease;
      }

      .products-megamenu__nested a:hover {
        border-color: rgba(239, 68, 68, .45);
        background: rgba(239, 68, 68, .1);
        color: #fff;
      }
    }

    @media (max-width: 1023px) {
      header {
        margin: 0 !important;
        border: 0 !important;
        border-bottom: 1px solid rgba(255, 255, 255, .1) !important;
        border-radius: 0 !important;
        background: #17181a !important;
        box-shadow: none !important;
        overflow: visible !important;
      }

      .header-promo {
        border-radius: 0 !important;
      }

      .header-main {
        position: relative !important;
        display: grid !important;
        min-height: 0 !important;
        grid-template-columns: 80px minmax(0, 1fr) 80px !important;
        grid-template-areas:
          "menu logo actions"
          "search search search" !important;
        align-items: center !important;
        gap: 8px !important;
        padding-block: 10px 8px !important;
      }

      .mobile-menu-button {
        display: grid;
        grid-area: menu;
        width: 36px;
        height: 36px;
        place-items: center;
        justify-self: start;
        margin: 0;
        border: 1px solid rgba(255, 255, 255, .1);
        border-radius: 9999px;
        background: rgba(255, 255, 255, .05);
        color: #f4f4f5;
        transition: background .2s ease, border-color .2s ease;
      }

      .mobile-menu-button:hover,
      .mobile-menu-button[aria-expanded="true"] {
        border-color: rgba(239, 68, 68, .55);
        background: rgba(239, 68, 68, .12);
      }

      .header-main > a {
        grid-area: logo !important;
        width: auto !important;
        max-width: 100% !important;
        justify-self: center !important;
      }

      .header-main > a img {
        width: auto !important;
        height: 42px !important;
        max-width: 128px !important;
      }

      .header-main > .header-actions {
        grid-area: actions !important;
        justify-self: end !important;
        gap: 0 !important;
        margin: 0;
      }

      .header-main > .header-actions button {
        width: 27px !important;
        height: 32px !important;
      }

      .mobile-menu-button svg,
      .header-main > .header-actions button > svg,
      .header-main > .header-actions button > img {
        width: 17px !important;
        height: 17px !important;
      }

      .header-main > .header-actions button[aria-label="Количка"] > svg {
        width: 19px !important;
        height: 19px !important;
      }

      .header-main > .header-actions .header-action-count {
        top: calc(50% - 8.5px) !important;
        right: calc(50% - 8.5px) !important;
        min-width: 12px !important;
        height: 12px !important;
        font-size: 8px !important;
        padding: 0 2px !important;
        transform: translate(40%, -40%) !important;
      }

      .header-main > label,
      .header-main > form {
        grid-area: search !important;
        width: 100% !important;
        max-width: none !important;
        height: 36px !important;
        margin: 0 !important;
        padding-inline: 14px !important;
        gap: 10px !important;
      }

      .header-main > label svg,
      .header-main > form svg {
        width: 16px !important;
        height: 16px !important;
      }

      .header-main > label input,
      .header-main > form input {
        font-size: 13px !important;
      }

      .header-main > nav {
        position: absolute !important;
        top: 100%;
        left: 0;
        right: 0;
        z-index: 80;
        display: flex !important;
        width: 100% !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0 !important;
        max-height: 0;
        opacity: 0;
        overflow: hidden !important;
        margin: 0 !important;
        padding: 0 12px !important;
        border-bottom: 1px solid rgba(255, 255, 255, .1);
        background: #17181a;
        box-shadow: 0 18px 40px rgba(0, 0, 0, .45);
        pointer-events: none;
        transition:
          max-height .4s cubic-bezier(.4, 0, .2, 1),
          opacity .28s ease,
          padding .35s ease,
          gap .35s ease;
      }

      header.mobile-menu-open .header-main > nav {
        max-height: min(70vh, 560px);
        opacity: 1;
        padding: 10px 12px 14px !important;
        gap: 6px !important;
        overflow-y: auto !important;
        pointer-events: auto;
      }

      .nav-desktop-only {
        display: none !important;
      }

      .nav-row {
        display: flex !important;
        width: 100% !important;
        min-height: 48px !important;
        align-items: center !important;
        gap: 12px !important;
        padding: 12px 14px !important;
        border: 1px solid rgba(255, 255, 255, .08);
        border-radius: 14px !important;
        background: rgba(255, 255, 255, .04);
        color: #f4f4f5 !important;
        text-align: left !important;
        white-space: nowrap !important;
      }

      .nav-row.nav-promo,
      .nav-row.electric-promo {
        color: #f4f4f5 !important;
        border: 0 !important;
        background: transparent !important;
        overflow: visible !important;
      }

      .nav-icon {
        display: grid !important;
        width: 20px;
        height: 20px;
        flex-shrink: 0;
        place-items: center;
        color: #fff;
      }

      .nav-icon svg {
        width: 20px;
        height: 20px;
      }

      .nav-label {
        flex: 1;
        text-align: left;
      }

      .nav-chevron {
        display: grid !important;
        width: 16px;
        height: 16px;
        flex-shrink: 0;
        place-items: center;
        color: #fff;
        transition: transform .35s cubic-bezier(.4, 0, .2, 1);
      }

      .nav-chevron svg {
        width: 16px;
        height: 16px;
      }

      .nav-products.is-open .nav-chevron {
        transform: rotate(180deg);
      }

      .nav-submenu {
        display: flex !important;
        flex-direction: column;
        gap: 0;
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        padding: 0 0 0 12px;
        pointer-events: none;
        transition:
          max-height .4s cubic-bezier(.4, 0, .2, 1),
          opacity .25s ease,
          padding .35s ease,
          gap .3s ease;
      }

      .nav-products.is-open .nav-submenu {
        max-height: 4000px;
        opacity: 1;
        padding: 4px 0 8px 12px;
        gap: 4px;
        pointer-events: auto;
      }

      .products-megamenu {
        display: none !important;
      }

      .nav-submenu-group {
        display: flex;
        flex-direction: column;
        gap: 0;
      }

      .nav-submenu-toggle {
        display: flex;
        width: 100%;
        min-height: 48px;
        align-items: center;
        gap: 10px;
        padding: 8px 12px;
        border: 0;
        border-radius: 12px;
        background: transparent;
        color: #e4e4e7;
        font: inherit;
        font-size: 0.875rem;
        font-weight: 500;
        text-align: left;
        cursor: var(--cursor-click);
        position: relative;
      }

      .nav-submenu-leaf {
        display: flex;
        width: 100%;
        min-height: 48px;
        align-items: center;
        gap: 10px;
        padding: 8px 12px;
        border-radius: 12px;
        color: #e4e4e7;
        font-size: 0.875rem;
        font-weight: 500;
        text-decoration: none;
      }

      .nav-submenu-toggle:hover,
      .nav-submenu-group.is-open > .nav-submenu-toggle,
      .nav-submenu-leaf:hover {
        background: rgba(255, 255, 255, .05);
        color: #fff;
      }

      .nav-submenu-thumb {
        width: 36px;
        height: 36px;
        flex-shrink: 0;
        overflow: hidden;
        border-radius: 8px;
        background: #27272a;
      }

      .nav-submenu-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
      }

      .nav-submenu-toggle-label {
        flex: 1;
        line-height: 1.25;
      }

      .nav-submenu-chevron {
        display: grid;
        width: 14px;
        height: 14px;
        flex-shrink: 0;
        place-items: center;
        color: #a1a1aa;
        transition: transform .3s ease;
      }

      .nav-submenu-chevron svg {
        width: 14px;
        height: 14px;
      }

      .nav-submenu-group.is-open > .nav-submenu-toggle .nav-submenu-chevron {
        transform: rotate(180deg);
        color: #f87171;
      }

      .nav-submenu-panel {
        display: flex;
        flex-direction: column;
        gap: 0;
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        padding: 0 0 0 10px;
        pointer-events: none;
        transition:
          max-height .35s cubic-bezier(.4, 0, .2, 1),
          opacity .22s ease,
          padding .3s ease;
      }

      .nav-submenu-group.is-open > .nav-submenu-panel {
        max-height: 2200px;
        opacity: 1;
        padding: 2px 0 6px 10px;
        pointer-events: auto;
      }

      .nav-submenu-panel > a {
        display: flex;
        min-height: 40px;
        align-items: center;
        padding: 8px 12px;
        border-radius: 10px;
        color: #a1a1aa;
        font-size: 0.8125rem;
        text-decoration: none;
        transition: background .2s ease, color .2s ease;
      }

      .nav-submenu-panel > a:hover {
        background: rgba(255, 255, 255, .05);
        color: #fff;
      }

      .nav-submenu-nested {
        margin-top: 4px;
        padding: 8px 0 4px 6px;
        border-left: 1px solid rgba(255, 255, 255, .08);
      }

      .nav-submenu-nested-title {
        padding: 6px 12px 8px;
        color: #fff;
        font-size: 0.75rem;
        font-weight: 600;
        letter-spacing: 0.02em;
      }

      .nav-submenu-nested a {
        display: flex;
        min-height: 36px;
        align-items: center;
        padding: 6px 12px;
        border-radius: 10px;
        color: #a1a1aa;
        font-size: 0.75rem;
        text-decoration: none;
      }

      .nav-submenu-nested a:hover {
        background: rgba(239, 68, 68, .1);
        color: #fff;
      }

      header.mobile-menu-open .header-main > nav {
        max-height: min(78vh, 720px);
      }
    }

    @media (max-width: 359px) {
      .header-main {
        grid-template-columns: 74px minmax(0, 1fr) 74px !important;
        padding-block: 8px 6px !important;
      }

      .header-main > a img {
        height: 38px !important;
        max-width: 112px !important;
      }

      .mobile-menu-button {
        width: 34px !important;
        height: 34px !important;
      }

      .header-main > .header-actions button {
        width: 26px !important;
        height: 30px !important;
      }
    }

    body {
      overflow-x: hidden;
    }

    @media (max-width: 1023px) {
      .header-main > .mh-header-search {
        grid-area: search;
        width: 100%;
        max-width: none;
        margin: 0;
      }

      .header-main > .mh-header-search form {
        width: 100%;
        max-width: none;
        height: 36px;
        gap: 10px;
        margin: 0;
        padding-inline: 14px;
      }

      .header-main > .mh-header-search svg {
        width: 16px;
        height: 16px;
      }

      .header-main > .mh-header-search input {
        font-size: 13px;
      }
    }

    .header-promo {
      display: none !important;
    }

    .header-main > label,
    .header-main > form,
    .header-main > .mh-header-search form {
      border-color: rgba(255, 255, 255, .1) !important;
    }

    .header-main > label:focus-within,
    .header-main > form:focus-within,
    .header-main > .mh-header-search form:focus-within {
      border-color: rgba(239, 68, 68, .6) !important;
    }

    header.site-header {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      z-index: 50;
      width: 100%;
      max-width: none;
      margin: 0 !important;
      border: 0;
      border-bottom: 1px solid rgba(255, 255, 255, .1);
      border-radius: 0;
      background: #18191b;
      box-shadow: none;
      transform: none;
      transition: box-shadow .3s ease;
    }

    header.site-header.header-scrolled {
      box-shadow: 0 10px 28px rgba(0, 0, 0, .28);
    }

    .header-main {
      width: 100%;
      max-width: var(--page-max);
      margin-inline: auto;
      padding-inline: var(--page-gutter);
      box-sizing: border-box;
    }

    body.admin-bar header.site-header {
      top: 32px;
    }

    @media (max-width: 782px) {
      body.admin-bar header.site-header {
        top: 46px;
      }
    }
