/*
  Kian Dezh Waiting Component
  Responsive Final Version
  فایل کامل اصلاح‌شده برای Loader / Waiting
  قابل استفاده برای نسخه فارسی و انگلیسی
*/

:root {
    --asareh-font-main: var(--kd-font-primary, "KianPeyda", "KianIranSans", "KianVazir", Tahoma, Arial, sans-serif);
    --asareh-font-serif: "KianPeyda", "KianIranSans", "KianVazir", Tahoma, Arial, sans-serif;
}

html.asareh-waiting-lock {
    overflow: hidden;
}

.asareh-waiting,
.asareh-waiting *,
.asareh-waiting *::before,
.asareh-waiting *::after {
    box-sizing: border-box;
}

.asareh-waiting {
    --asareh-bg: #ffffff;
    --asareh-fg: #18110a;
    --asareh-muted: rgba(24, 17, 10, .72);
    --asareh-accent: #8f5b18;
    --asareh-accent-2: #cda057;
    --asareh-taq-kasra-svg: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 260' fill='none'%3E%3Cpath d='M14 260 L14 170 C14 122 52 70 150 24 C248 70 286 122 286 170 L286 260 L14 260 Z' stroke='%23764B16' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M32 260 L32 174 C32 136 62 96 150 44 C238 96 268 136 268 174 L268 260 L32 260 Z' stroke='%23764B16' stroke-opacity='.42' stroke-width='1' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M6 260 L6 166 C6 112 42 58 150 14 C258 58 294 112 294 166 L294 260 L6 260 Z' stroke='%23764B16' stroke-opacity='.18' stroke-width='.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");

    position: fixed;
    inset: 0;
    z-index: 9999;

    display: grid;
    place-items: center;

    width: 100vw;
    height: 100vh;
    height: 100svh;

    overflow: hidden;

    direction: ltr !important;
    text-align: center !important;

    background: #ffffff !important;
    background-image: none !important;
    color: var(--asareh-fg);

    opacity: 1;
    visibility: visible;
    transform: translateZ(0);
    transition: opacity .46s ease, visibility .46s ease;
    isolation: isolate;
    font-family: var(--asareh-font-main);

    padding: clamp(14px, 2vw, 28px);
}

.asareh-waiting.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.asareh-waiting.is-ending .asareh-waiting__scene {
    animation: asareh-exit .46s ease both;
}

.asareh-waiting::before,
.asareh-waiting::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: transparent !important;
    background-image: none !important;
}

/* =========================
   Scene
   ========================= */

.asareh-waiting__scene {
    position: relative;
    z-index: 5;

    width: min(900px, 92vw);
    height: min(590px, 86vh);
    height: min(590px, 86svh);
    min-height: 0;
    max-height: 86vh;
    max-height: 86svh;

    display: grid;
    place-items: center;

    text-align: center !important;
    direction: ltr !important;

    padding: 0;
    overflow: visible;
}

.asareh-waiting__scene::before {
    content: "";
    position: absolute;
    inset: 7% 10%;
    border-radius: 34px;
    background: transparent !important;
    background-image: none !important;
    opacity: 0;
    pointer-events: none;
}

/* =========================
   Content
   ========================= */

.asareh-waiting__content {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 30;

    width: min(520px, 82vw);
    max-width: 82vw;

    display: grid;
    place-items: center;
    justify-items: center;
    align-items: center;
    gap: 18px;

    margin: 0;
    padding: 0;

    text-align: center !important;
    direction: ltr !important;
    unicode-bidi: isolate;

    transform: translate(-50%, -50%);
}

.asareh-waiting__logo {
    width: clamp(76px, 8.4vw, 104px);
    height: auto;
    display: block;
    margin: 0 auto 8px;
    filter: drop-shadow(0 6px 12px rgba(71, 43, 10, .10));
    animation: asareh-logo-breathe 2.2s ease-in-out infinite;
}

.asareh-waiting__brand {
    width: 100%;
    max-width: 100%;
    margin: 0;

    color: var(--asareh-fg);
    font-family: var(--asareh-font-serif);
    font-size: clamp(26px, 3vw, 36px);
    font-weight: 950;
    line-height: 1.06;

    letter-spacing: 0;
    word-spacing: .015em;

    text-align: center !important;
    white-space: nowrap;

    text-shadow: 0 6px 14px rgba(80, 52, 16, .055);
}

