/**
 * تهران وان — فرم جستجوی اقامتگاه ([tehranone_search])
 * هم‌سبک با نوار جستجوی ماکت «نتایج جستجو»: یک نوار سفید یکپارچه با
 * جداکنندهٔ عمودی بین فیلدها و دکمهٔ سبز توپُر.
 *
 * پالت: سبز #0F5446 · خط #C4BCA8 · متن #1A1C1B / #404543
 * (قبلاً خط #E7E7E7 و متن #808080 بود؛ چون فرم «پریده و کم‌رنگ» دیده می‌شد پررنگ شد)
 */

/* توکن‌های طراحی پنل فیلتر (بر پایهٔ طرح مرجع: پالت گرم + سبز تیره) */
:root {
    --tn-green: #0F5446;
    --tn-green-dark: #0A3B31;
    --tn-green-tint: #E8F3F0;
    --tn-gold: #C8A15A;
    --tn-gold-tint: #F8F3E9;
    --tn-ink: #1A1C1B;
    --tn-ink-soft: #404543;
    --tn-muted: #565C59;
    --tn-faint: #9BA3A0;
    --tn-line: #C4BCA8;
    --tn-cream: #FBF9F4;
    --tn-cream-2: #F4EFE6;
    --tn-radius: 18px;
    --tn-ease: cubic-bezier(.16, 1, .3, 1);
}

.tn-search {
    direction: rtl;
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr .9fr auto;
    align-items: stretch;
    background: #fff;
    border: 1px solid var(--tn-line);
    border-radius: 18px;
    box-shadow: 0 10px 30px -12px rgba(15, 84, 70, .18);
    font-family: var(--e-global-typography-text-font-family, inherit);
    font-size: 15px;
    color: #444444;
}

.tn-field {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    min-width: 0;
    padding: 11px 18px;
    border-inline-start: 1px solid var(--tn-line);
}
.tn-field:first-child { border-inline-start: 0; }

.tn-field label {
    margin: 0;
    text-align: center;
    font-size: 12px;
    font-weight: 800;
    color: var(--tn-ink);
    padding-inline: 30px; /* دو طرف برابر تا برچسب واقعاً وسط فیلد بنشیند */
}

/* ---------- نشان مرحله (دایرهٔ عددی گوشهٔ هر فیلد) ---------- */
.tn-step {
    position: absolute;
    top: 8px;
    inset-inline-start: 12px;
    z-index: 2;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--tn-green-tint);
    color: var(--tn-green);
    border: 2px solid var(--tn-green);
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    display: grid;
    place-items: center;
}

