/**
 * استایل‌های Frontend - WC Installment Payments
 *
 * @package    WC_Installment_Payments
 * @since      1.0.0
 * @updated    2.9.4 - پالت رنگی یکپارچه بدون گرادیان
 * 
 * طراحی حرفه‌ای با پشتیبانی RTL و ریسپانسیو
 */

/* ==========================================================================
   CSS Variables - پالت رنگی یکپارچه
   این متغیرها توسط PHP با تنظیمات کاربر override می‌شوند
   ========================================================================== */

:root {
    /* رنگ‌های اصلی */
    --wcip-primary-1: #226148;      /* رنگ اصلی */
    --wcip-primary-2: #1a4d39;      /* رنگ ثانویه/hover */
    --wcip-primary-3: #2d8a62;      /* رنگ تأکیدی */
    
    /* رنگ‌های فرعی */
    --wcip-secondary-1: #22c55e;    /* موفقیت/سبز */
    --wcip-secondary-2: #f59e0b;    /* هشدار/نارنجی */
    --wcip-secondary-3: #ef4444;    /* خطا/قرمز */
    
    /* رنگ‌های خنثی */
    --wcip-white: #ffffff;          /* سفید */
    --wcip-black: #171717;          /* مشکی */
    --wcip-dark-gray: #404040;      /* نوک‌مدادی */
    --wcip-light-gray: #f5f5f5;     /* طوسی روشن */
    
    /* رنگ‌های مشتق (محاسبه شده) */
    --wcip-primary-light: rgba(34, 97, 72, 0.1);
    --wcip-primary-lighter: rgba(34, 97, 72, 0.05);
    --wcip-success-light: rgba(34, 197, 94, 0.1);
    --wcip-warning-light: rgba(245, 158, 11, 0.1);
    --wcip-error-light: rgba(239, 68, 68, 0.1);
    
    /* رنگ‌های طوسی متوسط */
    --wcip-gray-200: #e5e5e5;
    --wcip-gray-300: #d4d4d4;
    --wcip-gray-400: #a3a3a3;
    --wcip-gray-500: #737373;
    
    /* شعاع‌ها */
    --wcip-radius-sm: 6px;
    --wcip-radius: 10px;
    --wcip-radius-lg: 14px;
    --wcip-radius-xl: 20px;
    --wcip-radius-full: 9999px;
    
    /* سایه‌ها */
    --wcip-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --wcip-shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --wcip-shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    
    /* انتقال */
    --wcip-transition: 0.25s ease;
}

/* ==========================================================================
   SVG Icons - جایگزین Dashicons
   ========================================================================== */

.wcip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1em;
    height: 1em;
    vertical-align: middle;
    flex-shrink: 0;
}

.wcip-icon svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
}

/* سایزهای مختلف آیکون */
.wcip-icon--sm {
    width: 14px;
    height: 14px;
}

.wcip-icon--md {
    width: 18px;
    height: 18px;
}

.wcip-icon--lg {
    width: 24px;
    height: 24px;
}

.wcip-icon--xl {
    width: 32px;
    height: 32px;
}

/* ==========================================================================
   انیمیشن‌ها
   ========================================================================== */

@keyframes wcipFadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes wcipSlideDown {
    from { opacity: 0; max-height: 0; }
    to { opacity: 1; max-height: 1000px; }
}

@keyframes wcipPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes wcipSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ==========================================================================
   Wrapper اصلی
   ========================================================================== */

.wcip-wrapper {
    direction: rtl;
    text-align: right;
    font-family: inherit;
    margin: 10px !important;
    max-width: 100%;
    line-height: 1.6;
}


.wcip-wrapper * {
    box-sizing: border-box;
}

.wcip-wrapper.wcip-loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.wcip-wrapper.wcip-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid var(--wcip-gray-200);
    border-top-color: var(--wcip-primary-1);
    border-radius: 50%;
    animation: wcipSpin 0.8s linear infinite;
}

/* ==========================================================================
   آکاردئون
   ========================================================================== */

.wcip-accordion {
    background: var(--wcip-white);
    border: 1px solid var(--wcip-gray-200);
    border-radius: var(--wcip-radius-lg);
    margin: 12px 0 !important;
    overflow: hidden;
    transition: all var(--wcip-transition);
    box-shadow: var(--wcip-shadow-sm);
}

