.hshmcn-wrap,
.hshmcn-wrap *,
.hshmcn-wrap *::before,
.hshmcn-wrap *::after {
    box-sizing: border-box;
}

.hshmcn-wrap {
    position: fixed;
    --hshmcn-bottom: 12px;
    --hshmcn-x: 0px;
    --hshmcn-y: 0px;
    --hshmcn-side-gap: 8px;
    left: 50%;
    bottom: var(--hshmcn-bottom);
    display: flex;
    justify-content: center;
    width: 100%;
    max-width: 100vw;
    max-width: 100dvw;
    padding-inline: var(--hshmcn-side-gap);
    transform: translateX(calc(-50% + var(--hshmcn-x))) translateY(var(--hshmcn-y));
    isolation: isolate;
    pointer-events: none;
    font-family: inherit;
}

/* در حالت تشخیص واقعی، قبل از اجرای JS هیچ فلش اشتباهی روی دسکتاپ دیده نمی‌شود. */
.hshmcn-wrap[data-device-guard="1"]:not(.hshmcn-device-ready) {
    visibility: hidden;
}

.hshmcn-wrap[data-device-guard="1"].hshmcn-device-ready:not(.hshmcn-device-visible) {
    display: none !important;
}

.hshmcn-wrap.hshmcn-safe-area {
    bottom: calc(var(--hshmcn-bottom) + env(safe-area-inset-bottom, 0px));
}

.hshmcn-nav {
    --hshmcn-width: 380px;
    --hshmcn-height: 68px;
    --hshmcn-radius: 20px;
    --hshmcn-notch: 34px;
    --hshmcn-bg: rgba(255,255,255,.86);
    --hshmcn-bg-grad-1: rgba(255,255,255,.90);
    --hshmcn-bg-grad-2: rgba(220,235,255,.72);
    --hshmcn-bg-grad-angle: 135deg;
    --hshmcn-blur: 16px;
    --hshmcn-saturation: 140%;
    --hshmcn-border-width: 1px;
    --hshmcn-border: rgba(255,255,255,.34);
    --hshmcn-shadow-color: rgba(18,24,40,.16);
    --hshmcn-shadow-blur: 28px;
    --hshmcn-shadow-y: 12px;
    --hshmcn-center-size: 48px;
    --hshmcn-center-top: -22px;
    --hshmcn-center-bg: #1da1fa;
    --hshmcn-center-grad-1: #1da1fa;
    --hshmcn-center-grad-2: #725cff;
    --hshmcn-center-grad-angle: 135deg;
    --hshmcn-center-bg-hover: #148ddc;
    --hshmcn-center-icon: #fff;
    --hshmcn-center-shadow: rgba(29,161,250,.38);
    --hshmcn-center-shadow-blur: 18px;
    --hshmcn-center-rotation: 90deg;
    --hshmcn-action-size: 42px;
    --hshmcn-action-radius: 82px;
    --hshmcn-actions-origin-x: 0px;
    --hshmcn-actions-origin-y: 0px;
    --hshmcn-effective-height: var(--hshmcn-height);
    --hshmcn-effective-notch: var(--hshmcn-notch);
    --hshmcn-effective-center-size: var(--hshmcn-center-size);
    --hshmcn-effective-center-top: var(--hshmcn-center-top);
    --hshmcn-effective-action-size: var(--hshmcn-action-size);
    --hshmcn-action-bg: #3c1402;
    --hshmcn-action-grad-1: #3c1402;
    --hshmcn-action-grad-2: #8c3d12;
    --hshmcn-action-grad-angle: 135deg;
    --hshmcn-action-bg-hover: #562006;
    --hshmcn-action-icon: #fff;
    --hshmcn-action-border-width: 0px;
    --hshmcn-action-border: rgba(255,255,255,.20);
    --hshmcn-action-shadow: rgba(0,0,0,.18);
    --hshmcn-action-shadow-blur: 14px;
    --hshmcn-action-label-bg: rgba(0,0,0,.42);
    --hshmcn-action-label-color: #fff;
    --hshmcn-duration: 430ms;
    --hshmcn-stagger: 45ms;
    --hshmcn-hover-lift: 3px;
    position: relative;
    width: var(--hshmcn-width);
    max-width: calc(100vw - (var(--hshmcn-side-gap) * 2));
    max-width: calc(100dvw - (var(--hshmcn-side-gap) * 2));
    height: var(--hshmcn-effective-height);
    min-width: 0;
    pointer-events: auto;
    color: inherit;
    -webkit-tap-highlight-color: transparent;
}

