.ns-header {
    --ns-bg: #101820;
    --ns-bg-2: #1f2933;
    --ns-surface: rgba(255, 255, 255, .08);
    --ns-surface-strong: rgba(255, 255, 255, .12);
    --ns-line: rgba(255, 255, 255, .12);
    --ns-white: #fff;
    --ns-muted: rgba(255, 255, 255, .62);
    --ns-accent: #00a046;
    --ns-accent-2: #21c063;
    --ns-accent-light: #6ee7a8;
    --ns-dark: #101820;
    --ns-radius: 22px;

    position: sticky;
    top: 0;
    z-index: 999;
    background:
        radial-gradient(circle at 8% 0%, rgba(0, 160, 70, .18), transparent 26%),
        linear-gradient(180deg, #101820 0%, #0b1118 100%);
    color: var(--ns-white);
    box-shadow: 0 12px 34px rgba(0, 0, 0, .16);
}

.ns-header-container {
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
}

.ns-header-top {
    border-bottom: 1px solid var(--ns-line);
    background: rgba(0, 0, 0, .14);
}

.ns-header-top .ns-header-container {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    min-height: 38px;
    align-items: center;
}

.ns-header-top__left,
.ns-header-top__right {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    color: var(--ns-muted);
    font-size: 13px;
}

.ns-header-top a {
    color: var(--ns-muted);
    text-decoration: none;
    transition: color .22s ease;
}

.ns-header-top a:hover {
    color: var(--ns-accent-light);
}

.ns-header-main {
    padding: 14px 0;
}

.ns-header-main__grid {
    display: grid;
    grid-template-columns: auto auto auto minmax(260px, 1fr) auto;
    gap: 14px;
    align-items: center;
}

.ns-header-logo {
    display: inline-flex;
    align-items: center;
    max-width: 260px;
    min-width: 210px;
    text-decoration: none;
}

.ns-header-logo span {
    display: block;
    width: 100%;
    height: auto;
    max-height: 62px;
    object-fit: contain;
}

.ns-header-burger,
.ns-header-catalog-btn {
    border: 1px solid var(--ns-line);
    background: var(--ns-surface);
    color: var(--ns-white);
    cursor: pointer;
    transition: transform .22s ease, background .22s ease, border-color .22s ease;
}

.ns-header-burger {
    display: none;
    width: 46px;
    height: 46px;
    border-radius: 16px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
}

.ns-header-burger span {
    width: 20px;
    height: 2px;
    border-radius: 99px;
    background: var(--ns-white);
}

.ns-header-catalog-btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 46px;
    padding: 0 16px;
    border-radius: 16px;
    font-size: 15px;
    font-weight: 900;
}

.ns-header-catalog-btn svg,
.ns-header-search svg,
.ns-header-action svg,
.ns-header-cart svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ns-header-catalog-btn:hover,
.ns-header-burger:hover {
    transform: translateY(-2px);
    border-color: rgba(110, 231, 168, .32);
    background: rgba(0, 160, 70, .16);
}

.ns-header-search {
    display: grid;
    grid-template-columns: 1fr 52px;
    min-height: 48px;
    border: 1px solid var(--ns-line);
    border-radius: 18px;
    background: rgba(255, 255, 255, .10);
    overflow: hidden;
    transition: border-color .22s ease, box-shadow .22s ease, background .22s ease;
}

.ns-header-search:focus-within {
    border-color: rgba(110, 231, 168, .46);
    background: rgba(255, 255, 255, .14);
    box-shadow: 0 0 0 4px rgba(0, 160, 70, .16);
}

.ns-header-search input {
    width: 100%;
    border: 0;
    outline: 0;
    padding: 0 16px;
    background: transparent;
    color: var(--ns-white);
    font-size: 14px;
}

.ns-header-search input::placeholder {
    color: rgba(255, 255, 255, .48);
}

.ns-header-search button {
    border: 0;
    background: var(--ns-accent);
    color: #fff;
    cursor: pointer;
    transition: background .22s ease;
}

.ns-header-search button:hover {
    background: var(--ns-accent-2);
}

.ns-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ns-header-action,
.ns-header-cart {
    position: relative;
    display: inline-flex;
    min-width: 54px;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 12px;
    border: 1px solid var(--ns-line);
    border-radius: 16px;
    background: var(--ns-surface);
    color: var(--ns-white);
    text-decoration: none;
    transition: transform .22s ease, background .22s ease, border-color .22s ease;
}

