/* ==========================================================================
   MK Academy — Header & Footer (uses mk-theme.css tokens)
   ========================================================================== */

[dir="rtl"] .mk-site-header .mk-btn__icon,
[dir="rtl"] .mk-site-footer .mk-btn__icon {
    transform: scaleX(-1);
}

.mk-site-header .mk-btn:hover .mk-btn__icon,
.mk-site-footer .mk-btn:hover .mk-btn__icon {
    transform: scaleX(-1) translate(-3px, -3px);
}

/* ==========================================================================
   Header
   ========================================================================== */


.mk-site-header {
    position: relative;
    z-index: 9990;
    width: 100%;
    font-family: var(--mk-font);
    --mk-nav-indicator: #438bff;
    --mk-nav-indicator-end: #2b6fe6;
}

.mk-site-header--sticky {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
}

body.has-mk-top-banner .mk-site-header--sticky {
    top: var(--mk-top-banner-height, 42px);
}

body.admin-bar .mk-site-header--sticky {
    top: 32px;
}

body.admin-bar.has-mk-top-banner .mk-site-header--sticky {
    top: calc(var(--mk-top-banner-height, 42px) + 32px);
}

@media screen and (max-width: 782px) {
    body.admin-bar .mk-site-header--sticky {
        top: 46px;
    }

    body.admin-bar.has-mk-top-banner .mk-site-header--sticky {
        top: calc(var(--mk-top-banner-height, 42px) + 46px);
    }
}

.mk-site-header__progress {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    z-index: 2;
    height: 3px;
    background: transparent;
    opacity: 0;
    transition: opacity var(--mk-duration) var(--mk-ease);
    pointer-events: none;
}

.mk-site-header.is-scrolled .mk-site-header__progress {
    opacity: 1;
}

.mk-site-header__progress-bar {
    display: block;
    width: 0;
    height: 100%;
    background: linear-gradient(
        90deg,
        #F7A48B,
        #e37566
    );
    box-shadow: 0 0 14px rgba(227, 117, 102, 0.42);
    transition: width 0.08s linear;
}

.mk-site-header__shell {
    position: relative;
    transition:
        background var(--mk-duration) var(--mk-ease),
        border-color var(--mk-duration) var(--mk-ease),
        box-shadow var(--mk-duration) var(--mk-ease),
        backdrop-filter var(--mk-duration) var(--mk-ease);
}

.mk-site-header .mk-site-header__shell {
    background: rgba(255, 255, 255, 0.58);
    backdrop-filter: blur(20px) saturate(185%);
    -webkit-backdrop-filter: blur(20px) saturate(185%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.42);
    box-shadow: 0 4px 24px rgba(67, 139, 255, 0.05);
}

html[data-mk-theme="dark"] .mk-site-header .mk-site-header__shell {
    background: rgba(23, 20, 20, 0.52);
    border-bottom-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}

.mk-site-header--sticky .mk-site-header__shell {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(22px) saturate(190%);
    -webkit-backdrop-filter: blur(22px) saturate(190%);
    border-bottom-color: rgba(255, 255, 255, 0.38);
}

html[data-mk-theme="dark"] .mk-site-header--sticky .mk-site-header__shell {
    background: rgba(23, 20, 20, 0.5);
    backdrop-filter: blur(22px) saturate(190%);
    -webkit-backdrop-filter: blur(22px) saturate(190%);
}

.mk-site-header--transparent:not(.is-scrolled) .mk-site-header__shell {
    background: rgba(255, 255, 255, 0.46);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom-color: rgba(255, 255, 255, 0.32);
    box-shadow: none;
}

html[data-mk-theme="dark"] .mk-site-header--transparent:not(.is-scrolled) .mk-site-header__shell {
    background: rgba(23, 20, 20, 0.42);
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

.mk-site-header--transparent.is-scrolled .mk-site-header__shell,
.mk-site-header.is-scrolled .mk-site-header__shell {
    background: rgba(255, 255, 255, 0.62);
    backdrop-filter: blur(26px) saturate(195%);
    -webkit-backdrop-filter: blur(26px) saturate(195%);
    border-bottom-color: rgba(255, 255, 255, 0.45);
    box-shadow: 0 10px 36px rgba(67, 139, 255, 0.08);
}

html[data-mk-theme="dark"] .mk-site-header--transparent.is-scrolled .mk-site-header__shell,
html[data-mk-theme="dark"] .mk-site-header.is-scrolled .mk-site-header__shell {
    background: rgba(23, 20, 20, 0.62);
    backdrop-filter: blur(26px) saturate(195%);
    -webkit-backdrop-filter: blur(26px) saturate(195%);
    border-bottom-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 36px rgba(0, 0, 0, 0.28);
}

.mk-site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: clamp(0.75rem, 2vw, 2rem);
    width: var(--mk-container);
    margin: 0 auto;
    min-height: var(--mk-header-height);
    padding: 0.75rem 0;
}

