/* =====================================================================
   Pro Table Widget — pro-table.css  v2.0
   ===================================================================== */

/* ── Reset ─────────────────────────────────────────────────────────── */
.ept-container,
.ept-container * { box-sizing: border-box; }

/* ════════════════════════════════════════════════════════════════════
   TOOLBAR
════════════════════════════════════════════════════════════════════ */
.ept-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

/* ── Search wrap ── */
.ept-search-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex: 0 1 auto;       /* جمع می‌شه در موبایل */
    max-width: 100%;
}

.ept-search-icon {
    position: absolute;
    /* RTL: آیکون سمت راست فیلد */
    right: 12px;
    top: 43%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #94a3b8;
    display: flex;
    align-items: center;
    line-height: 1;
    z-index: 1;
}

.ept-search-input {
    width: 260px;
    max-width: 100%;
    /* padding-right بیشتر برای جا دادن آیکون (RTL) */
    padding: 10px 30px 10px 14px !important;
    font-size: 14px;
    font-family: inherit;
    direction: rtl;
    background: #fff;
    color: #1e293b;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    outline: none;
    transition: border-color .17s ease, box-shadow .17s ease;
    /* حذف استایل پیش‌فرض type=search در همه مرورگرها */
    -webkit-appearance: none;
    appearance: none;
}
.ept-search-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}
.ept-search-input::placeholder { color: #94a3b8; }
/* حذف دکمه clear داخلی Chrome */
.ept-search-input::-webkit-search-cancel-button,
.ept-search-input::-webkit-search-decoration { -webkit-appearance: none; }

/* ── Export button ── */
.ept-export-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 10px 20px;
    font-size: 13.5px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    background: #0d6efd;
    color: #fff;
    border: none;
    border-radius: 8px;
    line-height: 1;
    white-space: nowrap;
    transition: background .17s, transform .15s, box-shadow .17s;
    flex-shrink: 0;
}
.ept-export-btn:hover {
    background: #0b5ed7;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13,110,253,.28);
}
.ept-export-btn:active { transform: none; box-shadow: none; }

/* ════════════════════════════════════════════════════════════════════
   CARD (outer shell — shadow & radius)
════════════════════════════════════════════════════════════════════ */
.ept-card {
    position: relative;          /* برای .ept-header-shield */
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 16px rgba(0,0,0,.09);
}

/* ── Shield — لایه‌ای که بالای هدر sticky رو می‌پوشونه ──
   این از طریق JS کنترل می‌شه (display:none در ابتدا)
   رنگش هم از JS ست می‌شه                                         */
.ept-header-shield {
    display: none;               /* JS این رو block می‌کنه */
    position: absolute;
    top: 0; left: 0; right: 0;
    pointer-events: none;
    z-index: 19;
}

/* ════════════════════════════════════════════════════════════════════
   WRAP + SCROLL AREA
════════════════════════════════════════════════════════════════════ */
.ept-wrap {
    position: relative;
}

/*
   .ept-scroll-area:
   - overflow توسط JS ست می‌شه
   - max-height از Elementor selector ست می‌شه (وقتی sticky فعاله)
   - scrollbar ظریف
*/
.ept-scroll-area {
    width: 100%;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}
.ept-scroll-area::-webkit-scrollbar       { width: 5px; height: 5px; }
.ept-scroll-area::-webkit-scrollbar-track { background: transparent; }
.ept-scroll-area::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
.ept-scroll-area::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ════════════════════════════════════════════════════════════════════
   TABLE