.tn-field input,
.tn-date-input {
    width: 100%;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    font: inherit;
    font-size: 14.5px;
    color: #444444;
    text-align: right;
    text-overflow: ellipsis;
    outline: none;
    cursor: pointer;
}
.tn-field input::placeholder { color: #b6b6b6; }
.tn-date-input:disabled { color: #b6b6b6; cursor: not-allowed; }
.tn-date-input[readonly] { cursor: pointer; }

/* ---------- فهرست کشویی شهر ---------- */
.tn-dropdown {
    position: absolute;
    top: 100%;
    inset-inline: 0;
    z-index: 50;
    margin: 6px 0 0;
    padding: 6px 0;
    list-style: none;
    background: #fff;
    border: 1px solid var(--tn-line);
    border-radius: 14px;
    box-shadow: 0 14px 34px -12px rgba(15, 84, 70, .28);
    max-height: 260px;
    overflow-y: auto;
}
.tn-dropdown li { padding: 8px 18px; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tn-dropdown .tn-suggest-count {
    margin-inline-start: auto;
    color: #6B7280;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}
.tn-dropdown li:hover,
.tn-dropdown li.is-selected { background: #F2F7F5; color: #0F5446; }
.tn-dropdown li:hover .tn-suggest-count,
.tn-dropdown li.is-selected .tn-suggest-count { color: #0F5446; }

/* ---------- شمارندهٔ نفرات ---------- */
.tn-counter {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    direction: ltr;
}
.tn-search .tn-counter button {
    flex: none;
    width: 26px;
    height: 26px;
    border: 1px solid rgba(15, 84, 70, .45);
    border-radius: 50%;
    background: var(--tn-green-tint);
    color: var(--tn-green);
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}
.tn-search .tn-counter button:hover { background: #0F5446; border-color: #0F5446; color: #fff; }
.tn-search .tn-counter input { width: 100%; text-align: center; }

/* ---------- دکمهٔ جستجو ---------- */
.tn-search .tn-submit {
    border: 0;
    /* فقط گوشه‌های بیرونی (سمت چپ در RTL) هم‌شعاع فرم گرد می‌شوند */
    border-radius: 17px 0 0 17px;
    padding: 0 30px;
    background: #0F5446;
    color: #fff;
    font-family: inherit;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: background .2s;
}
.tn-search .tn-submit:hover { background: #0B3F34; }
.tn-search .tn-submit.is-disabled { background: #6F8A83; cursor: not-allowed; }

/* ---------- نوار فیلترهای فعال (صفحهٔ نتایج) ---------- */
/* یک ردیف است و در همهٔ اندازه‌ها افقی اسکرول می‌شود (چیپ‌ها فشرده نمی‌شوند) */
.tn-filters {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    padding-bottom: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    direction: rtl;
    font-family: var(--e-global-typography-text-font-family, inherit);
    font-size: 12.5px;
}

.tn-filters > * { flex: 0 0 auto; }

.tn-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    background: #fff;
    border: 1px solid var(--tn-line);
    border-radius: 999px;
    box-shadow: 0 1px 3px rgba(27, 38, 35, .04);
    color: var(--tn-ink);
    font-weight: 700;
    transition: border-color .22s var(--tn-ease), box-shadow .22s var(--tn-ease);
}

.tn-chip:hover {
    border-color: rgba(15, 84, 70, .4);
    box-shadow: 0 6px 16px -6px rgba(15, 84, 70, .28);
}

/* چیپ ویژگی‌های روشن (مناسب مراسم، رزرو فوری) رنگ تأکیدی می‌گیرد */
.tn-chip--tint {
    background: var(--tn-green-tint);
    border-color: rgba(15, 84, 70, .22);
    color: var(--tn-green);
}

.tn-filters .tn-chip__remove {
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--tn-cream-2);
    color: var(--tn-ink-soft);
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: background .2s, color .2s;
}

.tn-filters .tn-chip__remove:hover { background: var(--tn-green); color: #fff; }

.tn-filters .tn-chip__remove:focus-visible,
.tn-filters .tn-filters__clear:focus-visible {
    outline: 2px solid var(--tn-green);
    outline-offset: 2px;
}

.tn-filters__clear {
    padding: 7px 10px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--tn-muted);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, color .2s;
}

.tn-filters__clear:hover { background: var(--tn-cream-2); color: var(--tn-green); }

/* تعداد اقامتگاه‌های آزاد، کنار تیتر بالای نتایج (search-form.js می‌سازد) */
.tn-archive-count {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-inline-start: 12px;
    padding: 5px 14px;
    border-radius: 999px;
    background: rgba(15, 84, 70, .08);
    color: var(--tn-green);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    vertical-align: middle;
}

.tn-archive-count::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--tn-green);
}

.tn-archive-count b { font-size: 16px; font-weight: 800; }

.tn-filters.is-loading { opacity: .5; pointer-events: none; cursor: progress; }

/* ---------- حالت بارگذاری ایجکس: پردهٔ تمام‌صفحه با مرکز دقیق صفحه ----------
   کلاس را search-form.js روی <html> می‌گذارد (tn-busy). */
html.tn-busy,
html.tn-busy body { cursor: progress; }

html.tn-busy::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: rgba(251, 249, 244, .45);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
}

html.tn-busy::before {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 9999;
    width: 44px;
    height: 44px;
    margin: -22px 0 0 -22px;
    border: 3px solid rgba(15, 84, 70, .18);
    border-top-color: var(--tn-green);
    border-radius: 50%;
    animation: tn-spin .8s linear infinite;
}

@keyframes tn-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    html.tn-busy::before { animation: none; }
}

/* ---------- لوپ پیشنهادها: تا وقتی نتیجه‌ای نیست پنهان است (JS نشانش می‌دهد) ---------- */
.tn-suggestions { display: none; }
.tn-suggestions.is-visible { display: block; margin-top: 24px; }

/* ---------- فیلترهای مستقل ([tn_filter field="sort,type,price,bedrooms,guests,events,instant"]) ----------
   هر فیلد یک فرم جداست و می‌تواند در بخش دیگری از صفحه هم قرار بگیرد:
   یک کارت سفید شناور با فیلدهای گرد و قرص‌های انتخاب. */
.tn-filter-bar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid var(--tn-line);
    border-radius: var(--tn-radius);
    box-shadow: 0 4px 20px -2px rgba(15, 84, 70, .05), 0 12px 32px -4px rgba(27, 38, 35, .04);
    direction: rtl;
    font-family: var(--e-global-typography-text-font-family, inherit);
    font-size: 13px;
    color: var(--tn-ink-soft);
}

/* ردیف فیلدها: در همهٔ اندازه‌ها یک ردیف می‌ماند و افقی اسکرول می‌شود.
   تیتر بیرون این ردیف است تا با اسکرول جابه‌جا نشود. */
.tn-filter-bar__scroll {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-end;
    gap: 10px 8px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    padding-bottom: 4px; /* جا برای نوار اسکرول */
    scrollbar-width: thin;
}

.tn-filter-bar__scroll > .tnf { flex: 0 0 auto; }

.tn-filter-bar__title {
    margin: 0;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .2px;
    color: var(--tn-ink);
}

.tnf {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    min-width: 118px;
}

.tnf__label { font-size: 12px; font-weight: 800; color: var(--tn-ink); text-align: center; }
.tnf__row { display: flex; gap: 6px; }

.tnf__select,
.tnf__num {
    height: 38px;
    padding: 0 10px;
    border: 1px solid var(--tn-line);
    border-radius: 10px;
    background: var(--tn-cream);
    color: var(--tn-ink);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    text-align: right;
    transition: border-color .22s var(--tn-ease), box-shadow .22s var(--tn-ease), background .22s var(--tn-ease);
}

.tnf__select:focus,
.tnf__num:focus {
    outline: 0;
    border-color: var(--tn-green);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(15, 84, 70, .12);
}

.tnf__select {
    /* بدون flex-basis: والد چیدمان ستونی دارد و basis به ارتفاع تبدیل می‌شد */
    width: 100%;
    min-width: 0;
    padding-left: 28px; /* جا برای فلش سمت چپ (RTL) */
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23717875' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 8px center;
    background-size: 12px 12px;
}

.tnf__num { width: 88px; text-align: center; }
.tnf__num::placeholder { color: var(--tn-faint); font-weight: 500; }

/* قیمت: هر ورودی با معادل حروفی‌اش یک خانه است و زیر هم می‌نشینند */
.tnf__price {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.tnf__words {
    min-height: 1.3em;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--tn-muted);
    text-align: center;
    white-space: nowrap;
}

/* مرتب‌سازی: قرص سه‌گزینه‌ای (رادیوهای پنهان + برچسب قرصی) */
.tnf__segment {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    background: var(--tn-cream-2);
    border: 1px solid var(--tn-line);
    border-radius: 999px;
}

.tnf__seg { position: relative; display: inline-flex; cursor: pointer; }

.tnf__seg input,
.tnf__toggle input {
    position: absolute;
    inset: 0;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.tnf__seg span {
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 11.5px;
    line-height: 18px;
    font-weight: 600;
    color: var(--tn-ink-soft);
    white-space: nowrap;
    transition: background .22s var(--tn-ease), color .22s var(--tn-ease), box-shadow .22s var(--tn-ease);
}

.tnf__seg:hover span { color: var(--tn-green); }

.tnf__seg input:checked + span {
    background: var(--tn-green);
    color: #fff;
    font-weight: 800;
    box-shadow: 0 2px 10px rgba(15, 84, 70, .25);
}

/* ویژگی‌ها: قرص روشن/خاموش با نقطهٔ نشانگر */
.tnf__toggle { position: relative; display: inline-flex; cursor: pointer; }

.tnf__toggle span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 12px;
    background: #fff;
    border: 1px solid var(--tn-line);
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--tn-ink-soft);
    white-space: nowrap;
    transition: background .22s var(--tn-ease), border-color .22s var(--tn-ease), color .22s var(--tn-ease);
}

.tnf__toggle span::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--tn-faint);
    transition: background .22s var(--tn-ease), box-shadow .22s var(--tn-ease);
}