.mk-site-header--sticky .mk-site-header__inner {
    padding-block: 0.65rem;
}

.mk-site-header__spacer {
    height: var(--mk-header-offset, 76px);
}

/* Logo cluster (RTL: سمت راست) */
.mk-site-header__cluster {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
    flex-shrink: 0;
}

.mk-site-header__brand {
    flex-shrink: 0;
}

.mk-site-header__logo {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    text-decoration: none;
    color: var(--mk-text);
}

.mk-site-header__logo:hover strong,
.mk-site-header__logo:focus-visible strong {
    color: var(--mk-text);
}

.mk-site-header__logo-img {
    display: block;
    max-height: 40px;
    width: auto;
}

.mk-site-header__logo-mark {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    flex-shrink: 0;
    background: #231f20;
    padding: 0;
    box-shadow: none;
}

.mk-site-header__logo-mark::before {
    display: none;
}

.mk-site-header__logo-mark-inner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    background: transparent;
    color: #ffffff;
    font-weight: 900;
    font-size: 0.86rem;
}

.mk-site-header__logo-mark--sm {
    width: 40px;
    height: 40px;
}

.mk-site-header__logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.mk-site-header__logo-text strong {
    font-size: 1.02rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    transition: color var(--mk-duration) var(--mk-ease);
}

.mk-site-header__logo-text small {
    display: none;
}

/* Navigation — کنار لوگو */
.mk-site-header__nav {
    display: flex;
    align-items: center;
    min-width: 0;
}

.mk-site-header__nav-track {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding-bottom: 0.35rem;
}

.mk-site-header__nav-indicator {
    position: absolute;
    bottom: 0;
    right: 0;
    height: 2px;
    width: 0;
    border-radius: 999px;
    background: var(--mk-nav-indicator);
    opacity: 0;
    transition:
        transform 0.35s var(--mk-ease),
        width 0.35s var(--mk-ease),
        opacity 0.2s ease;
    pointer-events: none;
}

.mk-site-header__nav-track.is-ready .mk-site-header__nav-indicator {
    opacity: 1;
}

.mk-site-header__menu,
.mk-fallback-menu {
    display: flex;
    align-items: center;
    gap: 0.05rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.mk-site-header__menu > li,
.mk-fallback-menu > li {
    position: relative;
}

.mk-site-header__menu a,
.mk-fallback-menu a {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.85rem;
    border-radius: 0;
    color: var(--mk-text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.88rem;
    white-space: nowrap;
    transition: color var(--mk-duration) var(--mk-ease);
}

.mk-site-header__menu a:hover,
.mk-site-header__menu a:focus-visible,
.mk-fallback-menu a:hover {
    color: var(--mk-text);
    background: transparent;
}

.mk-site-header__menu .current-menu-item > a,
.mk-site-header__menu .current_page_item > a {
    color: var(--mk-text);
    background: transparent;
    font-weight: 700;
}

.mk-site-header__menu .sub-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 220px;
    margin: 0;
    padding: 0.45rem;
    list-style: none;
    border-radius: var(--mk-radius-sm);
    background: var(--mk-glass);
    backdrop-filter: blur(18px);
    border: 1px solid var(--mk-border);
    box-shadow: var(--mk-shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition:
        opacity var(--mk-duration) var(--mk-ease),
        transform var(--mk-duration) var(--mk-ease),
        visibility var(--mk-duration);
}

.mk-site-header__menu li:hover > .sub-menu,
.mk-site-header__menu li:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mk-site-header__menu .sub-menu a {
    display: block;
    width: 100%;
    border-radius: 8px;
    padding: 0.65rem 0.85rem;
}

/* Inline search — کنار آیکون‌های سمت چپ */
.mk-site-header__search {
    position: relative;
    flex: 0 1 200px;
    width: 200px;
    min-width: 0;
}

.mk-site-header__search-form {
    position: relative;
    display: flex;
    align-items: center;
}

.mk-site-header__search-input {
    position: relative;
    z-index: 1;
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    height: 40px;
    padding: 0 2.5rem 0 1rem !important;
    border: 1px solid rgba(35, 31, 32, 0.08) !important;
    border-radius: 999px;
    background: #ffffff;
    color: var(--mk-text);
    font-family: var(--mk-font);
    font-size: 0.82rem;
    font-weight: 500;
    direction: rtl;
    text-align: right;
    box-shadow: 0 2px 10px rgba(35, 31, 32, 0.04);
    transition:
        border-color var(--mk-duration) var(--mk-ease),
        box-shadow var(--mk-duration) var(--mk-ease),
        background var(--mk-duration) var(--mk-ease);
}

.mk-site-header__search-input::-webkit-search-decoration,
.mk-site-header__search-input::-webkit-search-cancel-button,
.mk-site-header__search-input::-webkit-search-results-button,
.mk-site-header__search-input::-webkit-search-results-decoration {
    -webkit-appearance: none;
    appearance: none;
    display: none;
}

html[data-mk-theme="dark"] .mk-site-header__search-input {
    background: rgba(255, 255, 255, 0.08);
    color: var(--mk-text);
    border-color: rgba(255, 255, 255, 0.12);
}

html[data-mk-theme="dark"] .mk-site-header__search-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.mk-site-header__search-input::placeholder {
    color: #9ca3af;
}

.mk-site-header__search-input:focus {
    outline: none;
    border-color: rgba(67, 139, 255, 0.45);
    box-shadow:
        0 4px 18px rgba(67, 139, 255, 0.14),
        0 0 0 3px rgba(67, 139, 255, 0.12);
}

.mk-site-header__search-submit {
    position: absolute;
    z-index: 2;
    top: 50%;
    right: 0.4rem;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    transition: color var(--mk-duration) var(--mk-ease);
}

.mk-site-header__search-submit:hover,
.mk-site-header__search-submit:focus-visible {
    color: #438bff;
}

.mk-site-header__search-open {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--mk-border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.82);
    color: var(--mk-text);
    cursor: pointer;
}

.mk-site-header__search-close {
    display: none;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--mk-border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.82);
    color: var(--mk-text);
    cursor: pointer;
}