════════════════════════════════════════════════════════════════════ */
.ept-table {
    width: 100%;
    border-collapse: collapse;
    direction: rtl;
    text-align: right;
    /*
       min-width: مانع له شدن جدول وقتی اسکرول افقی فعاله.
       scroll-area overflow-x:auto است، table min-width دارد →
       وقتی viewport کوچک‌تر از min-width باشه، scroll-area افقی می‌شه.
    */
    min-width: 480px;
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

/* ── THEAD ── */
.ept-table thead th {
    background-color: #1a3c6e;    /* پیش‌فرض — Elementor override می‌کنه */
    color: #fff;
    padding: 14px 16px;
    font-weight: 700;
    font-size: 13.5px;
    letter-spacing: .2px;
    white-space: nowrap;
    text-align: right;
    border-bottom: 2px solid rgba(255,255,255,.12);
    user-select: none;
    position: relative;            /* برای .ept-sort-icon */
    /*
       STICKY کار می‌کنه چون:
       1. JS روی thead: position:sticky; top:0; z-index:20 می‌زاره
       2. scroll-area overflow-y:auto داره (JS)
       3. background اینجا solid هست → محتوا از پشت دیده نمی‌شه
       background-clip مطمئن می‌کنه border روی رنگ اصلی باشه
    */
    background-clip: padding-box;
}

/* ── Sort ── */
.ept-table thead th.ept-sortable {
    cursor: pointer;
    /* فضا برای آیکون sort در سمت چپ (RTL) */
    padding-left: 30px;
}
.ept-table thead th.ept-sortable:hover {
    background-color: rgba(255,255,255,.07);
}

.ept-sort-icon {
    position: absolute;
    left: 9px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    pointer-events: none;
}
.ept-sort-icon .ept-up,
.ept-sort-icon .ept-down { transition: opacity .14s, fill .14s; }

.ept-hdr-icon {
    display: inline-flex;
    align-items: center;
    margin-left: 5px;
    vertical-align: middle;
}
.ept-hdr-icon i { font-size: 14px; }

/* ── TBODY ── */
.ept-table tbody td {
    padding: 13px 16px;
    color: #2d3748;
    border-bottom: 1px solid #e9eef5;
    vertical-align: middle;
    transition: background-color .13s;
    word-break: break-word;
}
.ept-table tbody tr:last-child td { border-bottom: none; }

/* Striped */
.ept-striped .ept-table tbody tr:nth-child(even) td { background-color: #fff; }
.ept-striped .ept-table tbody tr:nth-child(odd)  td { background-color: #f7f9fc; }

/* Hover */
.ept-hoverable .ept-table tbody tr:hover td { background-color: #eff6ff; }

/* Highlighted */
.ept-table tbody tr.ept-highlighted td {
    background-color: #fef9c3 !important;
    font-weight: 600;
}

/* Sub-header row */
.ept-table tbody tr.ept-subheader th,
.ept-table tbody tr.ept-subheader td {
    background-color: #e8edf5 !important;
    color: #334155;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: .5px;
    text-transform: uppercase;
    border-top: 2px solid #dde4f0;
    border-bottom: 2px solid #dde4f0;
}

/* Cell icons */
.ept-ico     { display: inline-flex; align-items: center; }
.ept-ico-b   { margin-left: 5px; }
.ept-ico-a   { margin-right: 5px; }

/* Cell links */
.ept-table tbody td a,
.ept-table tbody th a { color: #2563eb; text-decoration: none; }
.ept-table tbody td a:hover { text-decoration: underline; }

/* ════════════════════════════════════════════════════════════════════
   RESPONSIVE — کاملاً ریسپانسیو در همه سایز‌ها
════════════════════════════════════════════════════════════════════ */

/* tablet */
@media (max-width: 1024px) {
    .ept-table { font-size: 13.5px; }
}

/* mobile (≤767px) */
@media (max-width: 767px) {

    /* Toolbar: ستونی بشه، همه عناصر full-width */
    .ept-toolbar {
        flex-direction: column;
        align-items: stretch !important;
        justify-content: stretch !important;
        gap: 8px;
    }
    .ept-search-wrap  { width: 100%; display: block; position: relative; }
    .ept-search-icon  { right: 12px; }     /* آیکون جایش ثابت می‌مونه */
    .ept-search-input { width: 100% !important; font-size: 16px; /* جلوگیری از zoom روی iOS */ }
    .ept-export-btn   { width: 100%; justify-content: center; padding: 12px 20px; }

    /* Table */
    .ept-table {
        min-width: 480px;    /* scroll-area افقی می‌شه وقتی viewport کوچیکتره */
        font-size: 13px;
    }
    .ept-table thead th { padding: 10px 12px; font-size: 12.5px; }
    .ept-table tbody td { padding: 10px 12px; }

    /* Card */
    .ept-card { border-radius: 8px; }
}

/* small mobile (≤480px) */
@media (max-width: 480px) {
    .ept-table {
        min-width: 360px;
        font-size: 12.5px;
    }
    .ept-table thead th { padding: 9px 10px; font-size: 12px; }
    .ept-table tbody td { padding: 9px 10px; }
    .ept-search-input   { font-size: 16px; padding: 12px 38px 12px 12px; }
}

/* ════════════════════════════════════════════════════════════════════
   ELEMENTOR EDITOR
════════════════════════════════════════════════════════════════════ */
.elementor-editor-active .ept-table tbody tr   { transition: none; }
.elementor-editor-active .ept-scroll-area      { overflow: auto !important; }