.asareh-waiting__caption {
    width: min(480px, 78vw);
    max-width: 78vw;
    min-height: auto;

    margin: 0 auto;

    color: var(--asareh-muted);
    font-family: var(--asareh-font-main);
    font-size: clamp(14px, 1vw, 16px);
    font-weight: 850;
    line-height: 1.55;
    letter-spacing: 0;

    text-align: center !important;
}

.asareh-waiting__counter {
    margin-top: 3px;

    font-family: "KianInter", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 13.5px;
    font-weight: 850;
    line-height: 1;
    letter-spacing: .08em;

    color: var(--asareh-accent);

    direction: ltr !important;
    text-align: center !important;
}

.asareh-waiting__progress,
.asareh-waiting__progress span {
    display: none !important;
}

/* =========================
   Visual / Arches
   ========================= */

.asareh-waiting__visual,
.asareh-waiting__visual span {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.asareh-waiting__visual {
    z-index: 4;
    opacity: 1;
    direction: ltr !important;
    transform: none !important;
}

.asareh-waiting__visual::before,
.asareh-waiting__visual::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;

    display: block;

    background-image: var(--asareh-taq-kasra-svg);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100% 100%;

    transform: translate(-50%, -50%);
    opacity: 0;

    will-change: opacity, transform;
}

/* Soft outer central layer */
.asareh-waiting__visual::before {
    width: min(740px, 80vw, 82vh);
    height: min(708px, 76vw, 78vh);

    filter:
        drop-shadow(0 5px 10px rgba(76, 45, 10, .035)) drop-shadow(0 1px 0 rgba(255, 255, 255, .14));

    animation:
        asareh-taq-edge-appear 1.05s ease-out .10s forwards,
        asareh-taq-edge-breathe 3.3s ease-in-out 1.25s infinite;
}

/* Second soft outer central layer */
.asareh-waiting__visual::after {
    width: min(630px, 70vw, 72vh);
    height: min(602px, 66vw, 68vh);

    filter:
        drop-shadow(0 5px 10px rgba(76, 45, 10, .045)) drop-shadow(0 1px 0 rgba(255, 255, 255, .16));

    animation:
        asareh-taq-edge-mid-appear 1.05s ease-out .18s forwards,
        asareh-taq-edge-breathe 3.15s ease-in-out 1.38s infinite reverse;
}

/* Only two main central arches */
.asareh-waiting--architectural-07 .asareh-waiting__visual span {
    display: none;
}

.asareh-waiting--architectural-07 .asareh-waiting__visual span:nth-child(1),
.asareh-waiting--architectural-07 .asareh-waiting__visual span:nth-child(2) {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;

    display: block;

    background-image: var(--asareh-taq-kasra-svg);
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100% 100%;

    transform: translate(-50%, -50%);
    opacity: 0;

    will-change: opacity, transform;
}

/* Main outer center arch */
.asareh-waiting--architectural-07 .asareh-waiting__visual span:nth-child(2) {
    width: min(520px, 58vw, 60vh);
    height: min(496px, 54vw, 56vh);

    filter:
        drop-shadow(0 6px 11px rgba(76, 45, 10, .08)) drop-shadow(0 1px 0 rgba(255, 255, 255, .22));

    animation:
        asareh-taq-center-outer-appear 1.05s ease-out .22s forwards,
        asareh-taq-center-breathe 3s ease-in-out 1.34s infinite;
}

/* Main inner center arch */
.asareh-waiting--architectural-07 .asareh-waiting__visual span:nth-child(1) {
    width: min(420px, 48vw, 50vh);
    height: min(400px, 45vw, 47vh);

    filter:
        drop-shadow(0 7px 12px rgba(76, 45, 10, .09)) drop-shadow(0 1px 0 rgba(255, 255, 255, .26));

    animation:
        asareh-taq-center-inner-appear 1s ease-out .12s forwards,
        asareh-taq-center-sketch 1.9s linear 1.16s infinite,
        asareh-taq-center-breathe 2.75s ease-in-out 1.24s infinite;
}

/* Remove all random elements */
.asareh-waiting__random-lines,
.asareh-waiting__sketch-line,
.asareh-waiting__sketch-arch {
    display: none !important;
}

.asareh-waiting__sketch-line::before,
.asareh-waiting__sketch-line::after {
    display: none !important;
    content: none !important;
}

