/* Reset some default styles */
.responsive_table_dng table,
.responsive_table_dng th,
.responsive_table_dng td {
    border: none;
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
}

/* Container for the table */
.responsive_table_dng {
    width: 100%;
    overflow-x: auto;
    margin: 20px 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    background: #fff;
}

/* Table styling */
.responsive_table_dng table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}

/* Table header */
.responsive_table_dng th {
    background-color: #f8f9fa; /* رنگ پس‌زمینه هدر */
    color: #333; /* رنگ متن هدر */
    font-weight: 600;
    padding: 12px 15px;
    text-align: left;
    border-bottom: 2px solid #e9ecef; /* خط پایین هدر */
    font-size: 14px; /* اندازه فونت هدر */
}

/* Table rows */
.responsive_table_dng td {
    padding: 12px 15px;
    border-bottom: 1px solid #e9ecef; /* خط پایین هر ردیف */
    color: #555; /* رنگ متن ردیف‌ها */
    font-size: 14px; /* اندازه فونت ردیف‌ها */
}

/* Hover effect on rows */
.responsive_table_dng tr:hover {
    background-color: #f8f9fa; /* رنگ پس‌زمینه هنگام hover */
}

/* Add to cart button */
.responsive_table_dng .ni_add_to_cart_button {
    background-color: #007bff; /* رنگ دکمه */
    color: #fff; /* رنگ متن دکمه */
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 14px; /* اندازه فونت دکمه */
}

.responsive_table_dng .ni_add_to_cart_button:hover {
    background-color: #0056b3; /* رنگ دکمه هنگام hover */
}

/* Quantity input */
.responsive_table_dng .woocommerce_quantity_input_dng input {
    width: 60px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    font-size: 14px; /* اندازه فونت فیلد تعداد */
}

/* Modal styling */
.modaldng {
    display: none;
    position: fixed;
    z-index: 1000;
    padding-top: 60px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
}

.modaldng .modal-content {
    margin: auto;
    display: block;
    max-width: 80%;
    max-height: 80%;
}

.modaldng .close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.modaldng .close:hover {
    color: #bbb;
}

/* Responsive design */
@media (max-width: 768px) {
    .responsive_table_dng table {
        display: block;
        overflow-x: auto;
    }

    .responsive_table_dng th,
    .responsive_table_dng td {
        white-space: nowrap;
    }

    .responsive_table_dng .ni_add_to_cart_button {
        width: 100%;
        margin-top: 10px;
    }

    .responsive_table_dng .woocommerce_quantity_input_dng input {
        width: 100%;
    }
}



/* وسط‌چین کردن متن و تنظیم عرض ستون‌ها */
.nipv_table th,
.nipv_table td {
    text-align: center; /* وسط‌چین کردن متن */
    vertical-align: middle; /* وسط‌چین کردن عمودی */
    width: 20%; /* تنظیم عرض ستون */
    padding: 10px; /* تنظیم فاصله‌های داخلی */
    border: 1px solid #ddd; /* اضافه‌کردن حاشیه */
}

/* تنظیم عرض جدول به‌صورت کامل */
.nipv_table {
    width: 100%; /* عرض جدول به‌صورت کامل */
    margin: 0 auto; /* وسط‌چین کردن جدول */
}

/* تنظیم عرض ستون‌های داخل جدول */
.nipv_table th,
.nipv_table td {
    width: 100%; /* عرض ستون‌ها به‌صورت کامل */
}

/* تنظیم عرض جدول */
.nipv_table {
    width: 100%; /* عرض جدول به‌صورت کامل */
}

/* تنظیم عرض ستون‌ها */
.nipv_table th,
.nipv_table td {
    width: 100%; /* عرض ستون‌ها */
}

/* تنظیم عرض جدول */
.nipv_table {
    width: 100%; /* عرض جدول */
}
/* تنظیم ابعاد برای td که شامل تصویر است */
.nipv_table td:has(img) {
    width: 66px; /* عرض سلول */
    height: 66px; /* ارتفاع سلول */
    padding: 5px; /* فاصله از چهار طرف */
    text-align: center; /* وسط‌چین کردن محتوا */
}

/* تنظیم ابعاد تصویر داخل td */
.nipv_table td img {
    width: calc(100% - 10px); /* عرض تصویر با احتساب padding */
    height: calc(100% - 10px); /* ارتفاع تصویر با احتساب padding */
    object-fit: cover; /* حفظ نسبت تصویر */
    display: block; /* نمایش به صورت بلوکی */
    margin: 0 auto; /* وسط‌چین کردن تصویر */
}

/* تنظیم عرض بقیه td ها به 100% */
.nipv_table td:not(:has(img)) {
    width: 10%; /* عرض سلول */
    padding: 10px; /* فاصله داخلی */
    text-align: center; /* وسط‌چین کردن محتوا */
}

/* اعمال margin-bottom: 0 برای form با کلاس cart داخل td */
.nipv_table td form.cart {
    margin-bottom: 0 !important;
}