/* Actions — سمت چپ در RTL */
.mk-site-header__actions {
    display: flex;
    align-items: center;
    gap: clamp(0.55rem, 1.2vw, 1rem);
    flex-shrink: 0;
    margin-inline-start: 0;
}

.mk-site-header__auth {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    white-space: nowrap;
}

.mk-site-header__auth-link {
    color: var(--mk-text);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    transition: color var(--mk-duration) var(--mk-ease);
}

.mk-site-header__auth-link:hover,
.mk-site-header__auth-link:focus-visible {
    color: #438bff;
}

.mk-site-header__auth-sep {
    color: var(--mk-text-faint);
    font-size: 0.82rem;
    font-weight: 400;
    user-select: none;
}

.mk-site-header__notify,
.mk-site-header__actions .mk-theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    min-width: 40px;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #438bff;
    cursor: pointer;
    transition:
        background var(--mk-duration) var(--mk-ease),
        color var(--mk-duration) var(--mk-ease),
        transform var(--mk-duration) var(--mk-ease);
}

.mk-site-header__notify:hover,
.mk-site-header__notify:focus-visible,
.mk-site-header__actions .mk-theme-toggle:hover,
.mk-site-header__actions .mk-theme-toggle:focus-visible {
    background: rgba(67, 139, 255, 0.1);
    color: #2b6fe6;
}

.mk-site-header__actions .mk-theme-toggle {
    color: var(--mk-text-muted);
}

.mk-site-header__actions .mk-theme-toggle:hover,
.mk-site-header__actions .mk-theme-toggle:focus-visible {
    color: var(--mk-text);
    background: rgba(35, 31, 32, 0.06);
}

html[data-mk-theme="dark"] .mk-site-header__actions .mk-theme-toggle:hover,
html[data-mk-theme="dark"] .mk-site-header__actions .mk-theme-toggle:focus-visible {
    background: rgba(255, 255, 255, 0.08);
}

.mk-site-header__notify svg,
.mk-site-header__actions .mk-theme-toggle svg {
    display: block;
}

.mk-mobile-menu__auth {
    display: none;
    gap: 0.65rem;
    width: 100%;
    margin-top: auto;
}

.mk-mobile-menu__auth .mk-btn {
    flex: 1;
}

.mk-site-header__toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--mk-border);
    border-radius: 14px;
    background: var(--mk-theme-toggle-bg);
    color: var(--mk-text);
    cursor: pointer;
}

.mk-site-header__toggle-bar {
    display: block;
    width: 18px;
    height: 2px;
    margin: 0 auto;
    background: currentColor;
    border-radius: 2px;
    transition:
        transform 0.28s var(--mk-ease),
        opacity 0.28s var(--mk-ease);
}

.mk-site-header__toggle.is-active .mk-site-header__toggle-bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mk-site-header__toggle.is-active .mk-site-header__toggle-bar:nth-child(2) {
    opacity: 0;
}

.mk-site-header__toggle.is-active .mk-site-header__toggle-bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Search modal */
.mk-search-modal {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: grid;
    place-items: start center;
    padding: 6rem 1rem 1rem;
}

.mk-search-modal[hidden] {
    display: none;
}

.mk-search-modal.is-open {
    display: grid;
}

.mk-search-modal__backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(2, 6, 23, 0.55);
    backdrop-filter: blur(6px);
    cursor: pointer;
}

html[data-mk-theme="light"] .mk-search-modal__backdrop {
    background: rgba(15, 23, 42, 0.35);
}

