﻿
/* ===== Typewriter ===== */
#typewriter {
    font-weight: 700;
    font-size: 2.6rem;
    white-space: nowrap;
    overflow: hidden;
    border-right: .12em solid rgba(0,0,0,0.8);
    display: inline-block;
    direction: rtl;
    color: inherit;
    line-height: 1.1;
}

@keyframes type-caret {
    50% {
        border-color: transparent;
    }
}

.typewriter-caret {
    animation: type-caret 800ms steps(1) infinite;
}

/* ===== Phone attention and floating behavior ===== */
/* اکنون دکمه تماس ظاهر ساده تری دارد (نه گرادیانت) */
#phoneItem .btncall-customer {
    display: inline-block;
    padding: 12px 18px;
    border-radius: 10px;
    background: #f5f5f5; /* معمولی */
    color: #222;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.06);
    transform-origin: center;
    transition: transform 300ms cubic-bezier(.2,.8,.2,1), box-shadow 300ms;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* انیمیشن پرش اولیه با افکت فرسایش (bounce decay) */
@keyframes bounce-decay {
    0% {
        transform: translateY(-6px) scale(1.02);
    }

    20% {
        transform: translateY(0) scale(1);
    }

    35% {
        transform: translateY(-12px) scale(1.04);
    }

    50% {
        transform: translateY(0) scale(1);
    }

    65% {
        transform: translateY(-6px) scale(1.02);
        opacity: 0.95;
    }

    80% {
        transform: translateY(0) scale(1);
        opacity: 0.98;
    }

    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.btncall-customer.initial-bounce {
    animation: bounce-decay 1200ms cubic-bezier(.22,.9,.3,1) both;
}

/* نگه داشتن پالس وقتی کوچک میشه (نمای شناور) */
@keyframes pulse-strong {
    0% {
        transform: scale(1);
        box-shadow: 0 8px 20px rgba(0,0,0,0.06);
    }

    50% {
        transform: scale(1.06);
        box-shadow: 0 18px 40px rgba(0,0,0,0.09);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 8px 20px rgba(0,0,0,0.06);
    }
}

.btncall-customer.attention {
    animation: pulse-strong 2s infinite;
}

#floatingPhone {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 9999;
    text-decoration: none;
    display: none;
}

.floating-phone-inner {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ff7a18; /* قابل دید */
    box-shadow: 0 12px 30px rgba(0,0,0,0.25);
    color: #fff;
    transition: transform 250ms ease, opacity 250ms ease;
}

    .floating-phone-inner .phone-svg {
        width: 22px;
        height: 22px;
        color: #fff;
    }

@keyframes appear-bounce {
    0% {
        transform: translateY(20px) scale(.9);
        opacity: 0;
    }

    60% {
        transform: translateY(-6px) scale(1.05);
        opacity: 1;
    }

    100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

#floatingPhone.show {
    display: block;
    animation: appear-bounce 420ms ease;
}

.floating-phone-inner.pulse {
    animation: pulse-strong 2.2s infinite;
}

/* ===== Address blink ===== */
@keyframes blink {
    0% {
        opacity: 1;
        transform: translateY(0);
    }

    20% {
        opacity: 0.25;
        transform: translateY(-2px);
    }

    40% {
        opacity: 1;
        transform: translateY(0);
    }

    60% {
        opacity: 0.35;
        transform: translateY(-1px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.blink-on-scroll {
    display: inline-block;
    animation: blink 900ms ease-in-out 1;
    will-change: opacity, transform;
}

/* ===== Hero: image with zoom + drag (تعدیل شد) ===== */
.hero-wrap {
    position: relative;
    overflow: hidden;
    border-radius: 6px;
    min-height: 320px;
    background-color: #f5f5f5;
}

.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform-origin: center center;
    transition: transform 360ms cubic-bezier(.2,.9,.2,1);
    will-change: transform;
    touch-action: none;
    cursor: grab;
    user-select: none;
    -webkit-user-drag: none;
}

    .hero-img.grabbing {
        cursor: grabbing;
        transition: none;
    }

/* وقتی زوم قفل بشه یک کلاس نگهدارنده */
.hero-wrap.zoomed .hero-img,
.hero-wrap.locked-zoom .hero-img {
    transition: transform 420ms cubic-bezier(.16,.84,.28,1);
}

.drag-hint {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0,0,0,0.42);
    color: #fff;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 13px;
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 220ms ease, transform 220ms ease;
    z-index: 5;
}

.hero-wrap.zoomed .drag-hint {
    opacity: 1;
    transform: translate(-50%,-50%) scale(1);
}

.drag-hint svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
}