.wcip-accordion:hover {
    border-color: var(--wcip-gray-300);
    box-shadow: var(--wcip-shadow-md);
}

.wcip-accordion--open {
    border-color: var(--wcip-primary-1);
    box-shadow: var(--wcip-shadow-primary);
}

.wcip-accordion__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    cursor: pointer;
    transition: all var(--wcip-transition);
    user-select: none;
    background: var(--wcip-white);
}

.wcip-accordion__header:hover {
    background: var(--wcip-light-gray);
}

.wcip-accordion--open .wcip-accordion__header {
    background: var(--wcip-primary-lighter);
}

.wcip-accordion__title {
    display: flex;
    align-items: center;
    gap: 14px;
}

.wcip-accordion__icon {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--wcip-gray-300);
    border-radius: 50%;
    position: relative;
    transition: all var(--wcip-transition);
    flex-shrink: 0;
}

.wcip-accordion__icon::after {
    content: '';
    width: 10px;
    height: 10px;
    background: var(--wcip-primary-1);
    border-radius: 50%;
    opacity: 0;
    transform: scale(0);
    transition: all var(--wcip-transition);
}

.wcip-accordion--open .wcip-accordion__icon {
    border-color: var(--wcip-primary-1);
}

.wcip-accordion--open .wcip-accordion__icon::after {
    opacity: 1;
    transform: scale(1);
}

.wcip-accordion__icon.dashicons {
    border: none;
    color: var(--wcip-gray-500);
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.wcip-accordion--open .wcip-accordion__icon.dashicons {
    color: var(--wcip-primary-1);
}

.wcip-accordion__text {
    font-size: 15px;
    font-weight: 600;
    color: var(--wcip-dark-gray);
    transition: color var(--wcip-transition);
}

.wcip-accordion--open .wcip-accordion__text {
    color: var(--wcip-primary-1);
}

.wcip-accordion__badge {
    background: var(--wcip-primary-1);
    color: var(--wcip-white);
    font-size: 11px;
    font-weight: 600;
    padding: 5px 14px;
    border-radius: var(--wcip-radius-full);
    margin-right: 10px;
}

.wcip-accordion__arrow {
    color: var(--wcip-gray-400);
    width: 18px;
    height: 18px;
    transition: all var(--wcip-transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.wcip-accordion__arrow .wcip-icon {
    width: 18px;
    height: 18px;
}

.wcip-accordion--open .wcip-accordion__arrow {
    transform: rotate(180deg);
    color: var(--wcip-primary-1);
}

.wcip-accordion__content {
    padding: 15px !important;
    display: none;
    border-top: 1px solid var(--wcip-light-gray);
}

.wcip-accordion--open .wcip-accordion__content {
    display: block;
    animation: wcipFadeIn 0.3s ease;
}

/* ==========================================================================
   بخش نقدی
   ========================================================================== */

.wcip-cash-section {
    padding-top: 18px;
}

.wcip-cash-info {
    background: var(--wcip-light-gray);
    border-radius: var(--wcip-radius);
    padding: 18px;
}

.wcip-cash-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
}

.wcip-cash-row:not(:last-child) {
    border-bottom: 1px dashed var(--wcip-gray-200);
}

.wcip-cash-label {
    font-size: 14px;
    color: var(--wcip-dark-gray);
}

.wcip-cash-value {
    font-size: 17px;
    font-weight: 700;
    color: var(--wcip-black);
}

.wcip-cash-value--old {
    text-decoration: line-through;
    color: var(--wcip-gray-400);
    font-size: 13px;
    font-weight: 400;
}

.wcip-cash-value--sale {
    color: var(--wcip-secondary-1);
    font-size: 20px;
}

.wcip-cash-savings {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
    padding: 12px 18px;
    background: var(--wcip-success-light);
    border-radius: var(--wcip-radius);
    color: #15803d;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.wcip-cash-savings .wcip-icon {
    width: 18px;
    height: 18px;
    color: var(--wcip-secondary-1);
}

/* ==========================================================================
   انتخاب شرایط پرداخت
   ========================================================================== */

.wcip-plans-section {
    padding-top: 18px;
}

.wcip-plans-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--wcip-dark-gray);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wcip-plans {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 18px 0;
    border-top: 1px solid var(--wcip-gray-200);
    border-bottom: 1px solid var(--wcip-gray-200);
    margin-bottom: 22px;
}

.wcip-plan {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: #fff !important;
    border: 2px solid var(--wcip-gray-200);
    border-radius: var(--wcip-radius-full);
    font-size: 14px;
    font-weight: 500;
    color: #545454 !important;
    cursor: pointer;
    transition: all var(--wcip-transition);
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.wcip-plan::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--wcip-primary-1);
    opacity: 0;
    transition: opacity var(--wcip-transition);
    z-index: 0;
}

