/*
 * استایل‌های پایه برای جدول محصولات
 */
.cpt-container {
    width: 100%;
    overflow-x: auto; /* برای نمایش بهتر در موبایل */
    direction: rtl;
    font-family: inherit; /* ارث بری فونت از قالب */
}

.cpt-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 1rem;
    text-align: right;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    background-color: #fff;
}

.cpt-table th, .cpt-table td {
    padding: 12px 15px;
    border: 1px solid #ddd;
}

.cpt-table th {
    background-color: #f8f9fa;
    color: #333;
    font-weight: bold;
    text-transform: uppercase;
}

.cpt-table tbody tr:nth-of-type(even) {
    background-color: #f9f9f9;
}

.cpt-table tbody tr:hover {
    background-color: #f1f1f1;
}

.cpt-table a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.cpt-table a:hover {
    text-decoration: underline;
}

.cpt-button {
    display: inline-block;
    padding: 8px 16px;
    background-color: #007bff;
    color: #ffffff;
    border: none;
    border-radius: 5px;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
    white-space: nowrap;
}

.cpt-button:hover {
    background-color: #0056b3;
    text-decoration: none;
    color: #fff;
}


/* صفحه‌بندی */
.cpt-pagination {
    text-align: center;
    margin-top: 20px;
}

.cpt-pagination .page-numbers {
    display: inline-block;
    padding: 8px 14px;
    margin: 0 4px;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.cpt-pagination .page-numbers:hover,
.cpt-pagination .page-numbers.current {
    background-color: #007bff;
    color: #ffffff;
    border-color: #007bff;
}

/* استایل واکنش‌گرا برای موبایل */
@media screen and (max-width: 600px) {
    .cpt-table thead {
        display: none;
    }

    .cpt-table, .cpt-table tbody, .cpt-table tr, .cpt-table td {
        display: block;
        width: 100%;
    }

    .cpt-table tr {
        margin-bottom: 15px;
        border: 1px solid #ddd;
    }

    .cpt-table td {
        text-align: left;
        padding-left: 50%;
        position: relative;
    }

    .cpt-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 10px;
        width: 45%;
        padding-right: 10px;
        font-weight: bold;
        text-align: right;
    }
}


/* استایل لودر ایجکس */
.cpt-table-wrapper {
    position: relative;
    min-height: 150px; /* حداقل ارتفاع برای نمایش لودر */
}

.cpt-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: 99;
    display: flex;
    justify-content: center;
    align-items: center;
}

.cpt-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db; /* این رنگ توسط استایل درون‌خطی بازنویسی می‌شود */
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

