/* استایل کلی */
.zpb-payment-page {
    max-width: 500px;
    margin: 20px auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    direction: rtl;
    text-align: right;
}

.zpb-payment-page h2 {
    font-size: 24px;
    margin-bottom: 15px;
    color: #333;
}

.zpb-payment-page p {
    font-size: 16px;
    margin: 10px 0;
}

/* جدول سبد خرید */
.zpb-cart-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    margin-bottom: 20px;
}

.zpb-cart-table th,
.zpb-cart-table td {
    padding: 12px;
    text-align: right;
    border-bottom: 1px solid #ddd;
}

.zpb-cart-table th {
    background: #f8f9fa;
    font-weight: bold;
    color: #333;
}

.zpb-cart-table tr:hover {
    background: #f9f9f9;
}

.zpb-cart-table img {
    max-width: 50px;
    height: auto;
    border-radius: 4px;
}

.zpb-remove-from-cart {
    padding: 8px 15px;
    background: #dc3545;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.zpb-remove-from-cart:hover {
    background: #c82333;
}

/* دکمه پرداخت */
.zpb-payment-button {
    display: inline-block;
    padding: 12px 25px;
    background: #007bff;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    font-size: 16px;
    transition: background 0.3s;
    min-width: 120px; /* حداقل عرض برای دکمه */
}

.zpb-payment-button:hover {
    background: #0056b3;
}

/* بخش کد تخفیف */
.zpb-discount-field {
    margin-top: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.zpb-discount-hidden {
    display: none; /* فقط با تیک باز می‌شه */
}

.zpb-discount-visible {
    display: flex; /* حالت باز شده */
}

#zpb-discount-code {
    width: 200px; /* عرض ثابت و معقول */
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

#zpb-apply-discount {
    padding: 8px 15px;
    background: #28a745;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

#zpb-apply-discount:hover {
    background: #218838;
}

#zpb-discount-message {
    margin-top: 10px;
    font-size: 14px;
    color: #666;
    width: 100%;
}

/* لیست تراکنش‌ها */
.zpb-user-transactions {
    max-width: 800px;
    margin: 20px auto;
    direction: rtl;
}

.zpb-user-transactions h2 {
    font-size: 24px;
    margin-bottom: 15px;
    color: #333;
}

.zpb-transactions-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.zpb-transactions-table th,
.zpb-transactions-table td {
    padding: 12px;
    text-align: right;
    border-bottom: 1px solid #ddd;
}

.zpb-transactions-table th {
    background: #f8f9fa;
    font-weight: bold;
    color: #333;
}

.zpb-transactions-table tr:hover {
    background: #f9f9f9;
}

/* جمع کل پرداخت‌ها */
.zpb-user-total {
    max-width: 500px;
    margin: 20px auto;
    text-align: center;
    direction: rtl;
}

.zpb-user-total h3 {
    font-size: 20px;
    color: #333;
}

.zpb-user-total span {
    color: #007bff;
    font-weight: bold;
}

/* ویجت آیکن سبد خرید */
.zpb-cart-icon-widget {
    position: relative;
    display: inline-block;
    direction: rtl;
}

.zpb-cart-icon-container {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.zpb-cart-icon {
    transition: color 0.3s;
}

.zpb-cart-title {
    font-weight: 500;
}

.zpb-cart-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    position: relative;
    top: -10px;
    right: -10px;
}

.zpb-cart-count-pulse {
    animation: zpb-pulse 0.5s ease-in-out;
}

@keyframes zpb-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.zpb-cart-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 300px;
    max-height: 400px;
    overflow-y: auto;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 15px;
    direction: rtl;
}

.zpb-cart-dropdown-hidden {
    display: none;
}

.zpb-cart-dropdown-visible {
    display: block;
    animation: zpb-slide-down 0.3s ease;
}

@keyframes zpb-slide-down {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.zpb-cart-items {
    list-style: none;
    margin: 0;
    padding: 0;
}

.zpb-cart-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-bottom: 1px solid #ddd;
}

.zpb-cart-item img {
    width: 40px;
    height: auto;
    border-radius: 4px;
}

.zpb-cart-item-details {
    flex: 1;
}

.zpb-cart-item-name {
    font-size: 14px;
    color: #333;
}

.zpb-cart-item-amount {
    font-size: 13px;
    color: #666;
}

.zpb-cart-item .zpb-remove-from-cart {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
}

.zpb-cart-total {
    margin: 10px 0;
    font-size: 15px;
    font-weight: bold;
    color: #333;
}

.zpb-cart-buttons {
    display: flex;
    gap: 10px;
}

.zpb-cart-button {
    flex: 1;
    padding: 10px;
    text-align: center;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: background 0.3s;
}

.zpb-cart-button:hover {
    background: #0056b3;
}

.zpb-cart-button[disabled] {
    background: #ccc;
    cursor: not-allowed;
}

/* پاسخگویی */
@media (max-width: 768px) {
    .zpb-cart-dropdown {
        width: 100%;
        max-width: 280px;
    }
}