/* Subtle guide behind center */
.asareh-waiting__content::before,
.asareh-waiting__content::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    pointer-events: none;
    opacity: .06;
}

.asareh-waiting__content::before {
    width: 1px;
    height: 118px;
    background: linear-gradient(180deg, transparent, rgba(143, 91, 24, .12), transparent);
    transform: translate(-50%, -36%);
}

.asareh-waiting__content::after {
    width: 86px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(143, 91, 24, .10), transparent);
    transform: translate(-50%, 36px);
}

/* =========================
   Language parity lock
   ========================= */

html[lang="fa"] .asareh-waiting,
html[lang="fa"] .asareh-waiting__scene,
html[lang="fa"] .asareh-waiting__visual,
html[lang="en"] .asareh-waiting,
html[lang="en"] .asareh-waiting__scene,
html[lang="en"] .asareh-waiting__visual {
    direction: ltr !important;
    text-align: center !important;
}

html[lang="fa"] .asareh-waiting__content,
html[lang="en"] .asareh-waiting__content {
    width: min(520px, 82vw) !important;
    max-width: 82vw !important;
    text-align: center !important;
}

html[lang="fa"] .asareh-waiting__brand,
html[lang="fa"] .asareh-waiting__caption,
html[lang="en"] .asareh-waiting__brand,
html[lang="en"] .asareh-waiting__caption {
    text-align: center !important;
}

html[lang="fa"] .asareh-waiting__caption,
html[lang="en"] .asareh-waiting__caption {
    width: min(480px, 78vw) !important;
    max-width: 78vw !important;
    min-height: auto !important;
}

/* =========================
   Animations
   ========================= */

@keyframes asareh-exit {
    to {
        opacity: 0;
        transform: scale(.988);
        filter: blur(8px);
    }
}

@keyframes asareh-logo-breathe {

    0%,
    100% {
        transform: scale(1);
        opacity: .95;
    }

    50% {
        transform: scale(1.03);
        opacity: 1;
    }
}