.wcip-plan > * {
    position: relative;
    z-index: 1;
}

.wcip-plan:hover {
    border-color: var(--wcip-primary-1);
    transform: translateY(-2px);
    box-shadow: var(--wcip-shadow-md);
}

.wcip-plan:hover::before {
    opacity: 0.05;
}

.wcip-plan--active {
    background: var(--wcip-primary-1);
    border-color: var(--wcip-primary-1);
    color: var(--wcip-white);
    box-shadow: var(--wcip-shadow-primary);
}

.wcip-plan--active:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(34, 97, 72, 0.4);
}

.wcip-plan--active::before {
    opacity: 0;
}

.wcip-plan__icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
    border-radius: 4px;
    transition: all var(--wcip-transition);
}

.wcip-plan__icon.dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.wcip-plan--active .wcip-plan__icon.dashicons {
    color: var(--wcip-white);
}

.wcip-plan__name {
    transition: all var(--wcip-transition);
}

/* ==========================================================================
   جزئیات شرایط
   ========================================================================== */

.wcip-plan-details {
    display: none;
    animation: wcipFadeIn 0.3s ease;
}

.wcip-plan-details--active {
    display: block;
}

.wcip-plan-desc {
    padding: 14px 18px;
    background: var(--wcip-info-light);
    border-radius: var(--wcip-radius);
    margin-bottom: 22px;
    font-size: 13px;
    color: #1e40af;
    line-height: 1.8;
    border-right: 4px solid var(--wcip-info);
}

/* ==========================================================================
   v2.0: دکمه‌های انتخاب تعداد اقساط
   ========================================================================== */

.wcip-installment-options {
    background: transparent !important;
    border-radius: var(--wcip-radius-lg);
    padding: 5px !important;
    margin-bottom: 10px !important;
    border: none !important;
}

.wcip-options-label {
    font-size: 14px;
    font-weight: 600;
    color: #92400e;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wcip-options-label::before {
    content: '📊';
    font-size: 16px;
}

.wcip-options-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 5px;
}

.wcip-count-btn {
    background: #fff !important;
    border: 2px solid var(--wcip-gray-300);
    border-radius: var(--wcip-radius);
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #545454 !important;
    cursor: pointer;
    transition: all var(--wcip-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 90px;
    position: relative;
    overflow: hidden;
}

.wcip-count-btn::before {
    content: none !important;
}

.wcip-count-btn span {
    position: relative;
    z-index: 1;
}

.wcip-count-btn:hover {
    border-color: var(--wcip-primary-1);
    transform: translateY(-2px);
    box-shadow: var(--wcip-shadow-md);
}

.wcip-count-btn--active {
    background: transparent !important;
    border-color: var(--wcip-primary-1);
    color: #545454 !important;
    box-shadow: var(--wcip-shadow-primary);
}

.wcip-count-btn--active::before {
    opacity: 0;
}

.wcip-count-btn--active:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(34, 97, 72, 0.4);
}

/* ریسپانسیو دکمه‌ها */
@media (max-width: 480px) {
    .wcip-options-buttons {
        gap: 8px;
    }
    
    .wcip-count-btn {
        padding: 10px 14px;
        font-size: 13px;
        min-width: 75px;
        flex: 1;
    }
}

/* ==========================================================================
   پیش‌پرداخت
   ========================================================================== */

.wcip-downpayment {
    background: var(--wcip-light-gray);
    border-radius: var(--wcip-radius-lg);
    padding: 20px;
    margin-bottom: 22px;
    border: 1px solid var(--wcip-gray-200);
}

.wcip-downpayment__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.wcip-downpayment__title {
    font-size: 14px;
    font-weight: 600;
    color: var(--wcip-dark-gray);
    display: flex;
    align-items: center;
    gap: 8px;
}

