:root {
    --header-text: #070707;
    --header-muted: #6f6f76;
    --header-border: #ececec;
    --header-accent: #f03b46;
    --header-top-start: #3349a7;
    --header-top-end: #ff2222;
    --header-pill: #ff5c5c;
    --header-badge: #e8ec00;
    --header-surface: #ffffff;
    --header-shadow: 0 16px 38px rgba(17, 17, 32, 0.1);
    --header-radius: 20px;
    --container-width: 1200px;
}

.theme-container {
    width: min(var(--container-width), calc(100% - 48px));
    margin: 0 auto;
}

.site-main {
    min-height: calc(100vh - 180px);
}

.site-header {
    z-index: 1000;
    background: var(--header-surface);
}

.header-topbar {
    background: linear-gradient(90deg, var(--header-top-start) 0%, var(--header-top-end) 100%);
    color: #fff;
}

.header-topbar__inner {
    min-height: 54px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.top-menu-list,
.primary-menu-list,
.mobile-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.top-menu-list {
    display: flex;
    align-items: center;
    gap: 28px;
    flex-wrap: wrap;
}

.top-menu-list a {
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    letter-spacing: -0.01em;
}

.header-topbar__date {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    font-size: 13px;
    white-space: nowrap;
}

.header-topbar__date-label {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--header-pill);
    font-weight: 600;
}

.header-main {
    position: sticky;
    top: 0;
    border-bottom: 1px solid var(--header-border);
    background: var(--header-surface);
    z-index: 1005;
    transition: transform 0.28s ease, box-shadow 0.28s ease;
    will-change: transform;
}

.site-header.is-main-scrolled .header-main {
    box-shadow: 0 10px 24px rgba(17, 17, 32, 0.08);
}

.site-header.is-main-hidden .header-main {
    transform: translateY(-100%);
}

.header-main__inner {
    min-height: 72px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 18px;
}

.site-branding__link {
    display: inline-flex;
    align-items: center;
    color: var(--header-text);
    text-decoration: none;
}

.site-branding__link--logo {
    max-width: 138px;
}

.site-branding__image {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 34px;
}

.site-branding__image--dark {
    display: none;
}

.site-branding__text {
    display: inline-block;
    font-size: clamp(24px, 1.8vw, 34px);
    line-height: 0.92;
    font-weight: 800;
    letter-spacing: -0.055em;
}

.site-branding__dot {
    color: var(--header-accent);
}

.header-navigation {
    position: relative;
    min-width: 0;
}

.primary-menu-list {
    display: flex;
    align-items: center;
    gap: clamp(14px, 1.25vw, 26px);
    flex-wrap: wrap;
    text-transform: capitalize;
}

.primary-menu-list>.menu-item,
.mobile-menu-list>.menu-item {
    position: relative;
}

.primary-menu-list>.menu-item>a,
.mobile-menu-list>.menu-item>a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--header-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.primary-menu-list>.menu-item>a::after,
.mobile-menu-list>.menu-item>a::after {
    content: "\f078";
    font-family: "Font Awesome 7 Free";
    font-weight: 900;
    font-size: 9px;
    transform: translateY(1px);
    opacity: 0;
}

.primary-menu-list>.menu-item.menu-item-has-children>a::after,
.mobile-menu-list>.menu-item.menu-item-has-children>a::after {
    opacity: 1;
}

.primary-menu-list>.current-menu-item>a,
.primary-menu-list>.current-menu-ancestor>a,
.primary-menu-list>.menu-item:hover>a {
    text-decoration: underline;
    text-decoration-color: var(--header-accent);
    text-decoration-thickness: 2px;
    text-underline-offset: 7px;
}

.menu-badge,
.primary-menu-list .menu-item>a em {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 20px;
    padding: 0 7px;
    border-radius: 6px;
    background: var(--header-badge);
    color: #111;
    font-style: normal;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
}