.tnf__toggle:hover span { border-color: rgba(15, 84, 70, .35); }

.tnf__toggle input:checked + span {
    background: var(--tn-green-tint);
    border-color: rgba(15, 84, 70, .35);
    color: var(--tn-green);
    font-weight: 800;
}

.tnf__toggle input:checked + span::before {
    background: var(--tn-green);
    box-shadow: 0 0 0 3px rgba(15, 84, 70, .15);
}

.tnf__seg input:focus-visible + span,
.tnf__toggle input:focus-visible + span {
    outline: 2px solid var(--tn-green);
    outline-offset: 2px;
}

.tnf__go {
    height: 38px;
    padding: 0 14px;
    border: 0;
    border-radius: 10px;
    background: var(--tn-green);
    color: #fff;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s;
}

.tnf__go:hover { background: var(--tn-green-dark); }
.tnf.is-loading { opacity: .5; pointer-events: none; }

/* با جاوااسکریپت خودِ فیلد با تغییرش ارسال می‌شود، پس دکمهٔ «اعمال» لازم نیست */
.tn-js .tnf__go { display: none; }

/* ردیف فیلدها در همهٔ اندازه‌ها یک ردیفِ اسکرول‌شونده است؛ فقط فاصله‌ها جمع‌وجورتر می‌شود */
@media (max-width: 980px) {
    .tn-filter-bar { padding: 12px; }
}