.hshmcn-shell {
    position: absolute;
    inset: 0;
    border-radius: var(--hshmcn-radius);
    background: var(--hshmcn-bg);
    border: var(--hshmcn-border-width) solid var(--hshmcn-border);
    box-shadow: 0 var(--hshmcn-shadow-y) var(--hshmcn-shadow-blur) var(--hshmcn-shadow-color);
    overflow: hidden;
    pointer-events: none;
}

.hshmcn-bg-glass .hshmcn-shell {
    -webkit-backdrop-filter: blur(var(--hshmcn-blur)) saturate(var(--hshmcn-saturation));
    backdrop-filter: blur(var(--hshmcn-blur)) saturate(var(--hshmcn-saturation));
}

.hshmcn-bg-solid .hshmcn-shell {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

.hshmcn-bg-transparent .hshmcn-shell {
    background: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

.hshmcn-bg-fill-gradient:not(.hshmcn-bg-transparent) .hshmcn-shell {
    background: linear-gradient(var(--hshmcn-bg-grad-angle), var(--hshmcn-bg-grad-1), var(--hshmcn-bg-grad-2));
}

@supports ((-webkit-mask-image: radial-gradient(circle, #000 0, #000 1px)) or (mask-image: radial-gradient(circle, #000 0, #000 1px))) {
    .hshmcn-shell {
        -webkit-mask-image: radial-gradient(circle at 50% 0, transparent 0 var(--hshmcn-effective-notch), #000 calc(var(--hshmcn-effective-notch) + 1px));
        mask-image: radial-gradient(circle at 50% 0, transparent 0 var(--hshmcn-effective-notch), #000 calc(var(--hshmcn-effective-notch) + 1px));
    }
}

.hshmcn-main {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1fr) calc(var(--hshmcn-effective-notch) * 2 + 10px) minmax(0, 1fr);
    align-items: center;
    width: 100%;
    height: 100%;
    direction: ltr;
}

.hshmcn-item {
    --hshmcn-item-color: #9a9a9a;
    --hshmcn-active-color: #1da1fa;
    --hshmcn-hover-color: #1da1fa;
    --hshmcn-item-gap: 7px;
    --hshmcn-item-x: 0px;
    --hshmcn-item-y: 0px;
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: var(--hshmcn-item-gap);
    min-width: 0;
    width: 100%;
    height: 100%;
    padding: 6px 7px;
    color: var(--hshmcn-item-color);
    text-decoration: none !important;
    transform: translate(var(--hshmcn-item-x), var(--hshmcn-item-y));
    transition: color 180ms ease, transform 180ms ease, opacity 180ms ease;
    outline: none;
    direction: rtl;
}

.hshmcn-item--left {
    grid-column: 1;
}

.hshmcn-center-spacer {
    grid-column: 2;
}

.hshmcn-item--right {
    grid-column: 3;
}

.hshmcn-item:hover,
.hshmcn-item:focus-visible {
    color: var(--hshmcn-hover-color);
}

.hshmcn-item:hover {
    transform: translate(var(--hshmcn-item-x), calc(var(--hshmcn-item-y) - var(--hshmcn-hover-lift)));
}

.hshmcn-item.is-active {
    color: var(--hshmcn-active-color);
}

.hshmcn-item__icon,
.hshmcn-item__icon i,
.hshmcn-item__icon svg {
    display: block;
    color: currentColor;
    fill: currentColor;
    stroke: currentColor;
}

.hshmcn-item__icon {
    line-height: 1;
    flex: 0 0 auto;
}

.hshmcn-item__label {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: currentColor;
    line-height: 1.25;
    text-align: center;
}

.hshmcn-center {
    position: absolute;
    z-index: 6;
    top: var(--hshmcn-effective-center-top);
    left: 50%;
    display: grid;
    place-items: center;
    width: var(--hshmcn-effective-center-size);
    height: var(--hshmcn-effective-center-size);
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--hshmcn-center-bg);
    color: var(--hshmcn-center-icon);
    box-shadow: 0 7px var(--hshmcn-center-shadow-blur) var(--hshmcn-center-shadow);
    transform: translateX(-50%);
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
    transition: background-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
    outline: none;
}

.hshmcn-center-fill-gradient .hshmcn-center {
    background: linear-gradient(var(--hshmcn-center-grad-angle), var(--hshmcn-center-grad-1), var(--hshmcn-center-grad-2));
}

.hshmcn-center:hover,
.hshmcn-center:focus-visible {
    background: var(--hshmcn-center-bg-hover);
}

.hshmcn-center-fill-gradient .hshmcn-center:hover,
.hshmcn-center-fill-gradient .hshmcn-center:focus-visible {
    filter: brightness(.94);
    background: linear-gradient(var(--hshmcn-center-grad-angle), var(--hshmcn-center-grad-1), var(--hshmcn-center-grad-2));
}

.hshmcn-center:hover {
    transform: translateX(-50%) translateY(calc(var(--hshmcn-hover-lift) * -1));
}

.hshmcn-center:focus-visible {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--hshmcn-center-bg) 34%, transparent), 0 7px var(--hshmcn-center-shadow-blur) var(--hshmcn-center-shadow);
}

.hshmcn-center__icon {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    line-height: 1;
    transition: opacity 200ms ease, transform var(--hshmcn-duration) ease;
    transform-origin: center;
}

.hshmcn-center__icon i,
.hshmcn-center__icon svg {
    display: block;
    color: currentColor;
    fill: currentColor;
}

.hshmcn-center__icon--open {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.hshmcn-center__icon--close {
    opacity: 0;
    transform: rotate(-45deg) scale(.72);
}

.hshmcn-nav.is-open .hshmcn-center__icon--open {
    opacity: 0;
    transform: rotate(var(--hshmcn-center-rotation)) scale(.72);
}

.hshmcn-nav.is-open .hshmcn-center__icon--close {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.hshmcn-nav:not(.hshmcn-rotate-center) .hshmcn-center__icon {
    transform: none !important;
}

.hshmcn-actions {
    position: absolute;
    z-index: 5;
    /* Exact geometric center of the main button: all action circles originate here. */
    top: calc(var(--hshmcn-effective-center-top) + (var(--hshmcn-effective-center-size) / 2) + var(--hshmcn-actions-origin-y));
    left: calc(50% + var(--hshmcn-actions-origin-x));
    width: 0;
    height: 0;
    pointer-events: none;
}

.hshmcn-action {
    --hshmcn-action-x: 0px;
    --hshmcn-action-y: 0px;
    --hshmcn-action-index: 0;
    --hshmcn-action-custom-bg: var(--hshmcn-action-bg);
    --hshmcn-action-custom-icon: var(--hshmcn-action-icon);
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    width: var(--hshmcn-effective-action-size);
    height: var(--hshmcn-effective-action-size);
    color: var(--hshmcn-action-custom-icon);
    text-decoration: none !important;
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -50%) scale(.54);
    transform-origin: center;
    transition-property: transform, opacity, visibility;
    transition-duration: var(--hshmcn-duration), calc(var(--hshmcn-duration) * .72), 0s;
    transition-delay: 0s, 0s, var(--hshmcn-duration);
    outline: none;
    will-change: auto;
    direction: rtl;
}

.hshmcn-action-fill-gradient .hshmcn-action {
    --hshmcn-action-custom-bg: linear-gradient(var(--hshmcn-action-grad-angle), var(--hshmcn-action-grad-1), var(--hshmcn-action-grad-2));
}

.hshmcn-action__circle {
    display: grid;
    place-items: center;
    width: var(--hshmcn-effective-action-size);
    height: var(--hshmcn-effective-action-size);
    flex: 0 0 var(--hshmcn-effective-action-size);
    border: var(--hshmcn-action-border-width) solid var(--hshmcn-action-border);
    border-radius: 50%;
    background: var(--hshmcn-action-custom-bg);
    color: var(--hshmcn-action-custom-icon);
    box-shadow: 0 6px var(--hshmcn-action-shadow-blur) var(--hshmcn-action-shadow);
    transition: background-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.hshmcn-action:hover .hshmcn-action__circle,
.hshmcn-action:focus-visible .hshmcn-action__circle {
    background: var(--hshmcn-action-bg-hover);
}

.hshmcn-action-fill-gradient .hshmcn-action:hover .hshmcn-action__circle,
.hshmcn-action-fill-gradient .hshmcn-action:focus-visible .hshmcn-action__circle {
    background: var(--hshmcn-action-custom-bg);
    filter: brightness(.94);
}

.hshmcn-action:hover .hshmcn-action__circle {
    transform: translateY(calc(var(--hshmcn-hover-lift) * -1));
}

.hshmcn-action:focus-visible .hshmcn-action__circle {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--hshmcn-action-bg) 30%, transparent), 0 6px var(--hshmcn-action-shadow-blur) var(--hshmcn-action-shadow);
}

.hshmcn-action__icon,
.hshmcn-action__icon i,
.hshmcn-action__icon svg {
    display: block;
    color: currentColor;
    fill: currentColor;
}

.hshmcn-action__icon {
    line-height: 1;
}

.hshmcn-action__label {
    position: absolute;
    top: calc(100% + 5px);
    left: 50%;
    display: none;
    max-width: 110px;
    padding: 3px 6px;
    border-radius: 999px;
    background: var(--hshmcn-action-label-bg);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    color: var(--hshmcn-action-label-color);
    line-height: 1.25;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transform: translateX(-50%);
}

.hshmcn-show-action-labels .hshmcn-action__label {
    display: block;
}

.hshmcn-nav.is-open .hshmcn-actions {
    pointer-events: auto;
}

.hshmcn-nav.is-open .hshmcn-action {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    will-change: transform, opacity;
    transition-delay: calc(var(--hshmcn-action-index) * var(--hshmcn-stagger)), calc(var(--hshmcn-action-index) * var(--hshmcn-stagger)), 0s;
}

.hshmcn-anim-spring .hshmcn-action {
    transition-timing-function: cubic-bezier(.2,.82,.2,1.18), ease, step-end;
}

.hshmcn-anim-spring.is-open .hshmcn-action {
    transform: translate(calc(-50% + var(--hshmcn-action-x)), calc(-50% + var(--hshmcn-action-y))) scale(1);
}

.hshmcn-anim-fade .hshmcn-action {
    transform: translate(-50%, calc(-50% + 16px)) scale(.96);
    transition-timing-function: cubic-bezier(.2,.7,.2,1), ease, step-end;
}

.hshmcn-anim-fade.is-open .hshmcn-action {
    transform: translate(calc(-50% + var(--hshmcn-action-x)), calc(-50% + var(--hshmcn-action-y))) scale(1);
}

.hshmcn-anim-scale .hshmcn-action {
    transform: translate(-50%, -50%) scale(.18);
    transition-timing-function: cubic-bezier(.22,.72,.22,1), ease, step-end;
}

.hshmcn-anim-scale.is-open .hshmcn-action {
    transform: translate(calc(-50% + var(--hshmcn-action-x)), calc(-50% + var(--hshmcn-action-y))) scale(1);
}

.hshmcn-anim-fan .hshmcn-action {
    transform: translate(-50%, -50%) rotate(calc((var(--hshmcn-action-index) + 1) * 10deg)) scale(.45);
    transition-timing-function: cubic-bezier(.16,.78,.18,1.04), ease, step-end;
}

.hshmcn-anim-fan.is-open .hshmcn-action {
    transform: translate(calc(-50% + var(--hshmcn-action-x)), calc(-50% + var(--hshmcn-action-y))) rotate(0) scale(1);
}

.hshmcn-anim-elastic .hshmcn-action {
    transform: translate(-50%, -50%) scale(.3);
    transition-timing-function: cubic-bezier(.18,.89,.32,1.28), ease, step-end;
}

.hshmcn-anim-elastic.is-open .hshmcn-action {
    transform: translate(calc(-50% + var(--hshmcn-action-x)), calc(-50% + var(--hshmcn-action-y))) scale(1);
}

@media (max-width: 767px) {
    .hshmcn-slim-mobile {
        --hshmcn-effective-height: min(var(--hshmcn-height), 64px);
        --hshmcn-effective-notch: min(var(--hshmcn-notch), 31px);
        --hshmcn-effective-center-size: min(var(--hshmcn-center-size), 46px);
        --hshmcn-effective-center-top: max(var(--hshmcn-center-top), -21px);
        --hshmcn-effective-action-size: min(var(--hshmcn-action-size), 40px);
    }

    .hshmcn-hide-mobile {
        display: none !important;
    }

    .hshmcn-nav {
        max-width: calc(100vw - (var(--hshmcn-side-gap) * 2));
        max-width: calc(100dvw - (var(--hshmcn-side-gap) * 2));
    }

    .hshmcn-item {
        padding: 5px 5px;
    }

    .hshmcn-item__label {
        max-width: min(32vw, 118px);
    }
}

@media (max-width: 390px) {
    .hshmcn-main {
        grid-template-columns: minmax(0, 1fr) calc(var(--hshmcn-effective-notch) * 2 + 4px) minmax(0, 1fr);
    }

    .hshmcn-item {
        padding-inline: 3px;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .hshmcn-hide-tablet {
        display: none !important;
    }
}

@media (min-width: 1025px) {
    .hshmcn-hide-desktop {
        display: none !important;
    }
}

/* فقط اگر خود کاربر صراحتاً Preview را روشن کرده باشد در Elementor اجباراً نمایش بده. */
body.elementor-editor-active .hshmcn-wrap[data-editor-preview="1"],
.elementor-editor-active .hshmcn-wrap[data-editor-preview="1"] {
    display: flex !important;
    visibility: visible !important;
}

@media (prefers-reduced-motion: reduce) {
    .hshmcn-wrap *,
    .hshmcn-wrap *::before,
    .hshmcn-wrap *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.001ms !important;
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
    }
}