.wcip-downpayment__title .dashicons {
    color: var(--wcip-primary-1);
    font-size: 18px;
}

.wcip-downpayment__percent {
    font-size: 22px;
    font-weight: 800;
    color: var(--wcip-primary-1);
    background: var(--wcip-white);
    padding: 6px 16px;
    border-radius: var(--wcip-radius);
    box-shadow: var(--wcip-shadow-sm);
}

.wcip-downpayment__slider {
    padding: 12px 0;
}

.wcip-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: var(--wcip-gray-200);
    border-radius: var(--wcip-radius-full);
    outline: none;
    cursor: pointer;
    position: relative;
}

.wcip-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 26px;
    height: 26px;
    background: var(--wcip-primary-1);
    border-radius: 50%;
    cursor: grab;
    box-shadow: 0 2px 10px rgba(34, 97, 72, 0.4);
    transition: all 0.2s ease;
    border: 3px solid var(--wcip-white);
}

.wcip-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 14px rgba(34, 97, 72, 0.5);
}

.wcip-slider::-webkit-slider-thumb:active {
    cursor: grabbing;
    transform: scale(0.95);
}

.wcip-slider::-moz-range-thumb {
    width: 26px;
    height: 26px;
    background: var(--wcip-primary-1);
    border-radius: 50%;
    cursor: grab;
    border: 3px solid var(--wcip-white);
    box-shadow: 0 2px 10px rgba(34, 97, 72, 0.4);
}

.wcip-slider__labels {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 12px;
    color: var(--wcip-gray-500);
    font-weight: 500;
}

.wcip-downpayment__amount {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px dashed var(--wcip-gray-300);
}

.wcip-downpayment__amount-label {
    font-size: 14px;
    color: var(--wcip-dark-gray);
}

.wcip-downpayment__amount-value {
    font-size: 17px;
    font-weight: 700;
    color: var(--wcip-primary-1);
}

/* v2.7.0: پیش‌پرداخت ثابت (بدون اسلایدر) */
.wcip-downpayment--fixed {
    background: var(--wcip-warning-light);
    border-color: var(--wcip-secondary-2);
}

.wcip-downpayment--fixed .wcip-downpayment__slider {
    display: none !important;
}

.wcip-downpayment--fixed .wcip-downpayment__header {
    border-bottom: none;
    padding-bottom: 15px;
}

.wcip-downpayment--fixed .wcip-downpayment__percent {
    background: var(--wcip-secondary-2);
    color: var(--wcip-white);
}

.wcip-downpayment--fixed .wcip-downpayment__amount {
    border-top: 1px solid rgba(245, 158, 11, 0.3);
}

/* ==========================================================================
   اطلاعات اقساط
   ========================================================================== */

.wcip-installment-info {
    background: var(--wcip-white);
    border: 1px solid var(--wcip-gray-200);
    border-radius: var(--wcip-radius-lg);
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: var(--wcip-shadow-sm);
}

.wcip-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--wcip-light-gray);
    transition: background var(--wcip-transition);
}

.wcip-info-row:last-child {
    border-bottom: none;
}

.wcip-info-row:hover {
    background: var(--wcip-light-gray);
}

.wcip-info-label {
    font-size: 14px;
    color: var(--wcip-dark-gray);
    display: flex;
    align-items: center;
    gap: 8px;
}

.wcip-info-label .dashicons {
    font-size: 16px;
    color: var(--wcip-gray-400);
}

.wcip-info-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--wcip-black);
}

.wcip-info-row--highlight {
    background: var(--wcip-success-light);
    border-right: 4px solid var(--wcip-secondary-1);
}

.wcip-info-row--highlight:hover {
    background: var(--wcip-success-light);
}

.wcip-info-row--highlight .wcip-info-label {
    color: #15803d;
    font-weight: 600;
}

.wcip-info-row--highlight .wcip-info-value {
    color: #15803d;
    font-size: 18px;
    font-weight: 700;
}

.wcip-info-row--total {
    background: var(--wcip-primary-1);
    border-bottom: none;
}

.wcip-info-row--total:hover {
    background: var(--wcip-primary-2);
}

.wcip-info-row--total .wcip-info-label,
.wcip-info-row--total .wcip-info-value {
    color: var(--wcip-white);
}

