/**
 * Seebox Design System
 * توکن‌های رنگ/فاصله/گردی مشترک بین بج محصول، پاپ‌آپ‌ها و صفحه‌ی تکمیل وجه.
 * مقادیر پیش‌فرض دقیقاً منطبق با طراحی بج سیباکس است.
 * مقادیر می‌توانند از تنظیمات ادمین (wc_deposits_seebox_design) بازنویسی شوند
 * که به‌صورت inline style روی :root در PHP تزریق می‌شود.
 */

:root {
    --seebox-primary: #10ca46;
    --seebox-primary-light: #0ed93f;
    --seebox-primary-dark: #0fb840;
    --seebox-danger: #e74c3c;
    --seebox-text: #000000;
    --seebox-text-muted: #9f9f9f;
    --seebox-text-secondary: #555555;
    --seebox-border: #e5e5e5;
    --seebox-surface: #ffffff;
    --seebox-surface-muted: #f5f5f7;
    --seebox-surface-alt: #f8f9fa;
    --seebox-radius-box: 8px;
    --seebox-radius-pill: 999px;
    --seebox-radius-sm: 4px;
    --seebox-shadow: 0 10px 35px rgba(0, 0, 0, 0.18);
    --seebox-font-size-title: 20px;
    --seebox-font-size-base: 14.5px;
    --seebox-font-size-sm: 12px;
    --seebox-font-size-xs: 11px;
}

/* ---------- جعبه‌ی مراحل (بج، پاپ‌آپ، تکمیل وجه مشترک) ---------- */
.seebox-deposit-box {
    width: 100%;
    background: var(--seebox-surface-muted);
    border-radius: var(--seebox-radius-sm);
    padding: 12px;
    margin: 25px auto;
    direction: rtl;
    position: relative;
    box-sizing: border-box;
}

.seebox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.seebox-title {
    font-size: var(--seebox-font-size-title);
    font-weight: bold;
    color: var(--seebox-text);
}

.seebox-desc {
    font-size: var(--seebox-font-size-base);
    color: var(--seebox-text) !important;
    margin: 15px 0;
    text-align: right;
}

.seebox-desc .woocommerce-Price-amount,
.seebox-deposit-box .woocommerce-Price-amount {
    color: var(--seebox-text) !important;
    font-weight: bold !important;
}

.seebox-steps {
    margin-top: 10px;
    position: relative;
    padding-right: 10px;
}

.seebox-step {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 10px 0;
    position: relative;
}

.seebox-step + .seebox-step {
    margin-top: 6px;
    padding-top: 12px;
    position: relative;
    border-top: none;
}

.seebox-step + .seebox-step::before {
    content: "";
    position: absolute;
    top: 0;
    right: 32px;
    width: 96%;
    height: 1px;
    background: var(--seebox-border);
}

.seebox-progress-circle {
    position: relative;
    width: 24px;
    height: 24px;
    margin-left: 10px;
}

.seebox-progress-circle::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--seebox-surface);
    z-index: 1;
}

.seebox-progress-circle::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(var(--seebox-primary-light) 0deg, var(--seebox-primary) var(--progress, 0deg), transparent var(--progress, 0deg));
    z-index: 2;
    -webkit-mask: radial-gradient(circle 10px at center, transparent 10px, black 10.1px);
    mask: radial-gradient(circle 10px at center, transparent 9px, black 10.1px);
}

.seebox-step:not(:last-child)::after {
    content: "";
    position: absolute;
    right: 11px;
    top: 33px;
    width: 3px;
    height: 46px;
    background: linear-gradient(to bottom, var(--seebox-surface), var(--seebox-surface));
    z-index: 1;
    border: none;
}

.seebox-step-details {
    flex: 1;
    text-align: right;
}

.seebox-step-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--seebox-text);
}

.seebox-step-desc {
    font-size: var(--seebox-font-size-xs);
    color: var(--seebox-text-muted);
    margin-top: 2px;
}

.seebox-step-amount {
    font-size: var(--seebox-font-size-sm);
    font-weight: bold;
    color: var(--seebox-text) !important;
    min-width: 70px;
    text-align: left;
}

.seebox-next-payment {
    font-size: var(--seebox-font-size-xs);
    color: var(--seebox-text-muted);
    text-align: left;
    margin-top: 3px;
}

/* ---------- Powered by ---------- */
.seebox-powered-wrapper {
    text-align: center;
    margin-top: 16px;
}

.seebox-powered,
.seebox-powered-link {
    font-size: 10px;
    color: var(--seebox-text-muted);
    opacity: 0.6;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: opacity 0.3s ease;
}