.mk-search-modal__panel {
    position: relative;
    z-index: 1;
    width: min(640px, 100%);
    padding: 1.35rem;
    border-radius: calc(var(--mk-radius) + 4px);
    box-shadow: var(--mk-shadow);
}

.mk-search-modal__close {
    position: absolute;
    top: 0.85rem;
    left: 0.85rem;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 10px;
    background: var(--mk-accent-soft);
    color: var(--mk-text);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.mk-search-modal__form {
    display: flex;
    gap: 0.65rem;
}

.mk-search-modal__input {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
    min-width: 0;
    padding: 0.9rem 1rem;
    border: 1px solid var(--mk-border);
    border-radius: 14px;
    background: var(--mk-surface);
    color: var(--mk-text);
    font-family: var(--mk-font);
    font-size: 0.95rem;
    direction: rtl;
    text-align: right;
}

.mk-search-modal__input::-webkit-search-decoration,
.mk-search-modal__input::-webkit-search-cancel-button,
.mk-search-modal__input::-webkit-search-results-button,
.mk-search-modal__input::-webkit-search-results-decoration {
    -webkit-appearance: none;
    appearance: none;
    display: none;
}

.mk-search-modal__input:focus {
    outline: none;
    border-color: var(--mk-border-strong);
    box-shadow: 0 0 0 3px var(--mk-accent-soft);
}

body.mk-search-open {
    overflow: hidden;
}

/* Mobile menu */
.mk-mobile-menu {
    position: fixed;
    inset: 0;
    z-index: 10040;
}

.mk-mobile-menu[hidden] {
    display: none;
}

.mk-mobile-menu.is-opening .mk-mobile-menu__panel,
.mk-mobile-menu.is-open .mk-mobile-menu__panel {
    transform: translateX(0);
}

.mk-mobile-menu.is-opening .mk-mobile-menu__backdrop,
.mk-mobile-menu.is-open .mk-mobile-menu__backdrop {
    opacity: 1;
}

.mk-mobile-menu__backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: rgba(2, 6, 23, 0.72);
    backdrop-filter: blur(4px);
    cursor: pointer;
    opacity: 0;
    transition: opacity var(--mk-duration) var(--mk-ease);
}

html[data-mk-theme="light"] .mk-mobile-menu__backdrop {
    background: rgba(15, 23, 42, 0.35);
}

.mk-mobile-menu__panel {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: min(380px, 88vw);
    height: 100%;
    padding: 1.35rem 1.2rem calc(1.35rem + env(safe-area-inset-bottom, 0px));
    background:
        radial-gradient(
            135% 55% at 100% 0%,
            var(--mk-accent-soft),
            transparent 58%
        ),
        var(--mk-bg-elevated, var(--mk-page-bg));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-left: 1px solid var(--mk-border-strong);
    box-shadow: -30px 0 90px rgba(2, 6, 23, 0.5);
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.42s var(--mk-ease);
}

.mk-mobile-menu__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--mk-border);
}

.mk-mobile-menu__brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--mk-text);
}

.mk-mobile-menu__brand strong {
    display: block;
    font-size: 0.98rem;
}

.mk-mobile-menu__brand small {
    display: block;
    color: var(--mk-text-muted);
    font-size: 0.76rem;
}

.mk-mobile-menu__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--mk-border);
    border-radius: 12px;
    background: var(--mk-theme-toggle-bg);
    color: var(--mk-text);
    cursor: pointer;
}

.mk-mobile-menu__search {
    display: none;
    width: 100%;
    margin-bottom: 1rem;
}

@media (max-width: 1024px) {
    .mk-mobile-menu__search {
        display: inline-flex;
    }
}

.mk-mobile-menu__menu,
.mk-mobile-menu__menu ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.mk-mobile-menu__menu {
    display: block;
    width: 100%;
}

.mk-mobile-menu__menu > li {
    border-bottom: 0;
    margin-bottom: 4px;
    width: 100%;
}

.mk-mobile-menu__menu a {
    position: relative;
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 0.9rem 1rem 0.9rem 2.6rem; /* extra left room for the chevron */
    border-radius: 14px;
    color: var(--mk-text);
    text-decoration: none;
    font-size: 0.98rem;
    font-weight: 700;
    text-align: right;
    transition:
        background 0.25s var(--mk-ease),
        color 0.25s var(--mk-ease);
}

/* Forward chevron — pinned to the LEFT edge of each row */
.mk-mobile-menu__menu > li > a::after {
    content: "‹";
    position: absolute;
    left: 1.05rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.4rem;
    line-height: 1;
    color: var(--mk-text-faint);
    opacity: 0.6;
    transition:
        opacity 0.25s,
        left 0.25s var(--mk-ease),
        color 0.25s;
}