@media (max-width: 600px) {
    .tn-filter-bar { padding: 10px; }
}

/* ---------- کارت اقامتگاه ---------- */
/* تصویر شاخص در قالب لوپ عرض ثابت ۵۰۰px دارد (هم روی ویجت، هم روی لینک
   درونش) به‌همراه max-width: ۱۰۰٪. تا وقتی کارت از ۵۲۰px باریک‌تر است مشکلی
   دیده نمی‌شود، اما در حالت یک‌ستونهٔ ۵۲۰ تا ۷۶۷ تصویر به یک لبه می‌چسبد و
   طرف دیگرش خالی می‌ماند. اینجا تمام‌عرض می‌شود؛ در بقیهٔ اندازه‌ها هم
   عملاً همین‌طور بوده (عرض کارت منهای پدینگ). */
.e-loop-item .elementor-widget-theme-post-featured-image,
.e-loop-item .elementor-widget-theme-post-featured-image > a,
.e-loop-item .elementor-widget-theme-post-featured-image img { width: 100% !important; }

/* ---------- واکنش‌گرا ---------- */
@media (max-width: 980px) {
    .tn-search { grid-template-columns: 1fr; }
    .tn-field { border-inline-start: 0; border-top: 1px solid var(--tn-line); }
    .tn-search .tn-submit {
        grid-column: auto;
        padding: 15px;
        border-top: 1px solid var(--tn-line);
        border-radius: 0 0 17px 17px;
    }

    /* گام‌به‌گام (data-step از search-form.js): در حالت واکنش‌گرا فقط گام
       جاری دیده می‌شود؛ گام‌های قبلی فقط پنهان می‌شوند و مقدارشان در
       ورودی‌های مخفی می‌ماند تا با ارسال فرم برود.
       گام‌ها: ۱ شهر · ۲ تاریخ · ۳ همهٔ فیلدها + دکمهٔ جستجو */
    .tn-search[data-step="1"] .tn-field:not(.tn-city),
    .tn-search[data-step="2"] .tn-field:not(.tn-date),
    .tn-search[data-step="1"] .tn-submit,
    .tn-search[data-step="2"] .tn-submit { display: none; }

    /* اولین فیلدِ نمایانِ هر گام، خط جداکنندهٔ بالا ندارد */
    .tn-search[data-step="1"] .tn-city,
    .tn-search[data-step="2"] .tn-date--in,
    .tn-search[data-step="3"] .tn-city { border-top: 0; }
}