.ns-header-action span,
.ns-header-cart span {
    font-size: 12px;
    font-weight: 800;
}

.ns-header-action:hover,
.ns-header-cart:hover {
    transform: translateY(-2px);
    border-color: rgba(110, 231, 168, .32);
    background: rgba(0, 160, 70, .16);
}

.ns-header-cart {
    background: linear-gradient(135deg, var(--ns-accent), var(--ns-accent-2));
    border-color: transparent;
}

.ns-header-cart strong {
    position: absolute;
    top: -7px;
    right: -7px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #ffcc00;
    color: #101820;
    font-size: 12px;
    font-weight: 950;
}

.ns-header-nav {
    border-top: 1px solid var(--ns-line);
    border-bottom: 1px solid var(--ns-line);
    background: rgba(0, 0, 0, .16);
}

.ns-header-menu {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding: 8px 0;
}

.ns-header-menu a {
    white-space: nowrap;
    padding: 10px 12px;
    border-radius: 12px;
    color: var(--ns-muted);
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
    transition: color .22s ease, background .22s ease;
}

.ns-header-menu a:hover {
    color: var(--ns-accent-light);
    background: rgba(0, 160, 70, .12);
}

.ns-catalog-panel {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    padding: 18px 0;
    background:
        radial-gradient(circle at 10% 0%, rgba(0, 160, 70, .14), transparent 30%),
        linear-gradient(180deg, #101820 0%, #0b1118 100%);
    border-top: 1px solid var(--ns-line);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
}

.ns-header.is-catalog-open .ns-catalog-panel {
    display: block;
}

.ns-catalog-panel__grid {
    display: grid;
    grid-template-columns: 1.15fr 1fr 1fr 1fr;
    gap: 14px;
}

.ns-catalog-card {
    padding: 22px;
    border: 1px solid var(--ns-line);
    border-radius: var(--ns-radius);
    background: rgba(255, 255, 255, .07);
    box-shadow: 0 18px 42px rgba(0, 0, 0, .18);
}

.ns-catalog-card--dark {
    background:
        radial-gradient(circle at top right, rgba(0, 160, 70, .28), transparent 40%),
        linear-gradient(145deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, .04));
}

.ns-catalog-card span {
    display: block;
    margin-bottom: 10px;
    color: var(--ns-accent-light);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.ns-catalog-card h3 {
    margin: 0 0 14px;
    color: var(--ns-white);
    font-size: 20px;
    letter-spacing: -.03em;
}

.ns-catalog-card p {
    margin: 0 0 16px;
    color: var(--ns-muted);
    line-height: 1.6;
}

.ns-catalog-card a {
    display: block;
    padding: 9px 0;
    color: var(--ns-muted);
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
    transition: color .22s ease, transform .22s ease;
}

.ns-catalog-card a:hover {
    color: var(--ns-accent-light);
    transform: translateX(4px);
}

.ns-catalog-contact a {
    display: inline-flex;
    margin-top: 8px;
    padding: 12px 16px;
    border-radius: 999px;
    background: var(--ns-accent);
    color: #fff;
}

.ns-mobile-drawer {
    display: none;
}

.ns-mobile-drawer.is-open {
    display: block;
}

.ns-mobile-drawer__overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, .55);
}

.ns-mobile-drawer__panel {
    position: fixed;
    z-index: 1001;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(390px, 92vw);
    padding: 20px;
    overflow-y: auto;
    background: #101820;
    color: #fff;
    box-shadow: 20px 0 80px rgba(0, 0, 0, .28);
}

.ns-mobile-drawer__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.ns-mobile-drawer__head button {
    width: 42px;
    height: 42px;
    border: 1px solid var(--ns-line);
    border-radius: 14px;
    background: rgba(255, 255, 255, .08);
    color: #fff;
    font-size: 28px;
    cursor: pointer;
}

.ns-mobile-search {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    margin-bottom: 18px;
}

.ns-mobile-search input,
.ns-mobile-search button {
    min-height: 46px;
    border-radius: 14px;
    border: 1px solid var(--ns-line);
}

.ns-mobile-search input {
    padding: 0 14px;
    background: rgba(255, 255, 255, .08);
    color: #fff;
}