/* Accent bar on the RIGHT (start) edge for hover/active */
.mk-mobile-menu__menu > li > a::before {
    content: "";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    border-radius: 3px;
    background: var(--mk-nav-indicator, #157a62);
    transition: height 0.25s var(--mk-ease);
}

.mk-mobile-menu__menu a:hover,
.mk-mobile-menu__menu a:focus-visible {
    background: var(--mk-accent-soft);
    color: var(--mk-accent);
}

.mk-mobile-menu__menu > li > a:hover::after {
    opacity: 1;
    color: var(--mk-accent);
    left: 0.8rem;
}

.mk-mobile-menu__menu > li > a:hover::before,
.mk-mobile-menu__menu .current-menu-item > a::before,
.mk-mobile-menu__menu .current_page_item > a::before {
    height: 55%;
}

.mk-mobile-menu__menu .current-menu-item > a,
.mk-mobile-menu__menu .current_page_item > a {
    background: var(--mk-accent-soft);
    color: var(--mk-accent);
}

.mk-mobile-menu__menu .current-menu-item > a::after,
.mk-mobile-menu__menu .current_page_item > a::after {
    opacity: 1;
    color: var(--mk-accent);
}

.mk-mobile-menu__menu .sub-menu {
    margin: 2px 0.5rem 4px;
    padding-inline-start: 0.5rem;
    border-inline-start: 2px solid var(--mk-border);
}

.mk-mobile-menu__menu .sub-menu a {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--mk-text-muted);
}

.mk-mobile-menu__menu .sub-menu a::after,
.mk-mobile-menu__menu .sub-menu a::before {
    content: none;
}

.mk-mobile-menu__cta {
    width: 100%;
    margin-top: auto;
    padding-block: 0.95rem;
    font-size: 0.98rem;
}

.mk-mobile-menu .mk-mobile-menu__cta.mk-btn--accent {
    border-radius: 10px;
    background: #231f20;
    color: #fff;
    box-shadow: 0 8px 20px rgba(35, 31, 32, 0.16);
}

.mk-mobile-menu .mk-mobile-menu__cta.mk-btn--accent:hover,
.mk-mobile-menu .mk-mobile-menu__cta.mk-btn--accent:focus-visible {
    background: #171414;
    color: #fff;
    box-shadow: 0 10px 24px rgba(35, 31, 32, 0.22);
    transform: translateY(-1px);
}

.mk-mobile-menu__social {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.7rem;
    margin: 1.5rem 0 0;
    padding: 1.4rem 0 0;
    border-top: 1px solid var(--mk-border);
    list-style: none;
}

.mk-mobile-menu__theme {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    margin-top: 1.1rem;
    color: var(--mk-text-muted);
    font-size: 0.85rem;
    font-weight: 600;
}

@media (max-width: 1024px) {
    .mk-mobile-menu__theme {
        display: flex;
    }
}

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

.mk-site-footer {
    position: relative;
    margin-top: 0;
    padding: 0;
    background: linear-gradient(180deg, var(--mk-page-bg-alt) 0%, var(--mk-page-bg) 100%);
    color: var(--mk-text);
    font-family: var(--mk-font);
    overflow: visible;
    border-top: 1px solid rgba(156, 156, 156, 0.34);
    box-shadow: none;
}

html[data-mk-theme="light"] .mk-site-footer {
    box-shadow: none;
}

.mk-site-footer__inner {
    position: relative;
    width: var(--mk-container);
    margin: 0 auto;
    padding: clamp(3.2rem, 5.4vw, 4.4rem) 0 clamp(2.8rem, 4.8vw, 3.9rem);
}

.mk-site-footer__grid {
    display: grid;
    grid-template-columns: minmax(250px, 1fr) minmax(118px, 0.34fr) minmax(
            360px,
            1.05fr
        );
    grid-template-areas: "brand links contact";
    gap: clamp(2.2rem, 4.2vw, 4.8rem);
    align-items: start;
    direction: ltr;
    min-height: 190px;
}

.mk-site-footer__contact {
    grid-area: contact;
    justify-self: end;
    max-width: 440px;
    direction: rtl;
    text-align: right;
}

.mk-site-footer__links {
    grid-area: links;
    justify-self: end;
    direction: rtl;
    text-align: right;
}

.mk-site-footer__seo {
    margin-top: 0;
    max-width: 47ch;
}