@keyframes asareh-taq-center-inner-appear {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(.96);
    }

    100% {
        opacity: .30;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes asareh-taq-center-outer-appear {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(.96);
    }

    100% {
        opacity: .22;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes asareh-taq-edge-mid-appear {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(.96);
    }

    100% {
        opacity: .12;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes asareh-taq-edge-appear {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(.96);
    }

    100% {
        opacity: .08;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes asareh-taq-center-breathe {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(.998);
    }

    50% {
        transform: translate(-50%, -50%) scale(1.01);
    }
}

@keyframes asareh-taq-edge-breathe {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(.998);
    }

    50% {
        transform: translate(-50%, -50%) scale(1.005);
    }
}

@keyframes asareh-taq-center-sketch {

    0%,
    100% {
        opacity: .30;
    }

    30% {
        opacity: .26;
    }

    60% {
        opacity: .32;
    }

    85% {
        opacity: .28;
    }
}

/* =========================
   Laptop / Short Height Safety
   ========================= */

@media (max-width: 1280px),
(max-height: 780px) {
    .asareh-waiting__scene {
        width: min(820px, 90vw);
        height: min(530px, 84vh);
        height: min(530px, 84svh);
        max-height: 84vh;
        max-height: 84svh;
    }

    .asareh-waiting__content {
        width: min(480px, 80vw);
        max-width: 80vw;
        gap: 16px;
    }

    html[lang="fa"] .asareh-waiting__content,
    html[lang="en"] .asareh-waiting__content {
        width: min(480px, 80vw) !important;
        max-width: 80vw !important;
    }

    .asareh-waiting__logo {
        width: clamp(72px, 7.6vw, 96px);
    }

    .asareh-waiting__brand {
        font-size: clamp(24px, 2.8vw, 33px);
        line-height: 1.06;
    }

    .asareh-waiting__caption {
        width: min(440px, 76vw);
        max-width: 76vw;
        font-size: clamp(13.4px, .98vw, 15px);
        line-height: 1.5;
    }

    html[lang="fa"] .asareh-waiting__caption,
    html[lang="en"] .asareh-waiting__caption {
        width: min(440px, 76vw) !important;
        max-width: 76vw !important;
    }

    .asareh-waiting__counter {
        font-size: 13px;
    }

    .asareh-waiting__visual::before {
        width: min(650px, 76vw, 76vh);
        height: min(622px, 72vw, 72vh);
    }

    .asareh-waiting__visual::after {
        width: min(560px, 66vw, 66vh);
        height: min(535px, 62vw, 62vh);
    }

    .asareh-waiting--architectural-07 .asareh-waiting__visual span:nth-child(2) {
        width: min(470px, 54vw, 56vh);
        height: min(448px, 50vw, 52vh);
    }

    .asareh-waiting--architectural-07 .asareh-waiting__visual span:nth-child(1) {
        width: min(380px, 45vw, 47vh);
        height: min(362px, 42vw, 44vh);
    }

    .asareh-waiting__content::before {
        height: 102px;
    }

    .asareh-waiting__content::after {
        width: 76px;
        transform: translate(-50%, 31px);
    }
}

/* =========================
   Mobile / Tablet
   ========================= */

@media (max-width: 640px) {
    .asareh-waiting {
        padding: 14px;
    }

    .asareh-waiting__scene {
        width: 92vw;
        height: min(450px, 80vh);
        height: min(450px, 80svh);
        min-height: 0;
        max-height: 80vh;
        max-height: 80svh;
    }

    .asareh-waiting__content {
        width: min(310px, 82vw);
        max-width: 82vw;
        gap: 14px;
        transform: translate(-50%, -50%);
    }

    .asareh-waiting__logo {
        width: clamp(64px, 19vw, 88px);
    }

    .asareh-waiting__brand {
        font-size: clamp(21px, 6.2vw, 29px);
        line-height: 1.08;
        white-space: nowrap;
    }

    .asareh-waiting__caption {
        width: min(295px, 78vw);
        max-width: 78vw;
        font-size: clamp(12.6px, 3.45vw, 14.2px);
        line-height: 1.48;
    }

    .asareh-waiting__counter {
        font-size: 12.4px;
    }

    .asareh-waiting__visual::before {
        width: min(350px, 88vw, 68vh);
        height: min(334px, 84vw, 64vh);
    }

    .asareh-waiting__visual::after {
        width: min(300px, 76vw, 58vh);
        height: min(286px, 72vw, 55vh);
    }

    .asareh-waiting--architectural-07 .asareh-waiting__visual span:nth-child(2) {
        width: min(250px, 64vw, 48vh);
        height: min(238px, 60vw, 45vh);
    }

    .asareh-waiting--architectural-07 .asareh-waiting__visual span:nth-child(1) {
        width: min(204px, 52vw, 40vh);
        height: min(194px, 49vw, 38vh);
    }

    .asareh-waiting__content::before {
        height: 84px;
    }

    .asareh-waiting__content::after {
        width: 62px;
        transform: translate(-50%, 26px);
    }

    html[lang="fa"] .asareh-waiting__content,
    html[lang="en"] .asareh-waiting__content {
        width: min(310px, 82vw) !important;
        max-width: 82vw !important;
    }

    html[lang="fa"] .asareh-waiting__caption,
    html[lang="en"] .asareh-waiting__caption {
        width: min(295px, 78vw) !important;
        max-width: 78vw !important;
    }
}

@media (max-width: 380px) {
    .asareh-waiting__scene {
        width: 92vw;
        height: min(410px, 78vh);
        height: min(410px, 78svh);
        max-height: 78vh;
        max-height: 78svh;
    }

    .asareh-waiting__content {
        width: min(280px, 80vw);
        max-width: 80vw;
    }

    html[lang="fa"] .asareh-waiting__content,
    html[lang="en"] .asareh-waiting__content {
        width: min(280px, 80vw) !important;
        max-width: 80vw !important;
    }

    .asareh-waiting__brand {
        font-size: clamp(20px, 6vw, 26px);
    }

    .asareh-waiting__caption {
        width: min(265px, 76vw);
        max-width: 76vw;
        font-size: 12.4px;
    }

    html[lang="fa"] .asareh-waiting__caption,
    html[lang="en"] .asareh-waiting__caption {
        width: min(265px, 76vw) !important;
        max-width: 76vw !important;
    }

    .asareh-waiting__visual::before {
        width: min(318px, 86vw, 64vh);
        height: min(304px, 82vw, 60vh);
    }

    .asareh-waiting__visual::after {
        width: min(272px, 74vw, 54vh);
        height: min(260px, 70vw, 51vh);
    }

    .asareh-waiting--architectural-07 .asareh-waiting__visual span:nth-child(2) {
        width: min(230px, 62vw, 44vh);
        height: min(219px, 58vw, 41vh);
    }

    .asareh-waiting--architectural-07 .asareh-waiting__visual span:nth-child(1) {
        width: min(188px, 50vw, 37vh);
        height: min(179px, 47vw, 35vh);
    }
}

@media (prefers-reduced-motion: reduce) {

    .asareh-waiting,
    .asareh-waiting *,
    .asareh-waiting *::before,
    .asareh-waiting *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
}

/* ==========================================================
   KIAN DEZH - WAITING CLEAN WHITE FINAL OVERRIDE
   Scope:
   - حذف کامل خطوط/طاق‌ها/راهنماهای تصویری
   - بک‌گراند سفید خالص
   - لوگوی حدوداً دو برابر بزرگ‌تر
   - فاصله متناسب‌تر بین لوگو و متن
   ========================================================== */

.asareh-waiting {
    background: #ffffff !important;
    background-color: #ffffff !important;
    background-image: none !important;
}

.asareh-waiting::before,
.asareh-waiting::after,
.asareh-waiting__scene::before,
.asareh-waiting__visual,
.asareh-waiting__visual::before,
.asareh-waiting__visual::after,
.asareh-waiting__visual span,
.asareh-waiting--architectural-07 .asareh-waiting__visual span,
.asareh-waiting__content::before,
.asareh-waiting__content::after,
.asareh-waiting__random-lines,
.asareh-waiting__sketch-line,
.asareh-waiting__sketch-arch {
    display: none !important;
    content: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    background: none !important;
    background-image: none !important;
    box-shadow: none !important;
    filter: none !important;
}

.asareh-waiting__content {
    gap: 18px !important;
}

.asareh-waiting__logo {
    width: clamp(76px, 8.4vw, 104px) !important;
    max-width: 104px !important;
    margin: 0 auto 8px !important;
}

.asareh-waiting__brand {
    margin-top: 0 !important;
}

.asareh-waiting__caption {
    margin-top: -2px !important;
}

@media (max-width: 1280px),
(max-height: 780px) {
    .asareh-waiting__content {
        gap: 16px !important;
    }

    .asareh-waiting__logo {
        width: clamp(72px, 7.6vw, 96px) !important;
        max-width: 96px !important;
        margin-bottom: 7px !important;
    }
}

@media (max-width: 640px) {
    .asareh-waiting__content {
        gap: 14px !important;
    }

    .asareh-waiting__logo {
        width: clamp(64px, 19vw, 88px) !important;
        max-width: 88px !important;
        margin-bottom: 6px !important;
    }
}

@media (max-width: 380px) {
    .asareh-waiting__logo {
        width: clamp(58px, 18vw, 78px) !important;
        max-width: 78px !important;
    }
}

/* ==========================================================
   KIAN DEZH - WAITING LOGO HARD FALLBACK
   هدف:
   - نمایش قطعی لوگو در Waiting همه صفحات
   - مستقل از اشتباه نسبی مسیر در HTML صفحات داخلی
   نکته:
   - مسیر این فایل CSS معمولاً assets/css/asareh-waiting-ca.css است
   - بنابراین ../images/Logo.png یعنی assets/images/Logo.png
   ========================================================== */

.asareh-waiting img.asareh-waiting__logo,
.asareh-waiting__logo {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    width: clamp(76px, 8.4vw, 104px) !important;
    max-width: 104px !important;
    height: auto !important;
    max-height: none !important;
    margin: 0 auto 8px !important;
    object-fit: contain !important;
    position: relative !important;
    z-index: 60 !important;
    content: url("../images/Logo.png") !important;
}

@media (max-width: 1280px),
(max-height: 780px) {

    .asareh-waiting img.asareh-waiting__logo,
    .asareh-waiting__logo {
        width: clamp(72px, 7.6vw, 96px) !important;
        max-width: 96px !important;
        margin-bottom: 7px !important;
    }
}

@media (max-width: 640px) {

    .asareh-waiting img.asareh-waiting__logo,
    .asareh-waiting__logo {
        width: clamp(64px, 19vw, 88px) !important;
        max-width: 88px !important;
        margin-bottom: 6px !important;
    }
}

@media (max-width: 380px) {

    .asareh-waiting img.asareh-waiting__logo,
    .asareh-waiting__logo {
        width: clamp(58px, 18vw, 78px) !important;
        max-width: 78px !important;
    }
}