/* ===== Swipe hint (for slider) ===== */
.swipe-hint {
    position: absolute;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%) translateY(6px);
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: rgba(0,0,0,0.56);
    color: #fff;
    padding: 10px 14px;
    border-radius: 999px;
    font-size: 14px;
    z-index: 60;
    pointer-events: none;
    opacity: 0;
    transition: opacity 260ms ease, transform 260ms cubic-bezier(.2,.9,.2,1);
    will-change: opacity, transform;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

    /* visible state toggled by JS */
    .swipe-hint.visible {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }

/* finger + bubble wrapper */
.swipe-finger {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.06);
    border-radius: 10px;
    flex: 0 0 44px;
    transform-origin: center;
}

    /* finger svg sizing */
    .swipe-finger svg {
        width: 26px;
        height: 26px;
        display: block;
    }

/* ===== finger animation (horizontal swipe + subtle press) ===== */
@keyframes finger-swipe-x {
    0% {
        transform: translateX(0) translateY(0) rotate(0deg);
        opacity: 1;
    }

    20% {
        transform: translateX(-10px) translateY(-2px) rotate(-4deg);
    }

    50% {
        transform: translateX(-22px) translateY(-4px) rotate(-6deg);
        opacity: 0.95;
    }

    80% {
        transform: translateX(-10px) translateY(-2px) rotate(-4deg);
    }

    100% {
        transform: translateX(0) translateY(0) rotate(0deg);
        opacity: 1;
    }
}

@keyframes finger-press {
    0% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(2px) scale(0.98);
    }

    100% {
        transform: translateY(0) scale(1);
    }
}

/* apply animation only when .animate class exists */
.swipe-finger.animate {
    animation: finger-swipe-x 1400ms cubic-bezier(.2,.9,.2,1) both;
}

    /* slight press on the svg path while swipe runs */
    .swipe-finger.animate svg {
        animation: finger-press 700ms ease-in-out both;
        animation-delay: 200ms;
    }

/* text styling */
.swipe-hint .text {
    font-size: 14px;
    line-height: 1;
    color: #fff;
    pointer-events: none;
}

/* ===== Entrance animations for title and short description ===== */
.anim {
    opacity: 0;
    will-change: transform, opacity;
}

.from-right.animate-in {
    animation: slideFromRight 700ms cubic-bezier(.2,.9,.2,1) forwards;
}

.from-left.animate-in {
    animation: slideFromLeft 700ms cubic-bezier(.2,.9,.2,1) forwards;
}

.from-bottom.animate-in {
    animation: slideFromBottom 700ms cubic-bezier(.2,.9,.2,1) forwards;
}