.mk-site-footer__seo-text {
    margin: 0;
    color: var(--mk-text-muted);
    font-size: 0.81rem;
    font-weight: 500;
    line-height: 2.1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mk-site-footer__seo-text a {
    color: var(--mk-accent, #438bff);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-thickness: 1px;
    -webkit-tap-highlight-color: transparent;
}

.mk-site-footer__seo-text a:visited {
    color: var(--mk-accent, #438bff);
}

.mk-site-footer__seo-text a:hover,
.mk-site-footer__seo-text a:focus,
.mk-site-footer__seo-text a:focus-visible,
.mk-site-footer__seo-text a:active {
    color: var(--mk-accent-strong, #2f6fe8) !important;
    background-color: transparent !important;
    text-decoration: underline;
    text-decoration-thickness: 1px;
}

.mk-site-footer__seo.is-expanded .mk-site-footer__seo-text {
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
}

.mk-site-footer__seo-toggle {
    display: inline-flex;
    align-items: center;
    margin-top: 0.35rem;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: none !important;
    background-color: transparent !important;
    color: var(--mk-accent, #438bff) !important;
    font-family: var(--mk-font);
    font-size: 0.63rem;
    font-weight: 700;
    line-height: 1.4;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    text-transform: none;
    white-space: nowrap;
    box-shadow: none !important;
    min-height: 0 !important;
}

.mk-site-footer__seo-toggle span {
    color: inherit !important;
    font: inherit;
}

.mk-site-footer__seo-toggle [hidden] {
    display: none !important;
}

.mk-site-footer__seo:not(.is-truncatable):not(.is-expanded)
    .mk-site-footer__seo-toggle {
    display: none;
}

.mk-site-footer__seo-toggle:hover,
.mk-site-footer__seo-toggle:focus,
.mk-site-footer__seo-toggle:focus-visible,
.mk-site-footer__seo-toggle:active {
    background: none !important;
    background-color: transparent !important;
    border: 0 !important;
    border-color: transparent !important;
    color: var(--mk-accent-strong, #2f6fe8) !important;
    text-decoration: underline;
    text-underline-offset: 3px;
    box-shadow: none !important;
    -webkit-tap-highlight-color: transparent;
}

.mk-site-footer__brand {
    grid-area: brand;
    display: grid;
    gap: 1.35rem;
    justify-self: start;
    justify-items: start;
    direction: ltr;
    text-align: left;
}

.mk-site-footer__top-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    min-height: 34px;
    padding: 0.62rem 1.05rem;
    border: 0;
    border-radius: 6px;
    background: var(--mk-bg);
    color: var(--mk-text);
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: var(--mk-shadow-soft);
    transition:
        transform var(--mk-duration) var(--mk-ease),
        background var(--mk-duration) var(--mk-ease);
}

.mk-site-footer__top-button:hover,
.mk-site-footer__top-button:focus-visible {
    background: var(--mk-surface-2);
    border-color: transparent;
    color: var(--mk-text);
    transform: translateY(-2px);
    box-shadow: var(--mk-shadow-soft);
}

.mk-site-footer__top-button span {
    color: #438bff;
    font-size: 0.8rem;
    line-height: 1;
}

.mk-site-footer__links .mk-site-footer__menu,
.mk-site-footer__links .mk-fallback-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mk-site-footer__links .mk-site-footer__menu li,
.mk-site-footer__links .mk-fallback-menu li {
    border-bottom: 0;
}

.mk-site-footer__links .mk-site-footer__menu a,
.mk-site-footer__links .mk-fallback-menu a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.06rem 0;
    color: var(--mk-text-muted);
    font-size: 0.79rem;
    font-weight: 700;
    text-decoration: none;
    transition: color var(--mk-duration) var(--mk-ease);
}

.mk-site-footer__links .mk-site-footer__menu a::after,
.mk-site-footer__links .mk-fallback-menu a::after {
    content: none;
}

.mk-site-footer__links .mk-site-footer__menu a::before,
.mk-site-footer__links .mk-fallback-menu a::before {
    content: "•";
    color: var(--mk-text-faint);
    font-size: 0.86rem;
    line-height: 1;
}

.mk-site-footer__links .mk-site-footer__menu a:hover,
.mk-site-footer__links .mk-site-footer__menu a:focus-visible,
.mk-site-footer__links .mk-fallback-menu a:hover,
.mk-site-footer__links .mk-fallback-menu a:focus-visible {
    color: var(--mk-accent, #438bff);
}

.mk-site-footer__title {
    display: block;
    margin: 0 0 0.65rem;
    font-size: 0.95rem;
    font-weight: 900;
    color: var(--mk-text);
}

.mk-site-footer__title::after {
    content: none;
}

.mk-site-footer__menu,
.mk-site-footer__menu ul,
.mk-site-footer__contact-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.mk-site-footer__contact-list li + li {
    margin-top: 0.32rem;
}

.mk-site-footer__contact-list a,
.mk-site-footer__contact-item--static {
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
    padding: 0.1rem 0;
    color: var(--mk-text-muted);
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 600;
    transition: color var(--mk-duration) var(--mk-ease);
}

.mk-site-footer__contact-list strong {
    font-weight: 800;
}

.mk-site-footer__contact-list a:hover,
.mk-site-footer__contact-list a:focus-visible {
    color: var(--mk-accent, #438bff);
    transform: none;
}

.mk-site-footer__contact-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: rgba(148, 163, 184, 0.08);
    border: 1px solid var(--mk-border);
    color: var(--mk-accent-2);
    flex-shrink: 0;
}

.mk-site-footer__social,
.mk-mobile-menu__social {
    display: flex;
    flex-wrap: wrap;
    gap: 0.88rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.mk-site-footer__social a,
.mk-mobile-menu__social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 0;
    background: transparent;
    border: 0;
    color: var(--mk-text);
    text-decoration: none;
    transition:
        transform var(--mk-duration) var(--mk-ease),
        background var(--mk-duration) var(--mk-ease),
        border-color var(--mk-duration) var(--mk-ease),
        color var(--mk-duration) var(--mk-ease);
}

.mk-site-footer__social a:hover,
.mk-mobile-menu__social a:hover {
    transform: translateY(-2px);
    background: transparent;
    border-color: transparent;
    color: var(--mk-accent, #438bff);
}

.mk-site-footer__social a[data-social="whatsapp"]:hover {
    color: #4ade80;
    background: rgba(74, 222, 128, 0.12);
}
.mk-site-footer__social a[data-social="linkedin"]:hover {
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.12);
}
.mk-site-footer__social a[data-social="telegram"]:hover {
    color: var(--mk-accent);
    background: var(--mk-accent-soft);
}
.mk-site-footer__social a[data-social="instagram"]:hover {
    color: #f472b6;
    background: rgba(244, 114, 182, 0.12);
}
.mk-site-footer__social a[data-social="aparat"]:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.12);
}
.mk-site-footer__social a[data-social="bale"]:hover {
    color: #438bff;
    background: rgba(67, 139, 255, 0.12);
}
.mk-site-footer__social a[data-social="eitaa"]:hover {
    color: #f97316;
    background: rgba(249, 115, 22, 0.12);
}
.mk-site-footer__social a[data-social="rubika"]:hover {
    color: #9333ea;
    background: rgba(147, 51, 234, 0.12);
}

.mk-site-footer__social svg,
.mk-mobile-menu__social svg,
.mk-site-footer__social .mk-social-icon,
.mk-mobile-menu__social .mk-social-icon {
    width: 16px;
    height: 16px;
    display: block;
}

.mk-site-footer__badges {
    display: flex;
    gap: 0.7rem;
    margin-top: 0.95rem;
}

.mk-site-footer__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    border: 1px solid var(--mk-border);
    border-radius: 6px;
    background: var(--mk-surface);
    color: #438bff;
    font-size: 1.21rem;
    font-weight: 900;
    box-shadow: var(--mk-shadow-soft);
}

.mk-site-footer__badge--mark {
    width: 48px;
    font-size: 1.65rem;
    font-family: cursive;
}

.mk-site-footer__badge--enamad img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    padding: 4px;
    object-fit: contain;
}
.mk-site-footer__badge--enamad a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}
.mk-site-footer__badge--text {
    font-size: 0.79rem;
    letter-spacing: 0.02em;
}

