/* ساده و قابل سفارشی‌سازی */
.wc-preinvoice-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
}

.wc-preinvoice-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity .25s;
}

.wc-preinvoice-modal-dialog {
    position: relative;
    width: 90%;
    max-width: 720px;
    margin: 6% auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
    transform: translateY(-10px);
    transition: transform .25s, opacity .25s;
    padding: 18px;
}

.wc-preinvoice-modal[aria-hidden="false"] .wc-preinvoice-modal-backdrop {
    opacity: 1;
}

.wc-preinvoice-modal[aria-hidden="false"] .wc-preinvoice-modal-dialog {
    transform: translateY(0);
    opacity: 1;
	border-radius:0;
}

.wc-preinvoice-modal-close {
    position: absolute;
    top: -12px;
    right: 20px;
    background: transparent;
    border: 0;
    font-size: 22px;
    cursor: pointer;
}

.wc-preinvoice-modal-body {
    padding: 8px 4px;
}

.wc-preinvoice-modal-loading {
    text-align: center;
    padding: 30px 0;
    color: #666;
}

.wc-preinvoice-share-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.wc-preinvoice-share {
    padding: 8px 12px;
    background: #f1f1f1;
    border-radius: 6px;
    text-decoration: none;
    color: #222;
    font-size: 14px;
}

.wc-preinvoice-share-whatsapp {
    background: #25D366;
    color: #fff;
}

.wc-preinvoice-share-telegram {
    background: #0088cc;
    color: #fff;
}

.wc-preinvoice-share-facebook {
    background: #1877f2;
    color: #fff;
}

.wc-preinvoice-share-twitter {
    background: #1da1f2;
    color: #fff;
}

.wc-preinvoice-share-linkedin {
    background: #0a66c2;
    color: #fff;
}

/* --- اعتبارسنجی فرم و ستاره فیلدهای اجباری --- */
.wc-preinvoice-required {
    color: #d63638;
    font-weight: 700;
}

.wc-preinvoice-form-errors {
    background: #fcf0f1;
    border: 1px solid #d63638;
    border-radius: 6px;
    color: #8a1f21;
    padding: 10px 14px;
    margin-bottom: 12px;
    font-size: 14px;
}

.wc-preinvoice-form-errors ul {
    margin: 0;
    padding-inline-start: 18px;
}

.wc-preinvoice-form input.wc-preinvoice-field-error,
.wc-preinvoice-form textarea.wc-preinvoice-field-error {
    border-color: #d63638 !important;
    box-shadow: 0 0 0 1px rgba(214, 54, 56, .3);
}

.wc-preinvoice-total {
    font-size: 16px;
}

.wc-preinvoice-total-display {
    font-weight: 700;
}

/* --- اصلاح چیدمان مودال: دکمه بستن روی عنوان محصول می‌افتاد --- */
.wc-preinvoice-modal-dialog {
    max-height: 85vh;
    overflow-y: auto;
}

.wc-preinvoice-modal-body {
    padding-top: 34px;
}

.wc-preinvoice-modal-close {
    width: 32px;
    height: 32px;
    line-height: 1;
    border-radius: 50%;
    color: #444;
}

.wc-preinvoice-modal-close:hover {
    background: #f1f1f1;
}