.seebox-powered-link:hover {
    opacity: 1;
}

.seebox-logo svg {
    height: 14px;
    width: auto;
    display: inline-block;
}

/* ---------- بج قابل‌کلیک روی صفحه محصول ---------- */
.custom-deposit-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    font-size: 15px;
    color: var(--seebox-text);
    line-height: 1.8;
    font-weight: normal;
    margin-top: 10px;
    cursor: pointer;
}

.custom-deposit-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.custom-deposit-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.custom-deposit-text strong {
    font-weight: bold;
}

.custom-deposit-note {
    margin-top: 4px;
    margin-right: 30px;
    font-size: 14px;
    color: var(--seebox-text-secondary);
}

.custom-deposit-note a {
    text-decoration: underline;
    color: var(--seebox-text);
}

.custom-deposit-info .woocommerce-Price-amount,
.custom-deposit-info .woocommerce-Price-amount span {
    color: var(--seebox-text) !important;
}

/* ---------- مودال بج ---------- */
#deposit-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

#deposit-modal > div {
    background: var(--seebox-surface);
    border-radius: var(--seebox-radius-box);
    max-width: 450px;
    width: 90%;
    padding: 20px;
    direction: rtl;
    position: relative;
    color: var(--seebox-text);
    box-sizing: border-box;
}

#deposit-modal-close {
    position: absolute;
    top: 10px; left: 10px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--seebox-text);
}

/* ---------- پاپ‌آپ تایید پرداخت / مهمان (checkout-mode-slider) ---------- */
.wc-popup-modal {
    position: fixed !important;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.45);
    display: flex !important;
    justify-content: center;
    align-items: center;
    z-index: 999999 !important;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out;
}

.wc-popup-modal.is-visible {
    opacity: 1;
    visibility: visible;
}

.wc-popup-content {
    background: var(--seebox-surface);
    padding: 30px;
    border-radius: 14px;
    max-width: 450px;
    width: 90%;
    position: relative;
    box-shadow: var(--seebox-shadow);
    transform: scale(0.96);
    transition: transform 0.3s ease-in-out;
}

.wc-popup-modal.is-visible .wc-popup-content {
    transform: scale(1);
}

.wc-popup-close {
    position: absolute;
    top: 12px; left: 12px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--seebox-text-secondary);
}

.seebox-inner-box {
    background: var(--seebox-surface-muted);
    border-radius: var(--seebox-radius-box);
    padding: 15px;
    text-align: right;
    margin-top: 15px;
    color: var(--seebox-text-muted);
    font-size: var(--seebox-font-size-sm);
}

.wc-popup-buttons {
    margin-top: 20px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.wc-popup-buttons .button-confirm,
.wc-popup-buttons .button-cancel,
.wc-popup-content > a.button {
    flex: 1;
    padding: 12px;
    font-size: 16px;
    border-radius: var(--seebox-radius-sm);
    border: none;
    cursor: pointer;
    font-weight: 600;
    text-align: center;
}

.wc-popup-buttons .button-confirm,
.wc-popup-content > a.button {
    background: var(--seebox-primary);
    color: #fff;
}

.wc-popup-buttons .button-cancel {
    background: var(--seebox-danger);
    color: #fff;
    font-weight: 500;
}

/* ---------- جدول تکمیل وجه / پیگیری پرداخت‌ها (order/wc-deposits-partial-payments-summary.php) ---------- */
.woocommerce_deposits_parent_order_summary.seebox-styled {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--seebox-surface);
    border: 1px solid var(--seebox-border);
    border-radius: var(--seebox-radius-box);
    overflow: hidden;
}

.woocommerce_deposits_parent_order_summary.seebox-styled thead th {
    background: var(--seebox-surface-muted);
    color: var(--seebox-text);
    font-size: var(--seebox-font-size-sm);
    font-weight: 600;
    padding: 10px 12px;
    text-align: right;
}

.woocommerce_deposits_parent_order_summary.seebox-styled tbody td {
    padding: 10px 12px;
    font-size: var(--seebox-font-size-base);
    border-top: 1px solid var(--seebox-border);
    color: var(--seebox-text);
}

.seebox-status-pill {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--seebox-radius-pill);
    font-size: var(--seebox-font-size-xs);
    font-weight: 600;
}

.seebox-status-pill--paid {
    background: rgba(16, 202, 70, 0.12);
    color: var(--seebox-primary-dark);
}

.seebox-status-pill--pending {
    background: rgba(159, 159, 159, 0.15);
    color: var(--seebox-text-secondary);
}

.seebox-status-pill--failed {
    background: rgba(231, 76, 60, 0.12);
    color: var(--seebox-danger);
}