.mk-site-footer__bottom {
    background: #231f20;
    color: #fff;
    font-size: 0.75rem;
}

.mk-site-footer__bottom-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: var(--mk-container);
    min-height: 54px;
    margin: 0 auto;
}

.mk-site-footer__bottom p {
    margin: 0;
}

.mk-site-footer__heart {
    color: #438bff;
    animation: mk-heartbeat 1.6s ease infinite;
}

/* Back to top */
.mk-back-to-top {
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    z-index: 999;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: 1px solid var(--mk-border-strong);
    border-radius: 14px;
    background: rgba(10, 16, 30, 0.92);
    backdrop-filter: blur(12px);
    color: var(--mk-accent-2);
    box-shadow: var(--mk-shadow);
    cursor: pointer;
    opacity: 0;
    transform: translateY(12px);
    transition:
        opacity var(--mk-duration) var(--mk-ease),
        transform var(--mk-duration) var(--mk-ease),
        background var(--mk-duration) var(--mk-ease);
}

[dir="rtl"] .mk-back-to-top {
    left: 1.5rem;
    right: auto;
}

.mk-back-to-top.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.mk-back-to-top:hover,
.mk-back-to-top:focus-visible {
    background: var(--mk-accent-soft);
    border-color: var(--mk-border-strong);
    color: var(--mk-accent-2);
    box-shadow: var(--mk-shadow);
}

/* Animations */
@keyframes mk-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes mk-heartbeat {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.12);
    }
}

@keyframes mk-header-search-in {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1200px) {
    .mk-site-header__search {
        width: 170px;
    }

    .mk-site-header__menu a,
    .mk-fallback-menu a {
        padding-inline: 0.6rem;
        font-size: 0.84rem;
    }
}