@keyframes slideFromRight {
    0% {
        opacity: 0;
        transform: translateX(40px) scale(.98);
    }

    60% {
        opacity: 1;
        transform: translateX(-8px) scale(1.01);
    }

    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes slideFromLeft {
    0% {
        opacity: 0;
        transform: translateX(-40px) scale(.98);
    }

    60% {
        opacity: 1;
        transform: translateX(8px) scale(1.01);
    }

    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes slideFromBottom {
    0% {
        opacity: 0;
        transform: translateY(28px) scale(.98);
    }

    60% {
        opacity: 1;
        transform: translateY(-6px) scale(1.01);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* responsive tweaks */
@media (max-width: 768px) {
    #typewriter {
        font-size: 1.8rem;
    }

    .btncall-customer {
        padding: 10px 14px;
        font-size: 0.95rem;
    }

    .floating-phone-inner {
        width: 50px;
        height: 50px;
    }

    .hero-wrap {
        min-height: 220px;
    }

    .drag-hint {
        font-size: 12px;
        padding: 7px 10px;
    }

    .swipe-hint {
        bottom: 12px;
        font-size: 13px;
        padding: 7px 10px;
    }
}

@media (max-width: 420px) {
    .swipe-hint {
        bottom: 12px;
        padding: 8px 10px;
        gap: 8px;
        font-size: 13px;
    }

    .swipe-finger {
        width: 38px;
        height: 38px;
    }

        .swipe-finger svg {
            width: 22px;
            height: 22px;
        }
}

/* =================== 360 modal styles (single place no duplication) =================== */
.modal-360-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 12000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.modal-360 {
    width: 100%;
    max-width: 1100px;
    height: 78vh;
    background: #0f1720;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 40px rgba(0,0,0,0.6);
}

    .modal-360 .modal-top {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 12px;
        background: rgba(255,255,255,0.02);
    }

    .modal-360 .modal-title {
        color: #fff;
        font-weight: 700;
        font-size: 1rem;
        direction: rtl;
    }

    .modal-360 .modal-controls {
        display: flex;
        gap: 8px;
        align-items: center;
    }

    .modal-360 .btn {
        padding: 8px 12px;
        border-radius: 8px;
        cursor: pointer;
        border: none;
        font-weight: 600;
    }

.btn-secondary {
    background: rgba(255,255,255,0.06);
    color: #fff;
}

.btn-primary {
    background: #22c55e;
    color: #062e0a;
}

.modal-360 .modal-body {
    position: relative;
    flex: 1 1 auto;
    background: #000;
}

.modal-360 iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    background: #000;
}

.modal-360 .loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    background: linear-gradient(180deg, rgba(0,0,0,0.28), rgba(0,0,0,0.56));
}

    .modal-360 .loader .spinner {
        width: 52px;
        height: 52px;
        border-radius: 50%;
        border: 5px solid rgba(255,255,255,0.08);
        border-top-color: rgba(255,255,255,0.9);
        animation: spin 1s linear infinite;
    }

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.modal-360 .loader .msg {
    color: #fff;
    font-size: 0.95rem;
    max-width: 86%;
    text-align: center;
}

.modal-360 .hint {
    padding: 8px 12px;
    font-size: 0.9rem;
    color: #e2e8f0;
    background: rgba(255,255,255,0.02);
}

@media (max-width: 900px) {
    .modal-360 {
        max-width: 96%;
        height: 78vh;
    }
}

.consultation-box.space-theme {
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    padding: 26px;
    color: #e6f7ff;
    background: linear-gradient(180deg, rgba(5,12,23,0.92) 0%, rgba(10,18,35,0.88) 100%);
    box-shadow: 0 6px 30px rgba(3,8,18,0.6), inset 0 1px 0 rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.04);
    transform: translateZ(0);
    -webkit-font-smoothing: antialiased;
    backdrop-filter: blur(6px);
}

    /* content layout */
    .consultation-box.space-theme .consultation-content {
        position: relative;
        z-index: 5;
        display: flex;
        flex-direction: column;
        gap: 12px;
        min-height: 120px;
    }

    .consultation-box.space-theme .consultation-title {
        font-size: 1.28rem;
        margin: 0;
        letter-spacing: 0.6px;
        color: #f0f9ff;
        text-shadow: 0 6px 30px rgba(34,197,94,0.06), 0 1px 0 rgba(0,0,0,0.6);
    }

    /* description */
    .consultation-box.space-theme .consultation-desc {
        margin: 0;
        color: rgba(226,241,255,0.92);
        line-height: 1.45;
        font-weight: 400;
        opacity: 0.95;
    }

    /* glowing button */
    .consultation-box.space-theme .consultation-btn {
        --g1: rgb(4 83 88 / 0.59);
        --g2: rgba(8, 145, 178, 0.95);
        display: inline-block;
        align-self: center;
        margin-top: 8px;
        padding: 10px 16px;
        border-radius: 12px;
        font-weight: 800;
        text-decoration: none;
        color: #ecf1ee;
        background: linear-gradient(90deg, var(--g1), var(--g2));
        box-shadow: 0 6px 24px rgba(8,145,178,0.16), 0 2px 8px rgba(34,197,94,0.08), inset 0 -2px 6px rgba(0,0,0,0.12);
        transition: transform 180ms cubic-bezier(.2,.9,.2,1), box-shadow 180ms, filter 180ms;
        border: none;
        cursor: pointer;
        z-index: 6;
        position: relative;
        overflow: hidden;
    }

        /* button hover/focus */
        .consultation-box.space-theme .consultation-btn:hover,
        .consultation-box.space-theme .consultation-btn:focus {
            transform: translateY(-4px) scale(1.02);
            box-shadow: 0 18px 40px rgba(8,145,178,0.14), 0 6px 18px rgba(34,197,94,0.12), inset 0 -2px 10px rgba(0,0,0,0.18);
            filter: saturate(1.05);
            outline: none;
        }

/* subtle pulse to attract attention (runs once on appearance then slow loop) */
@keyframes gentle-pulse {
    0% {
        box-shadow: 0 6px 24px rgba(8,145,178,0.12);
        transform: translateY(0);
    }

    50% {
        box-shadow: 0 18px 44px rgba(8,145,178,0.16);
        transform: translateY(-3px);
    }

    100% {
        box-shadow: 0 6px 24px rgba(8,145,178,0.12);
        transform: translateY(0);
    }
}