.primary-menu-list .sub-menu {
    position: absolute;
    top: calc(100% + 14px);
    left: -24px;
    min-width: 232px;
    padding: 16px 18px;
    border-radius: var(--header-radius);
    background: #fff;
    box-shadow: var(--header-shadow);
    list-style: none;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.primary-menu-list .sub-menu::before {
    content: "";
    position: absolute;
    inset: -16px 0 auto 0;
    height: 16px;
}

.primary-menu-list .menu-item:hover>.sub-menu,
.primary-menu-list .menu-item:focus-within>.sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.primary-menu-list .sub-menu li+li {
    margin-top: 12px;
}

.primary-menu-list .sub-menu a {
    color: var(--header-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
}

.primary-menu-list>.menu-item.menu-item-has-mega-menu {
    position: static;
}

.mega-menu-panel {
    position: absolute;
    top: calc(100% + 14px);
    left: 0;
    width: min(100%, 100%);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    z-index: 20;
}

.primary-menu-list>.menu-item:hover>.mega-menu-panel,
.primary-menu-list>.menu-item:focus-within>.mega-menu-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mega-menu-panel__inner {
    display: grid;
    grid-template-columns: 228px minmax(0, 1fr);
    min-height: 408px;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 16px 38px rgba(17, 17, 32, 0.1);
    overflow: hidden;
}

.mega-menu-panel__inner.is-single-term {
    grid-template-columns: minmax(0, 1fr);
}

.mega-menu-tabs {
    padding: 26px 22px;
    border-right: 1px solid var(--header-border);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mega-menu-tab {
    width: 100%;
    padding: 11px 14px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--header-text);
    text-align: left;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.mega-menu-tab.is-active {
    background: #f5f5f5;
    color: var(--header-accent);
}

.mega-menu-posts {
    padding: 26px 26px 30px;
}

.mega-menu-post-group {
    display: none;
}

.mega-menu-post-group.is-active {
    display: block;
}

.mega-menu-post-page {
    display: none;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.mega-menu-post-page.is-active {
    display: grid;
}

.mega-menu-card {
    min-width: 0;
}

.mega-menu-card__thumb {
    position: relative;
    display: block;
    margin-bottom: 12px;
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
}

.mega-menu-card__image {
    display: block;
    width: 100%;
    aspect-ratio: 1.42;
    object-fit: cover;
}

.mega-menu-card__image--placeholder {
    background: linear-gradient(135deg, #eef1f7 0%, #d6ddeb 100%);
}

.mega-menu-card__tag {
    position: absolute;
    top: 12px;
    left: 12px;
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 13px;
    border-radius: 10px;
    background: #1670f0;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}

.mega-menu-card__title {
    display: block;
    margin-bottom: 8px;
    color: var(--header-text);
    text-decoration: none;
    font-size: 15px;
    line-height: 1.24;
    letter-spacing: -0.03em;
}

.mega-menu-card__meta {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #5f636d;
    font-size: 12px;
    line-height: 1.45;
    flex-wrap: wrap;
}

.mega-menu-pagination {
    display: flex;
    gap: 8px;
    margin-top: 18px;
}

.mega-menu-pagination__button {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 10px;
    background: #111;
    color: #fff;
    cursor: pointer;
}

.mega-menu-pagination__button.is-disabled {
    background: #8a8a8a;
    cursor: default;
}

.mega-menu-empty {
    color: var(--header-muted);
    font-size: 13px;
}

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

.header-icon-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 0;
    background: transparent;
    color: var(--header-text);
    text-decoration: none;
    cursor: pointer;
    padding: 0;
}

.header-icon-button i {
    font-size: 16px;
}

.header-cart__count {
    position: absolute;
    top: -1px;
    right: -3px;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    background: var(--header-accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.header-menu-toggle {
    display: none;
    width: 36px;
    gap: 4px;
    flex-direction: column;
}

.header-menu-toggle span {
    width: 26px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
}

.header-search-panel {
    position: absolute;
    top: calc(100% + 6px);
    right: 24px;
    width: min(100%, 460px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
    pointer-events: none;
    z-index: 12;
}

.site-header.is-search-open .header-search-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.header-search-form {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 16px 40px rgba(18, 20, 31, 0.12);
}

.header-search-form__input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--header-text);
    font-size: 14px;
}

.header-search-form__input::placeholder {
    color: #444;
}

.header-search-form__button {
    min-width: 88px;
    min-height: 38px;
    border: 0;
    border-radius: 10px;
    background: #ef3f3d;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.header-search-suggestions {
    margin-top: 12px;
    padding: 14px;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 16px 40px rgba(18, 20, 31, 0.12);
}

.header-search-suggestions__list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.header-search-suggestions__item {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    color: #111;
    text-decoration: none;
}

.header-search-suggestions__thumb {
    display: block;
    border-radius: 14px;
    overflow: hidden;
}

.header-search-suggestions__thumb-image,
.header-search-suggestions__thumb-image--placeholder {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
}

.header-search-suggestions__thumb-image {
    object-fit: cover;
}

.header-search-suggestions__thumb-image--placeholder {
    background: linear-gradient(135deg, #ece8dd 0%, #d5c4a9 100%);
}

.header-search-suggestions__copy {
    min-width: 0;
}

.header-search-suggestions__title {
    display: block;
    margin-bottom: 6px;
    font-size: 15px;
    line-height: 1.22;
    letter-spacing: -0.03em;
}

.header-search-suggestions__date,
.header-search-suggestions__empty {
    color: #848690;
    font-size: 13px;
    line-height: 1.45;
}

.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 18, 31, 0.34);
    z-index: 1050;
}

.mobile-menu-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: min(360px, 100%);
    height: 100vh;
    background: #fff;
    z-index: 1060;
    box-shadow: -22px 0 50px rgba(16, 18, 30, 0.18);
    transform: translateX(100%);
    transition: transform 0.25s ease;
    overflow-y: auto;
}

.mobile-menu-panel.is-open {
    transform: translateX(0);
}

.mobile-menu-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid var(--header-border);
}

.mobile-menu-close {
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    font-size: 18px;
    cursor: pointer;
    color: var(--header-text);
}

.mobile-navigation {
    padding: 6px 18px 24px;
}

.mobile-menu-list>.menu-item {
    border-bottom: 1px solid var(--header-border);
}

.mobile-menu-list>.menu-item>a {
    width: 100%;
    justify-content: space-between;
    padding: 16px 0;
    font-size: 14px;
    font-weight: 700;
}

.mobile-menu-list .sub-menu {
    list-style: none;
    margin: 0;
    padding: 0 0 18px;
    display: none;
}

.mobile-menu-list .menu-item.is-open>.sub-menu {
    display: block;
}

.mobile-menu-list .sub-menu li+li {
    margin-top: 16px;
}

.mobile-menu-list .sub-menu a {
    color: var(--header-muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

body.mobile-menu-open {
    overflow: hidden;
}

body[data-theme="dark"] {
    --header-text: #f5f7fb;
    --header-muted: #9aa3b2;
    --header-border: #243041;
    --header-accent: #ff6863;
    --header-top-start: #14203f;
    --header-top-end: #6f1b27;
    --header-pill: rgba(255, 255, 255, 0.12);
    --header-badge: #e8ec00;
    --header-surface: #0f1724;
    --header-shadow: 0 16px 38px rgba(0, 0, 0, 0.34);
}

body[data-theme="dark"] .header-main,
body[data-theme="dark"] .mobile-menu-panel,
body[data-theme="dark"] .primary-menu-list .sub-menu,
body[data-theme="dark"] .mega-menu-panel__inner,
body[data-theme="dark"] .header-search-form,
body[data-theme="dark"] .header-search-suggestions {
    background: #0f1724;
}

body[data-theme="dark"] .mega-menu-tabs {
    border-right-color: var(--header-border);
}

body[data-theme="dark"] .mega-menu-tab.is-active {
    background: rgba(255, 255, 255, 0.08);
}

body[data-theme="dark"] .primary-menu-list .sub-menu a,
body[data-theme="dark"] .mobile-menu-list .sub-menu a,
body[data-theme="dark"] .header-search-form__input,
body[data-theme="dark"] .header-search-suggestions__item,
body[data-theme="dark"] .header-search-suggestions__title,
body[data-theme="dark"] .mega-menu-card__title,
body[data-theme="dark"] .mega-menu-card__meta,
body[data-theme="dark"] .mobile-menu-close,
body[data-theme="dark"] .header-icon-button,
body[data-theme="dark"] .top-menu-list a,
body[data-theme="dark"] .site-branding__link {
    color: var(--header-text);
}

body[data-theme="dark"] .site-branding__image--default {
    display: none;
}

body[data-theme="dark"] .site-branding__image--dark {
    display: block;
}

body[data-theme="dark"] .header-search-suggestions__date,
body[data-theme="dark"] .header-search-suggestions__empty,
body[data-theme="dark"] .mega-menu-empty {
    color: #9aa3b2;
}

body[data-theme="dark"] .header-search-form__button {
    background: var(--header-accent);
}

@media (max-width: 1200px) {
    .header-main__inner {
        grid-template-columns: auto 1fr auto;
        gap: 0;
    }

    .primary-menu-list>.menu-item>a {
        font-size: 13px;
    }

    .header-navigation,
    .mega-menu-panel {
        display: none;
    }
}

@media (max-width: 1024px) {
    .header-menu-toggle {
        display: inline-flex;
    }
}

@media (max-width: 992px) {
    .theme-container {
        width: min(var(--container-width), calc(100% - 32px));
    }

    .header-topbar__inner {
        min-height: 50px;
    }

    .top-menu-list {
        gap: 16px;
    }

    .header-topbar__date {
        font-size: 12px;
    }

    .header-main__inner {
        min-height: 68px;
        grid-template-columns: auto 1fr auto;
    }

    .site-branding__link--logo {
        max-width: 104px;
    }

    .site-branding__image {
        max-height: 28px;
    }

    .site-branding__text {
        font-size: 24px;
    }

    .header-search-panel {
        right: 16px;
        width: min(100%, 420px);
    }

    .header-search-form {
        padding: 14px;
        gap: 10px;
    }

    .header-search-form__input {
        font-size: 13px;
    }

    .header-search-form__button {
        min-width: 78px;
        min-height: 36px;
        font-size: 13px;
    }
}

@media (max-width: 767px) {
    .theme-container {
        width: calc(100% - 24px);
    }

    .header-main__inner {
        min-height: 62px;
    }

    .site-branding__text {
        font-size: 22px;
    }

    .site-branding__link--logo {
        max-width: 92px;
    }

    .site-branding__image {
        max-height: 24px;
    }

    .header-actions {
        gap: 6px;
    }

    .header-icon-button {
        width: 30px;
        height: 30px;
    }

    .header-icon-button i {
        font-size: 15px;
    }

    .header-menu-toggle span {
        width: 22px;
    }

    .header-topbar {
        display: none;
    }

    .header-search-panel {
        right: 12px;
        left: 12px;
        width: auto;
    }

    .header-search-form {
        padding: 10px;
        border-radius: 12px;
    }

    .header-search-form__button {
        min-width: 70px;
        min-height: 34px;
        font-size: 12px;
    }

    .mobile-menu-panel {
        width: min(320px, 100%);
    }
}

.top-menu-list a,
.primary-menu-list>.menu-item>a,
.mobile-menu-list>.menu-item>a,
.header-topbar__date-label,
.header-search-form__button {
    font-weight: 500;
}