.wcip-info-row--total .wcip-info-value {
    font-size: 18px;
    font-weight: 700;
}

/* ردیف کارمزد */
.wcip-info-row--fee {
    background: var(--wcip-warning-light);
    border-right: 3px solid var(--wcip-secondary-2);
}

.wcip-info-row--fee:hover {
    background: rgba(245, 158, 11, 0.15);
}

.wcip-info-row--fee .wcip-info-label {
    color: #b45309;
    font-weight: 600;
}

.wcip-info-row--fee .wcip-info-value {
    color: #d97706;
    font-weight: 700;
}

/* ردیف تفاوت قیمت */
.wcip-info-row--difference {
    background: var(--wcip-error-light);
    border-right: 3px solid var(--wcip-secondary-3);
}

.wcip-info-row--difference:hover {
    background: rgba(239, 68, 68, 0.15);
}

.wcip-info-row--difference .wcip-info-label {
    color: #b91c1c;
    font-weight: 600;
}

.wcip-info-row--difference .wcip-info-value,
.wcip-price-difference {
    color: var(--wcip-secondary-3);
    font-weight: 700;
}

.wcip-price-diff {
    color: var(--wcip-secondary-3);
    font-weight: 600;
}

.wcip-fee-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: baseline;
}

.wcip-fee-percent {
    font-size: 12px;
    color: var(--wcip-gray-500);
    background: var(--wcip-light-gray);
    padding: 2px 8px;
    border-radius: var(--wcip-radius-sm);
}

/* ==========================================================================
   دکمه جدول اقساط
   ========================================================================== */

.wcip-table-toggle {
    text-align: center;
    margin-top: 16px;
}

.wcip-table-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: var(--wcip-white);
    border: 2px solid var(--wcip-gray-200);
    border-radius: var(--wcip-radius-lg);
    font-size: 14px;
    font-weight: 600;
    color: var(--wcip-dark-gray);
    cursor: pointer;
    transition: all var(--wcip-transition);
    font-family: inherit;
}

.wcip-table-btn:hover {
    border-color: var(--wcip-primary-1);
    color: var(--wcip-primary-1);
    background: var(--wcip-primary-lighter);
    transform: translateY(-2px);
    box-shadow: var(--wcip-shadow-md);
}

.wcip-table-btn .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    transition: transform var(--wcip-transition);
}

.wcip-table-btn.wcip-open {
    background: var(--wcip-primary-1);
    border-color: var(--wcip-primary-1);
    color: var(--wcip-white);
}

.wcip-table-btn.wcip-open .dashicons-arrow-down-alt2 {
    transform: rotate(180deg);
}

/* ==========================================================================
   جدول اقساط
   ========================================================================== */

.wcip-table-content {
    margin-top: 20px;
    animation: wcipFadeIn 0.3s ease;
}

.wcip-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 14px;
    border: 1px solid var(--wcip-gray-200);
    border-radius: var(--wcip-radius-lg);
    overflow: hidden;
    box-shadow: var(--wcip-shadow-sm);
}

.wcip-table thead {
    background: var(--wcip-light-gray);
}

.wcip-table th {
    padding: 16px 18px;
    font-weight: 600;
    color: var(--wcip-dark-gray);
    text-align: right;
    border-bottom: 2px solid var(--wcip-gray-200);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.wcip-table td {
    padding: 14px 18px;
    color: var(--wcip-dark-gray);
    text-align: right;
    border-bottom: 1px solid var(--wcip-light-gray);
    transition: background var(--wcip-transition);
}

.wcip-table tbody tr:hover td {
    background: var(--wcip-light-gray);
}

.wcip-table tbody tr:last-child td {
    border-bottom: none;
}

.wcip-table tfoot {
    background: var(--wcip-primary-1);
}

.wcip-table tfoot td {
    padding: 16px 18px;
    font-weight: 700;
    color: var(--wcip-white);
    border-bottom: none;
    font-size: 15px;
}

/* ردیف جمع کارمزد در جدول */
.wcip-table tfoot tr.wcip-table-fee-row {
    background: var(--wcip-warning-light);
}

.wcip-table tfoot tr.wcip-table-fee-row td {
    color: #b45309;
    font-size: 14px;
    font-weight: 600;
}

/* استایل ستون درصد در جدول */
.wcip-table-percent {
    font-family: tahoma, sans-serif;
    font-size: 12px;
}

.wcip-table__number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: var(--wcip-primary-light);
    color: var(--wcip-primary-1);
    border-radius: 50%;
    font-weight: 600;
    font-size: 13px;
}