.consultation-box.space-theme .consultation-btn {
    animation: gentle-pulse 3.8s ease-in-out 1s 1, gentle-pulse 8s ease-in-out 6s infinite;
}

/* decorative layers (stars nebula planet) */
.consultation-box.space-theme .space-deco {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

/* starfield using layered radial-gradients moves slowly */
.consultation-box.space-theme .starfield {
    background-image: radial-gradient(1px 1px at 8% 12%, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.0) 60%), radial-gradient(1px 1px at 22% 38%, rgba(255,255,255,0.85) 0%, rgba(255,255,255,0.0) 60%), radial-gradient(1px 1px at 46% 18%, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.0) 60%), radial-gradient(1px 1px at 74% 72%, rgba(255,255,255,0.88) 0%, rgba(255,255,255,0.0) 60%), radial-gradient(1px 1px at 85% 26%, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0.0) 60%), radial-gradient(1px 1px at 32% 82%, rgba(255,255,255,0.7) 0%, rgba(255,255,255,0.0) 60%);
    opacity: 0.95;
    mix-blend-mode: screen;
    transform: translateZ(0);
    animation: star-drift 26s linear infinite;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.45));
}

/* slow nebula glow */
.consultation-box.space-theme .nebula {
    background: radial-gradient(closest-side at 18% 30%, rgba(34,197,94,0.12), rgba(34,197,94,0.04) 12%, rgba(8,145,178,0.06) 26%, rgba(8,145,178,0.02) 40%, rgba(0,0,0,0) 60%), radial-gradient(closest-side at 78% 72%, rgba(56,189,248,0.06), rgba(99,102,241,0.04) 10%, rgba(0,0,0,0) 50%);
    opacity: 0.85;
    mix-blend-mode: screen;
    filter: blur(28px) saturate(1.05);
    transform: scale(1.06);
    animation: nebula-slow 18s ease-in-out infinite alternate;
}

/* small planet / round glow */
.consultation-box.space-theme .planet {
    background: radial-gradient(circle at 35% 70%, rgba(8,145,178,0.18) 0%, rgba(8,145,178,0.06) 18%, rgba(2,6,15,0.0) 40%), radial-gradient(circle at 80% 20%, rgba(99,102,241,0.12) 0%, rgba(99,102,241,0.02) 22%, transparent 45%);
    transform: translate3d(0,0,0);
    filter: blur(12px);
    opacity: 0.9;
}

/* shooting star (single occasional) */
.shooting-star {
    position: absolute;
    top: -10%;
    left: -20%;
    width: 220px;
    height: 2px;
    background: linear-gradient(90deg, rgba(255,255,255,0.0) 0%, rgba(255,255,255,0.85) 60%, rgba(255,255,255,0.0) 100%);
    transform: rotate(-18deg) translateX(-100%);
    z-index: 3;
    pointer-events: none;
    filter: blur(0.6px);
    opacity: 0;
    animation: shoot 8s linear infinite;
}

/* keyframes */
@keyframes nebula-slow {
    0% {
        transform: scale(1.02) translateY(0);
        opacity: 0.86;
    }

    100% {
        transform: scale(1.08) translateY(-8px);
        opacity: 0.98;
    }
}

@keyframes star-drift {
    from {
        background-position: 0% 0%;
    }

    to {
        background-position: 120% -60%;
    }
}

@keyframes shoot {
    0% {
        opacity: 0;
        transform: translateX(-100%) rotate(-18deg);
        top: 10%;
        left: -30%;
    }

    6% {
        opacity: 1;
    }

    30% {
        opacity: 1;
        transform: translateX(160%) rotate(-18deg);
    }

    36% {
        opacity: 0;
    }

    100% {
        opacity: 0;
        transform: translateX(160%) rotate(-18deg);
        top: -10%;
        left: 120%;
    }
}

/* responsive tweaks */
@media (max-width: 900px) {
    .consultation-box.space-theme {
        padding: 18px;
        border-radius: 12px;
    }

        .consultation-box.space-theme .consultation-title {
            font-size: 1.06rem;
        }

        .consultation-box.space-theme .consultation-btn {
            padding: 9px 14px;
            border-radius: 10px;
        }
}

/* accessibility: focus visible */
.consultation-box.space-theme .consultation-btn:focus-visible {
    outline: 3px solid rgba(34,197,94,0.18);
    outline-offset: 4px;
}