@media (max-width: 1024px) {
    .mk-site-header__nav {
        display: none;
    }

    .mk-site-header__inner {
        position: relative;
    }

    .mk-site-header__search {
        flex: 0 0 auto;
        width: auto;
        margin-inline: 0;
    }

    .mk-site-header__search-form {
        display: none;
    }

    .mk-site-header__search-open {
        display: inline-flex;
    }

    .mk-site-header.is-search-open .mk-site-header__cluster {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

    .mk-site-header.is-search-open .mk-site-header__actions > :not(.mk-site-header__search) {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

    .mk-site-header.is-search-open .mk-site-header__search {
        position: absolute;
        inset-inline: 0;
        inset-block: 0;
        z-index: 8;
        display: flex;
        align-items: center;
        gap: 0.45rem;
        width: 100%;
        flex: 1 1 auto;
        margin: 0;
        animation: mk-header-search-in 0.28s var(--mk-ease) both;
    }

    .mk-site-header.is-search-open .mk-site-header__search-form {
        display: flex;
        flex: 1;
        min-width: 0;
    }

    .mk-site-header.is-search-open .mk-site-header__search-input {
        height: 38px;
        font-size: 0.84rem;
    }

    .mk-site-header.is-search-open .mk-site-header__search-open {
        display: none;
    }

    .mk-site-header.is-search-open .mk-site-header__search-close {
        display: inline-flex;
        flex-shrink: 0;
    }

    .mk-site-header__inner {
        gap: 0.65rem;
        padding-block: 0.5rem;
    }

    .mk-site-header__cluster {
        flex: 1;
        min-width: 0;
        gap: 0.6rem;
        align-items: center;
    }

    .mk-site-header__auth {
        display: none;
    }

    .mk-site-header__notify {
        display: none;
    }

    .mk-site-header__logo {
        gap: 0.55rem;
        min-width: 0;
    }

    .mk-site-header__logo-text {
        min-width: 0;
    }

    .mk-site-header__logo-text strong {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 10.5rem;
        font-size: 0.88rem;
    }

    .mk-site-header__actions {
        gap: 0.35rem;
        flex-shrink: 0;
    }

    .mk-site-header__notify,
    .mk-site-header__actions .mk-theme-toggle,
    .mk-site-header__search-open,
    .mk-site-header__search-close {
        width: 38px;
        height: 38px;
        min-width: 38px;
        flex: 0 0 38px;
    }

    .mk-site-header__toggle {
        display: inline-flex;
        width: 40px;
        height: 40px;
    }

    .mk-site-header__logo-mark {
        width: 38px;
        height: 38px;
    }

    .mk-site-header__logo-img {
        max-height: 38px;
    }

    .mk-mobile-menu__auth {
        display: flex;
    }

    .mk-mobile-menu__theme {
        display: flex;
    }

    .mk-site-footer__grid {
        grid-template-columns: 1fr 1fr;
    }

    .mk-site-footer__brand {
        grid-column: 1 / -1;
    }

    .mk-site-footer__links {
        grid-column: 1;
    }
}

@media (max-width: 640px) {
    html {
        --mk-header-height: 60px;
    }

    .mk-site-header__inner {
        gap: 0.45rem;
        padding-block: 0.42rem;
    }

    .mk-site-header__logo-text strong {
        max-width: 7.5rem;
        font-size: 0.82rem;
    }

    .mk-site-header__logo-mark {
        width: 36px;
        height: 36px;
    }

    .mk-site-header__logo-mark-inner {
        font-size: 0.78rem;
    }

    .mk-site-header__notify,
    .mk-site-header__actions .mk-theme-toggle,
    .mk-site-header__search-open,
    .mk-site-header__search-close {
        width: 34px;
        height: 34px;
        min-width: 34px;
        flex: 0 0 34px;
    }

    .mk-site-header__toggle {
        width: 38px;
        height: 38px;
    }

    .mk-site-footer__inner {
        padding: 2.5rem 0 2.35rem;
    }

    .mk-site-footer__grid {
        grid-template-columns: 1fr;
        grid-template-areas:
            "contact"
            "links"
            "brand";
        gap: 2rem;
        min-height: 0;
    }

    .mk-site-footer__brand,
    .mk-site-footer__links,
    .mk-site-footer__contact {
        justify-items: start;
        justify-self: stretch;
        text-align: right;
        max-width: none;
    }

    .mk-site-footer__brand {
        direction: rtl;
        text-align: right;
    }

    .mk-site-footer__links .mk-site-footer__menu a,
    .mk-site-footer__links .mk-fallback-menu a {
        padding: 0.5rem 0;
    }

    .mk-site-footer__bottom-inner {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-height: 70px;
        text-align: center;
    }

    .mk-back-to-top {
        bottom: 1rem;
        left: 1rem;
    }

    [dir="rtl"] .mk-back-to-top {
        left: 1rem;
        right: auto;
    }
}

@media (max-width: 400px) {
    .mk-site-header__logo-text {
        display: none;
    }

    .mk-site-header__logo {
        gap: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