/* ==========================================================================
   استایل‌های سبد خرید
   ========================================================================== */

.wcip-cart-item-data {
    margin-top: 15px;
    padding: 16px;
    background: var(--wcip-light-gray);
    border-radius: var(--wcip-radius);
    font-size: 13px;
    border: 1px solid var(--wcip-gray-200);
}

.wcip-cart-item-data__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--wcip-gray-200);
}

.wcip-cart-item-data__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--wcip-primary-1);
    color: var(--wcip-white);
    border-radius: var(--wcip-radius-full);
    font-size: 12px;
    font-weight: 600;
    box-shadow: var(--wcip-shadow-primary);
}

.wcip-cart-item-data__badge .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.wcip-cart-item-data__count {
    font-size: 12px;
    color: var(--wcip-gray-500);
    background: var(--wcip-white);
    padding: 4px 10px;
    border-radius: var(--wcip-radius-sm);
}

.wcip-cart-item-data__details {
    padding-top: 0;
}

.wcip-cart-item-data__item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px dashed var(--wcip-gray-200);
}

.wcip-cart-item-data__item:last-child {
    border-bottom: none;
}

.wcip-cart-item-data__label {
    color: var(--wcip-dark-gray);
}

.wcip-cart-item-data__value {
    font-weight: 600;
    color: var(--wcip-black);
}

.wcip-cart-item-data__item--total {
    border-top: 2px solid var(--wcip-gray-300);
    margin-top: 10px;
    padding-top: 14px;
    border-bottom: none;
}

.wcip-cart-item-data__item--total .wcip-cart-item-data__label {
    font-weight: 600;
    color: var(--wcip-dark-gray);
}

.wcip-cart-item-data__item--total .wcip-cart-item-data__value {
    color: var(--wcip-primary-1);
    font-size: 15px;
    font-weight: 700;
}

.wcip-cart-price,
.wcip-cart-subtotal {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wcip-cart-price__downpayment,
.wcip-cart-subtotal__downpayment {
    font-size: 14px;
    color: var(--wcip-dark-gray);
    font-weight: 600;
}

.wcip-cart-price__installment {
    font-size: 12px;
    color: var(--wcip-gray-500);
}

.wcip-cart-subtotal__total {
    font-weight: 700;
    color: var(--wcip-primary-1);
    font-size: 15px;
}

/* ==========================================================================
   صفحه تسویه حساب
   ========================================================================== */

.wcip-checkout-summary {
    background: var(--wcip-white);
    border: 2px solid var(--wcip-primary-1);
    border-radius: var(--wcip-radius-lg);
    padding: 24px;
    margin: 25px 0;
    box-shadow: var(--wcip-shadow-lg);
}

.wcip-checkout-summary__title {
    font-size: 18px;
    font-weight: 700;
    color: var(--wcip-primary-1);
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--wcip-light-gray);
    display: flex;
    align-items: center;
    gap: 10px;
}

.wcip-checkout-summary__title .dashicons {
    font-size: 22px;
    width: 22px;
    height: 22px;
}

/* ==========================================================================
   صفحه تشکر از خرید و سفارشات
   ========================================================================== */

.wcip-order-installments {
    margin: 30px 0;
    padding: 24px;
    background: var(--wcip-light-gray);
    border: 2px solid var(--wcip-primary-1);
    border-radius: var(--wcip-radius-lg);
    box-shadow: var(--wcip-shadow-lg);
}

.wcip-order-installments h2 {
    margin: 0 0 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--wcip-primary-1);
    color: var(--wcip-primary-1);
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.wcip-order-installments h3 {
    margin: 24px 0 16px;
    font-size: 16px;
    color: var(--wcip-dark-gray);
    font-weight: 600;
}

.wcip-order-installments table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 20px;
    border-radius: var(--wcip-radius);
    overflow: hidden;
    box-shadow: var(--wcip-shadow-sm);
}

.wcip-order-installments th,
.wcip-order-installments td {
    padding: 14px 18px;
    border: 1px solid var(--wcip-gray-200);
    background: var(--wcip-white);
}

