/* ===== نوار شیشه‌ای پایین — موبایل و دسکتاپ ===== */

:root {
    --dock-bar-h: 4.35rem;
    --dock-bar-gap: 0.65rem;
    --dock-bar-offset: calc(var(--dock-bar-h) + var(--dock-bar-gap) + env(safe-area-inset-bottom, 0px));
    --mobile-bar-h: var(--dock-bar-h);
    --mobile-bar-gap: var(--dock-bar-gap);
    --mobile-bar-offset: var(--dock-bar-offset);
}

@media (min-width: 769px) {
    :root {
        --dock-bar-h: 4.75rem;
        --dock-bar-gap: 1rem;
        --dock-bar-offset: calc(var(--dock-bar-h) + var(--dock-bar-gap));
    }
}

/* ─── پایه (همه اندازه‌ها) ─── */
.dock-bar {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 120;
    pointer-events: none;
    padding: 0 clamp(0.65rem, 3vw, 1.25rem) calc(var(--dock-bar-gap) + env(safe-area-inset-bottom, 0px));
}

.dock-bar__shell {
    pointer-events: auto;
    max-width: 28rem;
    margin-inline: auto;
}

.dock-bar__glass {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 0;
    min-height: var(--dock-bar-h);
    padding: 0.45rem 0.35rem 0.4rem;
    border-radius: 22px;
    background: linear-gradient(
        145deg,
        rgba(28, 26, 24, 0.78) 0%,
        rgba(18, 17, 16, 0.62) 100%
    );
    backdrop-filter: blur(22px) saturate(165%);
    -webkit-backdrop-filter: blur(22px) saturate(165%);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.38),
        0 2px 8px rgba(0, 0, 0, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -1px 0 rgba(0, 0, 0, 0.22);
}

.dock-bar__glass::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(
        120% 80% at 50% -20%,
        rgba(239, 108, 0, 0.16) 0%,
        transparent 55%
    );
    pointer-events: none;
}

.dock-bar__side {
    flex: 1 1 0;
    display: flex;
    align-items: flex-end;
    justify-content: space-evenly;
    gap: 0.1rem;
    min-width: 0;
}

.dock-bar__side--start {
    padding-inline-end: 0.15rem;
}

.dock-bar__side--end {
    padding-inline-start: 0.15rem;
}

.dock-bar__item--guide-desktop {
    display: none;
}

.dock-bar__item--guide-mobile {
    display: flex;
}

.dock-bar__item,
.dock-bar__fab {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 0.2rem;
    flex: 1 1 0;
    min-width: 0;
    max-width: 5.5rem;
    padding: 0.2rem 0.15rem 0.05rem;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.58);
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    transition:
        color 0.22s ease,
        transform 0.22s ease,
        background 0.22s ease;
    -webkit-tap-highlight-color: transparent;
}

.dock-bar__item:hover,
.dock-bar__fab:hover {
    color: rgba(255, 255, 255, 0.88);
}

.dock-bar__item:active,
.dock-bar__fab:active {
    transform: scale(0.94);
}

.dock-bar__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 12px;
    transition:
        background 0.22s ease,
        color 0.22s ease,
        box-shadow 0.22s ease;
}

.dock-bar__icon svg {
    width: 1.2rem;
    height: 1.2rem;
}

