/* ═══════════════════════════════════════════════════════════════
   Khalij WooCommerce Filter v3  —  DMRoom Agency
   ═══════════════════════════════════════════════════════════════ */

.kf-wrap { direction: rtl; font-family: inherit; }

/* ── Sidebar ─────────────────────────────────────────────────── */
.kf-sidebar {
    background: #fff;
    border: 1px solid #d8dde6;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,.07);
    width: 100%;
}

/* ── Header ──────────────────────────────────────────────────── */
.kf-header {
    background: #1a5fb4;
    color: #fff;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
}

/* ── Body ────────────────────────────────────────────────────── */
.kf-body {
    padding: 14px 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}



/* ── Group ───────────────────────────────────────────────────── */
.kf-group { border-bottom: 1px solid #f0f2f5; }
.kf-group:last-of-type { border-bottom: none; }

/* ── Group Header ────────────────────────────────────────────── */
.kf-group-header {
    width: 100%;
    background: none;
    border: none;
    padding: 10px 4px;
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;       /* کوچک‌تر از قبل */
    font-weight: 600;
    color: #222;
    cursor: pointer;
    text-align: right;
    direction: rtl;
    line-height: 1.3;
}
.kf-group-header:hover { color: #1a5fb4; }

.kf-gh-icon {
    color: #1a5fb4;
    font-size: 14px;
    width: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.kf-gh-icon svg, .kf-gh-icon i { width: 1em; height: 1em; }

.kf-gh-text { flex: 1; text-align: right; }

.kf-chevron {
    font-size: 10px;
    color: #aaa;
    margin-right: auto;   /* push to left */
    margin-left: 0;
    transition: transform .2s;
    flex-shrink: 0;
}
.kf-collapsed .kf-chevron { transform: rotate(-90deg); }
.kf-collapsed .kf-group-body { display: none; }

/* ── Group Body ──────────────────────────────────────────────── */
.kf-group-body { padding: 2px 4px 14px; }

/* ── Checkbox / Radio List ───────────────────────────────────── */
.kf-list {
    list-style: none; margin: 0; padding: 0;
    max-height: 200px; overflow-y: auto;
}
.kf-list::-webkit-scrollbar { width: 3px; }
.kf-list::-webkit-scrollbar-thumb { background: #ddd; border-radius: 3px; }

.kf-list li { margin: 0; }
.kf-list label {
    display: flex; align-items: center; gap: 7px;
    padding: 5px 2px; cursor: pointer;
    font-size: 13px; color: #444; direction: rtl;
    transition: color .12s;
}
.kf-list label:hover { color: #1a5fb4; }
.kf-list input[type="checkbox"],
.kf-list input[type="radio"] {
    accent-color: #1a5fb4;
    width: 15px; height: 15px; flex-shrink: 0; cursor: pointer;
}
.kf-list label span { flex: 1; }
.kf-list label em { color: #bbb; font-size: 11px; font-style: normal; }

/* ── Dropdown select ─────────────────────────────────────────── */
.kf-select {
    width: 100%; border: 1px solid #d8dde6; border-radius: 6px;
    padding: 7px 10px; font-size: 13px;
    background: #fafbfc; color: #333; outline: none; direction: rtl;
}
.kf-select:focus { border-color: #1a5fb4; }

/* ── Thumbnails ──────────────────────────────────────────────── */
.kf-thumbs {
    list-style: none; margin: 0; padding: 0;
    display: grid; grid-template-columns: repeat(3,1fr); gap: 6px;
}
.kf-thumb-item {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    cursor: pointer; border: 2px solid transparent;
    border-radius: 7px; padding: 4px; transition: border-color .15s;
    position: relative;
}
.kf-thumb-item input { position: absolute; opacity: 0; width: 0; height: 0; }
.kf-thumb-item:hover { border-color: #1a5fb488; }
.kf-thumb-item.kf-selected { border-color: #1a5fb4; box-shadow: 0 0 0 2px #1a5fb428; }
.kf-thumb-item img { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 5px; }
.kf-thumb-text {
    font-size: 11px; text-align: center; background: #e8f0fb;
    border-radius: 5px; padding: 7px 3px; width: 100%;
    font-weight: 600; color: #1a5fb4;
}

/* ═══════════════════════════════════════════════════════════════
   DIMENSION RANGE  (reference image style)
   ═══════════════════════════════════════════════════════════════ */
.kf-dims-body {
    display: flex; flex-direction: column; gap: 16px;
}

.kf-dim-row { display: flex; flex-direction: column; gap: 7px; }

.kf-dim-label {
    font-size: 13px; font-weight: 600; color: #333; text-align: center;
}
.kf-dim-label small { font-size: 11px; color: #888; font-weight: 400; }

.kf-range-inputs {
    display: flex; align-items: center; gap: 6px; direction: ltr;
}
.kf-range-field { flex: 1; }
.kf-range-field input[type="number"] {
    width: 100%;
    border: 1px solid #c8cdd6;
    border-radius: 6px;
    padding: 9px 6px;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    color: #333;
    background: #fff;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    -moz-appearance: textfield;
    appearance: textfield;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.kf-range-field input[type="number"]::-webkit-outer-spin-button,
.kf-range-field input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; }
.kf-range-field input[type="number"]:focus {
    border-color: #1a5fb4;
    box-shadow: 0 0 0 3px rgba(26,95,180,.12);
}
.kf-range-sep { font-size: 12px; color: #aaa; white-space: nowrap; flex-shrink: 0; }

/* Apply button — inside dims group only */
.kf-dims-apply {
    margin-top: 6px;
    width: 100%;
    padding: 10px;
    background: #3cb043;
    color: #fff;
    border: none;
    border-radius: 7px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transition: opacity .15s, transform .1s;
}
.kf-dims-apply:hover { opacity: .88; transform: translateY(-1px); }
.kf-dims-apply:active { transform: translateY(0); }

/* ═══════════════════════════════════════════════════════════════
   PRICE SLIDER
   ═══════════════════════════════════════════════════════════════ */
.kf-dual-slider { position: relative; padding: 20px 6px 8px; }
.kf-track { position: relative; height: 5px; background: #e2e6ea; border-radius: 5px; }
.kf-track-fill { position: absolute; height: 100%; background: #1a5fb4; border-radius: 5px; }
.kf-thumb {
    position: absolute; top: 8px; width: 100%; height: 5px;
    appearance: none; -webkit-appearance: none;
    background: transparent; pointer-events: none; left: 0;
}
.kf-thumb::-webkit-slider-thumb {
    -webkit-appearance: none; width: 19px; height: 19px; border-radius: 50%;
    background: #fff; border: 2px solid #1a5fb4;
    box-shadow: 0 1px 6px rgba(0,0,0,.18);
    cursor: pointer; pointer-events: all; transition: transform .12s;
}
.kf-thumb::-webkit-slider-thumb:hover { transform: scale(1.15); }
.kf-thumb::-moz-range-thumb {
    width: 19px; height: 19px; border-radius: 50%;
    background: #fff; border: 2px solid #1a5fb4;
    cursor: pointer; pointer-events: all;
}
.kf-price-vals {
    display: flex; align-items: center; justify-content: center;
    gap: 4px; margin-top: 10px;
    font-size: 13px; font-weight: 700; color: #333; direction: rtl;
}
.kf-currency { font-size: 11px; color: #888; }

/* ── Bottom reset button ──────────────────────────────────────── */
.kf-actions { margin-top: 10px; }
.kf-reset-btn {
    width: 100%; padding: 9px;
    border: 1.5px solid #d0d5dd;
    border-radius: 7px;
    background: transparent;
    color: #666; font-size: 13px; font-weight: 600;
    cursor: pointer; transition: border-color .12s, color .12s;
}
.kf-reset-btn:hover { border-color: #999; color: #333; }

/* ── Loading overlay روی Loop Grid ───────────────────────────── */
.kf-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,.72);
    backdrop-filter: blur(3px);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}
.kf-spinner {
    width: 40px; height: 40px;
    border: 4px solid #e0e6f0;
    border-top-color: #1a5fb4;
    border-radius: 50%;
    animation: kf-spin .7s linear infinite;
}
@keyframes kf-spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════════════
   HOME SEARCH WIDGET  —  DMRoom Agency
   Selectors are intentionally specific to override Elementor/theme
   ═══════════════════════════════════════════════════════════════ */

.elementor-widget-khalij_home_search .khs-wrap,
.khs-wrap {
    direction: rtl !important;
    font-family: inherit;
    width: 100%;
}

/* ── فرم: flex عمودی ─────────────────────────────────────────── */
.elementor-widget-khalij_home_search .khs-form {
    display: flex !important;
    flex-direction: column !important;
    gap: 22px !important;
    width: 100% !important;
}

/* ── ردیف ۱: دو ستون ─────────────────────────────────────────── */
.elementor-widget-khalij_home_search .khs-row-top {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 20px !important;
    width: 100% !important;
    align-items: end !important;
}

/* ── ردیف ۲: سه ستون ─────────────────────────────────────────── */
.elementor-widget-khalij_home_search .khs-row-dims {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr !important;
    gap: 20px !important;
    width: 100% !important;
    align-items: start !important;
}

/* ── هر فیلد ─────────────────────────────────────────────────── */
.elementor-widget-khalij_home_search .khs-field,
.elementor-widget-khalij_home_search .khs-dim-col {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    min-width: 0 !important;
}

/* ── برچسب ────────────────────────────────────────────────────── */
.elementor-widget-khalij_home_search .khs-label {
    display: block !important;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a2e;
    text-align: right !important;
    margin-bottom: 0 !important;
    line-height: 1.4;
}

/* ── Input عمومی ──────────────────────────────────────────────── */
.elementor-widget-khalij_home_search .khs-input {
    display: block !important;
    width: 100% !important;
    height: 52px !important;
    padding: 0 16px !important;
    border: 1.5px solid #e0e0e0 !important;
    border-radius: 12px !important;
    background: #f2f2f2 !important;
    color: #333 !important;
    font-size: 14px !important;
    outline: none !important;
    box-shadow: none !important;
    transition: border-color .15s, background .15s !important;
    direction: rtl !important;
    box-sizing: border-box !important;
    -moz-appearance: textfield !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    line-height: normal !important;
    margin: 0 !important;
}
.elementor-widget-khalij_home_search .khs-input::placeholder {
    color: #bbb !important;
    font-size: 13px !important;
}
.elementor-widget-khalij_home_search .khs-input:focus {
    border-color: #1a5fb4 !important;
    background: #fff !important;
    box-shadow: 0 0 0 3px rgba(26,95,180,.1) !important;
}
.elementor-widget-khalij_home_search .khs-input::-webkit-inner-spin-button,
.elementor-widget-khalij_home_search .khs-input::-webkit-outer-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}

/* ── Select wrapper ───────────────────────────────────────────── */
.elementor-widget-khalij_home_search .khs-select-wrap {
    position: relative !important;
    display: block !important;
    width: 100% !important;
}

.elementor-widget-khalij_home_search .khs-select-inner {
    display: block !important;
    width: 100% !important;
    height: 52px !important;
    padding: 0 16px 0 36px !important;
    border: 1.5px solid #e0e0e0 !important;
    border-radius: 12px !important;
    background: #f2f2f2 !important;
    color: #999 !important;
    font-size: 14px !important;
    outline: none !important;
    box-shadow: none !important;
    direction: rtl !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
    transition: border-color .15s, background .15s !important;
    margin: 0 !important;
}
.elementor-widget-khalij_home_search .khs-select-inner option {
    color: #333 !important;
}
.elementor-widget-khalij_home_search .khs-select-inner:focus {
    border-color: #1a5fb4 !important;
    background: #fff !important;
    color: #333 !important;
    box-shadow: 0 0 0 3px rgba(26,95,180,.1) !important;
}

.elementor-widget-khalij_home_search .khs-chevron {
    position: absolute !important;
    left: 12px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    font-size: 11px !important;
    color: #999 !important;
    pointer-events: none !important;
    line-height: 1 !important;
}

/* ── جفت ابعاد (از ≤≤ تا) ────────────────────────────────────── */
.elementor-widget-khalij_home_search .khs-dim-pair {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
}

.elementor-widget-khalij_home_search .khs-dim-input {
    flex: 1 !important;
    min-width: 0 !important;
    width: auto !important;
    text-align: center !important;
    padding: 0 4px !important;
}

.elementor-widget-khalij_home_search .khs-dim-lte {
    flex-shrink: 0 !important;
    font-size: 16px !important;
    color: #aaa !important;
    letter-spacing: -2px !important;
    line-height: 1 !important;
}

/* ── دکمه ────────────────────────────────────────────────────── */
.elementor-widget-khalij_home_search .khs-btn {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    width: 100% !important;
    height: 60px !important;
    padding: 0 24px !important;
    background: #1a3d6e !important;
    color: #fff !important;
    border: none !important;
    border-radius: 10px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: background .15s, transform .1s !important;
    box-shadow: none !important;
    text-decoration: none !important;
    line-height: 1 !important;
}
.elementor-widget-khalij_home_search .khs-btn:hover {
    background: #14305a !important;
    transform: translateY(-1px) !important;
    color: #fff !important;
}
.elementor-widget-khalij_home_search .khs-btn:active {
    transform: translateY(0) !important;
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 767px) {
    .elementor-widget-khalij_home_search .khs-row-top {
        grid-template-columns: 1fr !important;
    }
    .elementor-widget-khalij_home_search .khs-row-dims {
        grid-template-columns: 1fr !important;
    }
    .elementor-widget-khalij_home_search .khs-btn {
        height: 52px !important;
        font-size: 15px !important;
    }
}
@media (min-width: 768px) and (max-width: 1024px) {
    .elementor-widget-khalij_home_search .khs-row-dims {
        grid-template-columns: 1fr 1fr !important;
    }
}