.wcip-order-installments th {
    text-align: right;
    background: var(--wcip-light-gray);
    color: var(--wcip-dark-gray);
    font-weight: 600;
    width: 40%;
}

.wcip-order-installments thead th {
    background: var(--wcip-primary-1);
    color: var(--wcip-white);
    text-align: center;
    font-weight: 600;
}

.wcip-order-installments tbody tr:hover td {
    background: var(--wcip-light-gray);
}

.wcip-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--wcip-radius-full);
    font-size: 12px;
    font-weight: 600;
}

.wcip-status-badge--pending {
    background: var(--wcip-warning-light);
    color: #b45309;
}

.wcip-status-badge--paid {
    background: var(--wcip-success-light);
    color: #15803d;
}

.wcip-status-badge--overdue {
    background: var(--wcip-error-light);
    color: #b91c1c;
}

/* ==========================================================================
   نوتیفیکیشن‌ها
   ========================================================================== */

.wcip-notice {
    padding: 14px 18px;
    border-radius: var(--wcip-radius);
    margin: 15px 0;
    font-size: 14px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.wcip-notice .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.wcip-notice--info {
    background: var(--wcip-info-light);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: #1e40af;
    border-right: 4px solid var(--wcip-info);
}

.wcip-notice--success {
    background: var(--wcip-success-light);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: #15803d;
    border-right: 4px solid var(--wcip-secondary-1);
}

.wcip-notice--warning {
    background: var(--wcip-warning-light);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: #b45309;
    border-right: 4px solid var(--wcip-secondary-2);
}

.wcip-notice--error {
    background: var(--wcip-error-light);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #b91c1c;
    border-right: 4px solid var(--wcip-secondary-3);
}

/* ==========================================================================
   ریسپانسیو - تبلت
   ========================================================================== */

@media (max-width: 768px) {
    .wcip-accordion__header {
        padding: 16px 18px;
    }

    .wcip-accordion__content {
        padding: 0 18px 18px 18px;
    }

    .wcip-accordion__text {
        font-size: 14px;
    }

    .wcip-plans {
        gap: 8px;
    }

    .wcip-plan {
        padding: 10px 16px;
        font-size: 13px;
    }

    .wcip-info-row {
        padding: 14px 16px;
    }

    .wcip-downpayment__percent {
        font-size: 18px;
    }

    .wcip-table th,
    .wcip-table td {
        padding: 12px 14px;
        font-size: 13px;
    }

    .wcip-order-installments {
        padding: 18px;
    }

    .wcip-order-installments h2 {
        font-size: 16px;
    }
}

/* ==========================================================================
   ریسپانسیو - موبایل
   ========================================================================== */

@media (max-width: 576px) {
    .wcip-wrapper {
        margin: 15px 0;
    }

    .wcip-accordion {
        margin: 10px 0 !important;
    }

    .wcip-accordion__header {
        padding: 14px 16px;
    }

    .wcip-accordion__content {
        padding: 0 16px 16px 16px;
    }

    .wcip-accordion__title {
        gap: 10px;
    }

    .wcip-accordion__text {
        font-size: 13px;
    }

    .wcip-accordion__badge {
        padding: 3px 10px;
        font-size: 10px;
    }

    .wcip-plans {
        gap: 6px;
        padding: 14px 0;
    }

    .wcip-plan {
        padding: 8px 14px;
        font-size: 12px;
        gap: 6px;
    }

    .wcip-plan__icon {
        width: 18px;
        height: 18px;
    }

    .wcip-downpayment {
        padding: 16px;
    }

    .wcip-downpayment__header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .wcip-downpayment__percent {
        font-size: 16px;
        padding: 4px 12px;
    }

    .wcip-info-row {
        padding: 12px 14px;
        flex-wrap: wrap;
        gap: 6px;
    }

    .wcip-info-label {
        font-size: 13px;
    }

    .wcip-info-value {
        font-size: 14px;
    }

    .wcip-info-row--highlight .wcip-info-value {
        font-size: 16px;
    }

    .wcip-table-btn {
        padding: 12px 20px;
        font-size: 13px;
    }

    .wcip-table {
        font-size: 12px;
    }

    .wcip-table th,
    .wcip-table td {
        padding: 10px 12px;
    }

    .wcip-table__number {
        width: 26px;
        height: 26px;
        font-size: 11px;
    }

    .wcip-cart-item-data {
        padding: 14px;
    }

    .wcip-cart-item-data__header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .wcip-order-installments {
        padding: 16px;
        margin: 20px 0;
    }

    .wcip-order-installments h2 {
        font-size: 15px;
        margin-bottom: 18px;
    }

    .wcip-order-installments th,
    .wcip-order-installments td {
        padding: 10px 12px;
        font-size: 13px;
    }

    .wcip-checkout-summary {
        padding: 18px;
    }

    .wcip-checkout-summary__title {
        font-size: 16px;
    }
}

/* ==========================================================================
   پشتیبانی LTR
   ========================================================================== */

html[dir="ltr"] .wcip-wrapper,
body.ltr .wcip-wrapper {
    direction: ltr;
    text-align: left;
}

html[dir="ltr"] .wcip-slider__labels,
body.ltr .wcip-slider__labels {
    flex-direction: row;
}

html[dir="ltr"] .wcip-table th,
html[dir="ltr"] .wcip-table td,
body.ltr .wcip-table th,
body.ltr .wcip-table td {
    text-align: left;
}

html[dir="ltr"] .wcip-plan-desc,
body.ltr .wcip-plan-desc {
    border-right: none;
    border-left: 4px solid var(--wcip-info);
}

html[dir="ltr"] .wcip-info-row--highlight,
body.ltr .wcip-info-row--highlight {
    border-right: none;
    border-left: 4px solid var(--wcip-secondary-1);
}

html[dir="ltr"] .wcip-notice,
body.ltr .wcip-notice {
    border-right: none;
}

html[dir="ltr"] .wcip-notice--info,
body.ltr .wcip-notice--info {
    border-left: 4px solid var(--wcip-info);
}

html[dir="ltr"] .wcip-notice--success,
body.ltr .wcip-notice--success {
    border-left: 4px solid var(--wcip-secondary-1);
}

html[dir="ltr"] .wcip-notice--warning,
body.ltr .wcip-notice--warning {
    border-left: 4px solid var(--wcip-secondary-2);
}

html[dir="ltr"] .wcip-notice--error,
body.ltr .wcip-notice--error {
    border-left: 4px solid var(--wcip-secondary-3);
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .wcip-wrapper {
        box-shadow: none !important;
    }

    .wcip-accordion {
        border: 1px solid #ccc !important;
        box-shadow: none !important;
    }

    .wcip-table-btn {
        display: none !important;
    }

    .wcip-table-content {
        display: block !important;
    }

    .wcip-slider {
        display: none !important;
    }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

.wcip-wrapper *:focus {
    outline: 2px solid var(--wcip-primary-1);
    outline-offset: 2px;
}

.wcip-wrapper *:focus:not(:focus-visible) {
    outline: none;
}

.wcip-wrapper *:focus-visible {
    outline: 2px solid var(--wcip-primary-1);
    outline-offset: 2px;
}

.wcip-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ==========================================================================
   استایل‌های سفارشی - مخفی کردن قیمت اصلی
   ========================================================================== */

.product-summary-left p.price {
    display: none !important;
}

/* ==========================================================================
   باکس سود پرداخت نقدی (v2.5.0)
   ========================================================================== */

.wcip-cash-profit-box {
    background: var(--wcip-success-light);
    border: 1px solid #28a745;
    border-radius: var(--wcip-radius);
    padding: 15px 20px;
    margin: 15px 0;
    text-align: center;
    color: #155724;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.1);
    transition: var(--wcip-transition);
}

.wcip-cash-profit-box:hover {
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.15);
    transform: translateY(-1px);
}

.wcip-cash-profit-box .woocommerce-Price-amount {
    color: #155724;
    font-weight: 700;
    font-size: 16px;
}

.wcip-cash-profit-box .woocommerce-Price-currencySymbol {
    font-size: 14px;
}

/* حالت RTL */
[dir="rtl"] .wcip-cash-profit-box,
.rtl .wcip-cash-profit-box {
    direction: rtl;
    text-align: center;
}

/* ریسپانسیو */
@media (max-width: 768px) {
    .wcip-cash-profit-box {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .wcip-cash-profit-box .woocommerce-Price-amount {
        font-size: 15px;
    }
}