.dock-bar__label {
    font-size: 0.62rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.dock-bar__item.is-active {
    color: #fff;
}

.dock-bar__item.is-active .dock-bar__icon {
    color: #fff;
    background: rgba(239, 108, 0, 0.22);
    box-shadow:
        0 0 0 1px rgba(239, 108, 0, 0.35),
        0 4px 14px rgba(239, 108, 0, 0.22);
}

.dock-bar__item.is-active .dock-bar__label {
    color: rgba(255, 220, 190, 0.95);
}

.dock-bar__item--call .dock-bar__label {
    font-weight: 700;
    letter-spacing: 0.01em;
}

.dock-bar__item--desktop-only {
    display: none;
}

.dock-bar__label--desktop {
    display: none;
}

/* دکمه مرکزی دستیار */
.dock-bar__fab {
    position: relative;
    flex: 0 0 4.25rem;
    width: 4.25rem;
    margin-top: -1.35rem;
    padding-bottom: 0;
    color: #fff;
    align-self: flex-end;
}

.dock-bar__fab-ring {
    position: absolute;
    top: -0.15rem;
    left: 50%;
    width: 3.35rem;
    height: 3.35rem;
    border-radius: 50%;
    background: conic-gradient(
        from 210deg,
        rgba(239, 108, 0, 0.55),
        rgba(255, 183, 77, 0.35),
        rgba(239, 108, 0, 0.55)
    );
    opacity: 0.85;
    filter: blur(0.5px);
    transform: translateX(-50%);
    animation: dock-bar-pulse 3.5s ease-in-out infinite;
}

.dock-bar__fab-inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: linear-gradient(145deg, #ff8f2a 0%, #ef6c00 48%, #d84315 100%);
    border: 2px solid rgba(255, 255, 255, 0.28);
    box-shadow:
        0 10px 24px rgba(239, 108, 0, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.dock-bar__fab-inner svg {
    width: 1.35rem;
    height: 1.35rem;
}

.dock-bar__label--fab {
    margin-top: 0.15rem;
    color: rgba(255, 220, 190, 0.92);
}

.dock-bar__fab.is-active .dock-bar__fab-inner {
    box-shadow:
        0 0 0 3px rgba(239, 108, 0, 0.28),
        0 10px 24px rgba(239, 108, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

@keyframes dock-bar-pulse {
    0%, 100% { transform: translateX(-50%) scale(1); opacity: 0.75; }
    50% { transform: translateX(-50%) scale(1.06); opacity: 1; }
}

.site-footer {
    padding-bottom: calc(1.5rem + var(--dock-bar-offset));
}

/* ─── لپ‌تاپ: نوار پایین مخفی — هدر کافی است ─── */
@media (min-width: 901px) and (max-width: 1599px) {
    :root {
        --dock-bar-h: 0px;
        --dock-bar-gap: 0px;
        --dock-bar-offset: 0px;
    }

    .dock-bar {
        display: none;
    }

    body.has-dock-bar {
        padding-bottom: 0;
    }

    .site-footer {
        padding-bottom: 1.5rem;
    }
}

/* ─── دسکتاپ ─── */
@media (min-width: 769px) {
    .dock-bar__shell {
        max-width: 42rem;
    }

    .dock-bar__glass {
        padding: 0.55rem 0.85rem 0.5rem;
        border-radius: 24px;
    }

    .dock-bar__side {
        gap: 0.25rem;
    }

    .dock-bar__side--start {
        padding-inline-end: 0.35rem;
    }

    .dock-bar__side--end {
        padding-inline-start: 0.35rem;
    }

    .dock-bar__item--guide-desktop {
        display: flex;
    }

    .dock-bar__item--guide-mobile {
        display: none;
    }

    .dock-bar__item,
    .dock-bar__fab {
        gap: 0.28rem;
        padding: 0.35rem 0.5rem 0.2rem;
        border-radius: 14px;
    }

    .dock-bar__item:hover {
        background: rgba(255, 255, 255, 0.06);
    }

    .dock-bar__item--call:hover {
        background: rgba(239, 108, 0, 0.12);
    }

    .dock-bar__icon {
        width: 1.85rem;
        height: 1.85rem;
        border-radius: 13px;
    }

    .dock-bar__icon svg {
        width: 1.3rem;
        height: 1.3rem;
    }

    .dock-bar__label {
        font-size: 0.72rem;
    }

    .dock-bar__item--desktop-only {
        display: flex;
    }

    .dock-bar__label--mobile {
        display: none;
    }

    .dock-bar__label--desktop {
        display: inline-block;
    }

    .dock-bar__fab {
        flex-basis: 4.75rem;
        width: 4.75rem;
        margin-top: -1.55rem;
    }

    .dock-bar__fab-ring {
        width: 3.65rem;
        height: 3.65rem;
    }

    .dock-bar__fab-inner {
        width: 3.25rem;
        height: 3.25rem;
    }

    .dock-bar__fab-inner svg {
        width: 1.45rem;
        height: 1.45rem;
    }

    .dock-bar__item--call .dock-bar__label,
    .dock-bar__item--call-alt .dock-bar__label {
        font-size: 0.78rem;
    }
}

/* ─── موبایل کوچک ─── */
@media (max-width: 380px) {
    .dock-bar__label {
        font-size: 0.58rem;
    }

    .dock-bar__item--call .dock-bar__label {
        font-size: 0.54rem;
    }

    .dock-bar__fab-inner {
        width: 2.75rem;
        height: 2.75rem;
    }

    .dock-bar__fab-ring {
        width: 3.1rem;
        height: 3.1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dock-bar__fab-ring {
        animation: none;
    }

    .dock-bar__item,
    .dock-bar__fab {
        transition: none;
    }
}