/* ============================================
   Elementor Kit Override
   ------------------------------------------------------------
   کیت المنتور (elementor-kit-6 → post-6.css) و reset قالب والد
   (hello-elementor) روی هر input/button استایل عمومی می‌گذارند
   (پس‌زمینهٔ روشن، border و شعاع) و دقت سلکتورشان از این فایل
   بیشتر است. داخل فرم جستجو با !important بی‌اثر می‌شوند تا نوار
   یکپارچه بماند. تنها جاهایی که مجبور بوده‌ایم !important بدهیم
   همین ورودی‌ها هستند.
   ============================================ */
.tn-search .tn-field input,
.tn-search .tn-date-input {
    text-align: center;
    font-size: 13px !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    -webkit-appearance: none;
    appearance: none;
}

/* همان داستان برای فیلترهای مستقل (select و عدد) — به‌جز دکمه‌ها، رادیو/چک‌باکس قرصی
   و ورودی‌های مخفی. */
.tn-filter-bar .tnf select,
.tn-filter-bar .tnf input:not([type="radio"]):not([type="checkbox"]):not([type="hidden"]) {
    height: 38px !important;
    padding: 0 10px !important;
    border: 1px solid var(--tn-line) !important;
    border-radius: 10px !important;
    background-color: var(--tn-cream) !important;
    background-image: none !important;
    color: var(--tn-ink) !important;
    box-shadow: none !important;
    -webkit-appearance: none;
    appearance: none;
}

/* ورودی قیمت عرض ثابت دارد، وگرنه reset قالب والد (width: 100% روی
   input[type=number]) هر کدام را تمام‌عرض می‌کند. */
.tn-filter-bar .tnf__num { width: 88px !important; }

.tn-filter-bar .tnf select {
    padding-left: 28px !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23717875' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: left 8px center !important;
    background-size: 12px 12px !important;
}

.tn-filter-bar .tnf select:focus,
.tn-filter-bar .tnf input:focus:not([type="radio"]):not([type="checkbox"]):not([type="hidden"]) {
    border-color: var(--tn-green) !important;
    background-color: #fff !important;
    box-shadow: 0 0 0 3px rgba(15, 84, 70, .12) !important;
}

/* === پیشنهاد ویژه: شهرها (جداکنندهٔ هدر) === */
.tn-dropdown .tn-suggest-featured {
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .2px;
  color: #0F5446;
  background: #EFF6F2;
  border-bottom: 1px solid #E4EAE7;
  cursor: default;
  pointer-events: none;
}
.tn-dropdown .is-featured {
  color: #0F5446;
  font-weight: 600;
}

/* === کلیدواژه‌ها/انواع: مینیمال، بدون پیشوند «#» === */
.tn-dropdown .tn-suggest-keyword,
.tn-dropdown .tn-suggest-type {
  color: #0E4D3C;
  font-weight: 600;
  justify-content: flex-start;
  width: 100%;
}
html.to-dark .tn-dropdown .tn-suggest-keyword,
html.to-dark .tn-dropdown .tn-suggest-type {
  color: #9FEFDF;
}