.ns-mobile-search button {
    padding: 0 14px;
    background: var(--ns-accent);
    color: #fff;
    font-weight: 900;
}

.ns-mobile-nav {
    display: grid;
    gap: 8px;
}

.ns-mobile-nav a {
    padding: 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, .07);
    color: rgba(255, 255, 255, .78);
    text-decoration: none;
    font-weight: 800;
}

.ns-mobile-nav a:hover {
    background: rgba(0, 160, 70, .16);
    color: var(--ns-accent-light);
}

.ns-mobile-contact {
    display: grid;
    gap: 8px;
    margin-top: 18px;
    padding: 18px;
    border-radius: 18px;
    background:
        radial-gradient(circle at top right, rgba(0, 160, 70, .28), transparent 40%),
        rgba(255, 255, 255, .07);
}

.ns-mobile-contact span {
    color: var(--ns-accent-light);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.ns-mobile-contact a {
    color: #fff;
    text-decoration: none;
    font-weight: 800;
}

body.ns-mobile-lock {
    overflow: hidden;
}

@media (max-width: 1180px) {
    .ns-header-main__grid {
        grid-template-columns: auto auto auto minmax(220px, 1fr) auto;
    }

    .ns-header-action span {
        display: none;
    }
}

@media (max-width: 980px) {

    .ns-header-top,
    .ns-header-nav,
    .ns-header-catalog-btn,
    .ns-header-actions .ns-header-action {
        display: none;
    }

    .ns-header-burger {
        display: inline-flex;
    }

    .ns-header-main__grid {
        grid-template-columns: auto auto 1fr auto;
    }

    .ns-header-search {
        grid-column: 1 / -1;
        order: 10;
    }

    .ns-header-cart span {
        display: none;
    }

    .ns-catalog-panel {
        display: none !important;
    }
}

@media (max-width: 560px) {
    .ns-header-container {
        width: min(100% - 22px, 1240px);
    }

    .ns-header-logo {
        max-width: 190px;
        min-width: 160px;
    }

    .ns-header-logo img {
        max-height: 46px;
    }

    .ns-header-main {
        padding: 10px 0;
    }

    .ns-header-search {
        min-height: 44px;
        border-radius: 15px;
    }
}

/* Header layout fix: більше місця для логотипа і пошуку */

.ns-header-main {
    padding: 18px 0;
}

.ns-header-main__grid {
    grid-template-columns: 300px auto minmax(320px, 1fr) auto;
    gap: 16px;
}

.ns-header-logo {
    max-width: 300px;
    min-width: 260px;
}

.ns-header-logo img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 74px;
    object-fit: contain;
}

.ns-header-catalog-btn {
    min-width: 132px;
}

.ns-header-search {
    min-width: 320px;
}

.ns-header-actions {
    flex-shrink: 0;
}

/* якщо burger прихований на ПК — не займає місце */
.ns-header-burger {
    grid-column: auto;
}

/* планшет */
@media (max-width: 1180px) {
    .ns-header-main__grid {
        grid-template-columns: 260px auto minmax(260px, 1fr) auto;
        gap: 12px;
    }

    .ns-header-logo {
        max-width: 260px;
        min-width: 220px;
    }

    .ns-header-logo img {
        max-height: 66px;
    }
}

/* mobile */
@media (max-width: 980px) {
    .ns-header-main__grid {
        grid-template-columns: 46px minmax(180px, 1fr) auto;
        gap: 12px;
    }

    .ns-header-logo {
        max-width: 240px;
        min-width: 180px;
    }

    .ns-header-logo img {
        max-height: 58px;
    }

    .ns-header-search {
        grid-column: 1 / -1;
        min-width: 0;
    }
}

@media (max-width: 560px) {
    .ns-header-main {
        padding: 12px 0;
    }

    .ns-header-main__grid {
        grid-template-columns: 44px minmax(150px, 1fr) auto;
    }

    .ns-header-logo {
        max-width: 200px;
        min-width: 150px;
    }

    .ns-header-logo img {
        max-height: 50px;
    }
}

.ns-header-action strong.compare-counter,
.ns-header-action strong.ns-compare-count {
    position: absolute;
    top: -7px;
    right: -7px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #ffcc00;
    color: #101820;
    font-size: 12px;
    font-weight: 950;
}
