/* ============================================================
   PCW - Compare Page Styles (Complete - New Design)
   ============================================================ */

/* ============ کانتینر اصلی ============ */
.pcw-container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 20px;
    font-family: inherit;
    direction: rtl;
    box-sizing: border-box;
}

.pcw-header {
    text-align: center;
    margin-bottom: 30px;
}

.pcw-header h2 {
    color: #222;
    margin-bottom: 10px;
    font-size: 26px;
}

.pcw-desc {
    color: #888 !important;
    font-size: 14px !important;
    margin-top: 15px !important;
}

.pcw-notice {
    background: #fff3cd;
    border-right: 4px solid #ffc107;
    padding: 15px 20px;
    border-radius: 8px;
    margin: 20px auto;
    max-width: 1300px;
    font-size: 15px;
    color: #856404;
    direction: rtl;
}

/* ============ Empty / Loading ============ */
.pcw-loading,
.pcw-error,
.pcw-empty {
    text-align: center;
    padding: 40px;
    color: #666;
    grid-column: 1 / -1;
    font-size: 15px;
}

.pcw-error {
    color: #e53935;
}

/* ============================================================
   PCW Compare Page (New Design)
   ============================================================ */

.pcw-compare-page {
    max-width: 1300px;
    margin: 40px auto;
    padding: 0 20px;
    direction: rtl;
    font-family: inherit;
}

/* ========== هدر ========== */
.pcw-compare-header {
    text-align: center;
    margin-bottom: 40px;
}

.pcw-compare-header h1 {
    font-size: 28px;
    color: #222;
    margin: 0 0 12px;
    font-weight: 700;
}

.pcw-compare-header p {
    font-size: 15px;
    color: #666;
    margin: 0;
    line-height: 1.8;
}

/* ========== فیلتر بانک ========== */
.pcw-compare-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 35px;
}

.pcw-filter-btn {
    background: #fff;
    border: 2px solid #e5e5e5;
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    color: #555;
    font-weight: 600;
    transition: all 0.2s;
}

.pcw-filter-btn:hover {
    border-color: #0066ff;
    color: #0066ff;
    transform: translateY(-2px);
}

.pcw-filter-btn.active {
    background: #0066ff;
    border-color: #0066ff;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0,102,255,0.3);
}

/* ========== کارت‌ها ========== */
.pcw-compare-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 22px;
    margin-bottom: 30px;
}

.pcw-plan-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 3px 20px rgba(0,0,0,0.06);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.3s;
    border-top: 4px solid var(--card-color, #0066ff);
    position: relative;
}

.pcw-plan-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

/* ========== نشان انتخاب ========== */
.pcw-plan-card-selected {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    border-top: 60px solid #00b86b;
    border-left: 60px solid transparent;
    border-radius: 16px 0 0 0;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 10;
}

.pcw-plan-card.selected .pcw-plan-card-selected {
    opacity: 1;
}

.pcw-plan-card-check {
    position: absolute;
    top: -52px;
    left: -52px;
    color: #fff;
    font-size: 22px;
    font-weight: bold;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pcw-plan-card.selected {
    border: 3px solid #00b86b;
    box-shadow: 0 6px 25px rgba(0,184,107,0.25);
    transform: translateY(-4px);
}

/* ========== هدر کارت ========== */
.pcw-plan-card-header {
    padding: 22px 22px 15px;
    border-bottom: 1px solid #f0f0f0;
}

.pcw-plan-card-bank {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #888;
}

.pcw-plan-card-icon {
    font-size: 16px;
}

.pcw-plan-card-bank-name {
    font-weight: 600;
    color: #666;
}

.pcw-plan-card-title {
    font-size: 17px;
    color: #222;
    margin: 0;
    font-weight: 700;
    line-height: 1.5;
}

/* ========== توضیحات ========== */
.pcw-plan-card-description {
    padding: 15px 22px;
    background: #fafbfc;
    font-size: 13px;
    line-height: 1.9;
    color: #555;
    border-bottom: 1px solid #f0f0f0;
}

/* ========== ویژگی‌ها ========== */
.pcw-plan-card-features {
    padding: 18px 22px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pcw-plan-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: #f8f9fa;
    border-radius: 10px;
    transition: all 0.2s;
    border: 1px solid #f0f0f0;
}

.pcw-plan-feature:hover {
    background: #fff;
    border-color: var(--card-color, #0066ff);
}

.pcw-plan-feature.wide {
    align-items: flex-start;
}

.pcw-plan-feature-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--card-color, #0066ff);
    background: #fff;
    border: 1.5px solid var(--card-color, #0066ff);
    padding: 7px;
    box-sizing: border-box;
}

.pcw-plan-feature-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.pcw-plan-feature-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.pcw-plan-feature-label {
    font-size: 12px;
    color: #888;
    font-weight: 500;
}

.pcw-plan-feature-value {
    font-size: 13px;
    color: #222;
    font-weight: 700;
    line-height: 1.5;
    word-wrap: break-word;
}

.pcw-plan-feature.wide .pcw-plan-feature-value {
    font-weight: 500;
    font-size: 12px;
    color: #555;
    line-height: 1.7;
}

/* ========== دکمه‌های کارت ========== */
.pcw-plan-card-footer {
    padding: 15px 22px 20px;
    border-top: 1px solid #f0f0f0;
}

.pcw-plan-card-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.pcw-plan-card-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none !important;
    transition: all 0.25s;
    cursor: pointer;
    font-family: inherit;
    box-sizing: border-box;
    line-height: 1.3;
    min-height: 44px;
    border: none;
}

.pcw-plan-card-btn-secondary {
    background: #fff;
    color: var(--card-color, #0066ff) !important;
    border: 2px solid var(--card-color, #0066ff);
}

.pcw-plan-card-btn-secondary:hover {
    background: var(--card-color, #0066ff);
    color: #fff !important;
    transform: translateY(-2px);
}

.pcw-plan-card-btn-primary {
    background: var(--card-color, #0066ff);
    color: #fff !important;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.pcw-plan-card-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.18);
    filter: brightness(1.1);
}

.pcw-plan-card-btn-primary:disabled {
    background: #00b86b !important;
    cursor: default;
    opacity: 1;
}

.pcw-plan-card.selected .pcw-plan-card-btn-primary {
    background: #00b86b;
}

/* ============================================================
   کادر انتخاب شده (داخل برگه - نه شناور)
   ============================================================ */
.pcw-selection-box {
    background: linear-gradient(135deg, #f0fff4, #e6faf0);
    border: 2px solid #00b86b;
    border-radius: 16px;
    padding: 20px 25px;
    margin: 30px 0;
    box-shadow: 0 4px 20px rgba(0,184,107,0.15);
    animation: pcwSlideDown 0.3s ease;
}

@keyframes pcwSlideDown {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pcw-selection-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.pcw-selection-plan {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 250px;
}

.pcw-selection-label {
    font-size: 14px;
    color: #00a05c;
    font-weight: bold;
    white-space: nowrap;
}

.pcw-selection-name {
    font-size: 16px;
    color: #222;
    font-weight: bold;
    padding: 10px 18px;
    background: #fff;
    border-radius: 10px;
    border: 2px solid #00b86b;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pcw-selection-btn {
    padding: 14px 40px;
    background: #00b86b;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 4px 15px rgba(0,184,107,0.3);
    transition: all 0.25s;
    white-space: nowrap;
}

.pcw-selection-btn:hover:not(:disabled) {
    background: #00a05c;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,184,107,0.4);
}

.pcw-selection-btn:disabled {
    background: #999;
    cursor: not-allowed;
    box-shadow: none;
}

/* ========== دکمه بازگشت به سبد ========== */
.pcw-compare-back {
    text-align: center;
    padding: 20px 0 40px 0;
}

.pcw-btn-back {
    display: inline-block;
    padding: 12px 30px;
    background: #fff;
    color: #666 !important;
    border: 2px solid #ddd;
    border-radius: 10px;
    text-decoration: none !important;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.2s;
}

.pcw-btn-back:hover {
    border-color: #0066ff;
    color: #0066ff !important;
    background: #f0f8ff;
}

/* ============================================================
   کادر جزئیات انتخاب در Checkout
   ============================================================ */
.pcw-chosen-box {
    background: linear-gradient(135deg, #f0fff4, #e6faf0);
    border: 2px solid #00b86b;
    border-radius: 12px;
    padding: 18px 20px;
    margin: 15px 0;
    direction: rtl;
    box-shadow: 0 2px 8px rgba(0,184,107,.15);
}

.pcw-chosen-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 14px;
    color: #00a05c;
    font-weight: bold;
}

.pcw-chosen-icon {
    font-size: 18px;
}

.pcw-chosen-name {
    background: #fff;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: bold;
    color: #222;
    margin-bottom: 8px;
    text-align: center;
}

.pcw-chosen-plan-title {
    background: #fff;
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    margin-bottom: 12px;
    text-align: center;
    font-weight: 600;
}

.pcw-chosen-actions {
    text-align: center;
}

.pcw-change-btn {
    display: inline-block;
    background: #fff;
    color: #0066ff !important;
    border: 2px solid #0066ff;
    padding: 8px 20px;
    border-radius: 8px;
    text-decoration: none !important;
    font-weight: bold;
    font-size: 13px;
    transition: all .2s;
}

.pcw-change-btn:hover {
    background: #0066ff;
    color: #fff !important;
}

/* ============ پنل معرف ============ */
.pcw-ref-panel {
    direction: rtl;
    max-width: 1000px;
    margin: 20px auto;
}

.pcw-ref-panel h2 {
    margin-bottom: 20px;
    color: #222;
}

.pcw-ref-box {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    padding: 25px;
    border-radius: 14px;
    margin-bottom: 25px;
}

.pcw-ref-label {
    font-size: 13px;
    opacity: .9;
    display: block;
    margin-bottom: 8px;
}

.pcw-ref-code {
    font-size: 28px;
    font-weight: bold;
    letter-spacing: 2px;
    background: rgba(255,255,255,.15);
    padding: 12px 20px;
    border-radius: 10px;
    display: inline-block;
    margin-bottom: 15px;
}

.pcw-link-row {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
}

.pcw-link-row input {
    flex: 1;
    padding: 10px 14px;
    border: none;
    border-radius: 8px;
    background: rgba(255,255,255,.15);
    color: #fff;
    font-size: 14px;
    direction: ltr;
}

.pcw-link-row button {
    padding: 10px 20px;
    background: #fff;
    color: #764ba2;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-family: inherit;
}

.pcw-hint {
    font-size: 12px;
    opacity: .85;
    margin-top: 8px;
}

.pcw-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.pcw-stat {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,.06);
}

.pcw-stat.green {
    border-top: 4px solid #00b86b;
}

.pcw-stat.orange {
    border-top: 4px solid #ff9500;
}

.pcw-stat-label {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
}

.pcw-stat-value {
    font-size: 18px;
    font-weight: bold;
    color: #222;
}

.pcw-stat.green .pcw-stat-value {
    color: #00b86b;
}

.pcw-stat.orange .pcw-stat-value {
    color: #ff9500;
}

.pcw-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,.06);
}

.pcw-table th {
    background: #f8f9fa;
    padding: 12px;
    text-align: right;
    font-size: 13px;
    color: #555;
    border-bottom: 1px solid #eee;
}

.pcw-table td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.pcw-table .green {
    color: #00b86b;
    font-weight: bold;
}

.pcw-empty-msg {
    text-align: center;
    padding: 30px;
    color: #888;
    background: #fff;
    border-radius: 12px;
}

/* ============ Responsive ============ */
@media (max-width: 768px) {
    .pcw-compare-page {
        margin: 20px auto;
        padding: 0 15px;
    }
    
    .pcw-compare-header h1 {
        font-size: 22px;
    }
    
    .pcw-compare-cards {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .pcw-compare-filters {
        gap: 8px;
    }
    
    .pcw-filter-btn {
        padding: 8px 14px;
        font-size: 12px;
    }
    
    .pcw-plan-card-header {
        padding: 18px 18px 12px;
    }
    
    .pcw-plan-card-title {
        font-size: 15px;
    }
    
    .pcw-plan-card-features {
        padding: 15px 18px;
    }
    
    .pcw-plan-card-footer {
        padding: 12px 18px 18px;
    }
    
    .pcw-plan-card-buttons {
        grid-template-columns: 1fr;
    }
    
    /* کادر انتخاب در موبایل */
    .pcw-selection-box {
        padding: 18px 20px;
        margin: 20px 0;
    }
    
    .pcw-selection-inner {
        flex-direction: column;
        gap: 15px;
    }
    
    .pcw-selection-plan {
        width: 100%;
        flex-direction: column;
        gap: 8px;
        text-align: center;
        min-width: 0;
    }
    
    .pcw-selection-label {
        font-size: 13px;
    }
    
    .pcw-selection-name {
        font-size: 14px;
        padding: 10px 15px;
        width: 100%;
        text-align: center;
        box-sizing: border-box;
    }
    
    .pcw-selection-btn {
        width: 100%;
        padding: 14px 20px;
        font-size: 14px;
    }
}

/* ============================================================
   PCW - Code Field & Warning
   ============================================================ */

/* فیلد کد اعتبار */
.pcw-code-field {
    width: 100%;
    margin: 15px 0;
    padding: 15px 18px;
    background: #fff;
    border-radius: 12px;
    border: 2px dashed #00b86b;
}

.pcw-code-label {
    display: block;
    font-size: 14px;
    color: #222;
    font-weight: bold;
    margin-bottom: 8px;
}

.pcw-code-label .pcw-required {
    color: #e53935;
    margin-right: 4px;
}

.pcw-code-input {
    display: block;
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 16px;
    font-family: inherit;
    font-weight: bold;
    letter-spacing: 1px;
    direction: ltr;
    text-align: center;
    box-sizing: border-box;
    transition: all 0.2s;
}

.pcw-code-input:focus {
    outline: none;
    border-color: #00b86b;
    box-shadow: 0 0 0 4px rgba(0,184,107,0.15);
}

.pcw-code-input::placeholder {
    letter-spacing: 0;
    font-weight: normal;
    color: #aaa;
}

.pcw-code-hint {
    font-size: 12px;
    color: #666;
    margin: 8px 0 0;
    line-height: 1.6;
}

/* هشدار برای طرح‌های بدون کد */
.pcw-code-warning {
    width: 100%;
    margin: 15px 0;
    padding: 14px 18px;
    background: #fff3cd;
    border-right: 4px solid #ffc107;
    border-radius: 10px;
    font-size: 13px;
    color: #856404;
    line-height: 1.8;
}

/* موبایل */
@media (max-width: 768px) {
    .pcw-code-field {
        padding: 12px 15px;
    }
    
    .pcw-code-input {
        font-size: 15px;
        padding: 10px 12px;
    }
    
    .pcw-code-warning {
        font-size: 12px;
        padding: 12px 14px;
    }
}
/* ============================================================
   PCW - کد معرف در Checkout
   ============================================================ */

.pcw-ref-checkout-box {
    background: linear-gradient(135deg, #fef6ff, #f9f0ff);
    border: 2px solid #9c4dcc;
    border-radius: 12px;
    padding: 18px 20px;
    margin: 15px 0;
    direction: rtl;
    box-shadow: 0 2px 8px rgba(156,77,204,.1);
}

.pcw-ref-checkout-box.pcw-ref-active {
    background: linear-gradient(135deg, #f0fff4, #e6faf0);
    border-color: #00b86b;
    box-shadow: 0 2px 8px rgba(0,184,107,.15);
}

.pcw-ref-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.pcw-ref-icon {
    font-size: 20px;
}

.pcw-ref-title {
    font-size: 15px;
    font-weight: bold;
    color: #6a1b9a;
}

.pcw-ref-active .pcw-ref-title {
    color: #00a05c;
}

.pcw-ref-description {
    font-size: 13px;
    color: #555;
    margin: 0 0 12px;
    line-height: 1.7;
}

.pcw-ref-input-wrap {
    display: flex;
    gap: 10px;
    align-items: stretch;
    flex-wrap: wrap;
}

.pcw-ref-input {
    flex: 1;
    min-width: 180px;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    font-weight: bold;
    letter-spacing: 1px;
    text-align: center;
    box-sizing: border-box;
    transition: all 0.2s;
}

.pcw-ref-input:focus {
    outline: none;
    border-color: #9c4dcc;
    box-shadow: 0 0 0 4px rgba(156,77,204,0.15);
}

.pcw-ref-check-btn {
    padding: 12px 25px;
    background: #9c4dcc;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.25s;
    white-space: nowrap;
}

.pcw-ref-check-btn:hover {
    background: #7b1fa2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(156,77,204,0.3);
}

.pcw-ref-check-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.pcw-ref-message {
    margin-top: 10px;
    font-size: 13px;
    font-weight: bold;
    min-height: 20px;
}

.pcw-ref-message.success {
    color: #00a05c;
}

.pcw-ref-message.error {
    color: #e53935;
}

.pcw-ref-code-display {
    background: #fff;
    padding: 12px 15px;
    border-radius: 10px;
    border: 1px solid #00b86b;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.pcw-ref-code-display code {
    font-size: 18px;
    font-weight: bold;
    color: #00a05c;
    letter-spacing: 2px;
    direction: ltr;
}

.pcw-ref-name {
    font-size: 14px;
    color: #666;
}

.pcw-ref-hint {
    font-size: 12px;
    color: #888;
    margin: 10px 0 0;
    text-align: center;
}

/* موبایل */
@media (max-width: 768px) {
    .pcw-ref-checkout-box {
        padding: 15px;
    }
    
    .pcw-ref-input-wrap {
        flex-direction: column;
    }
    
    .pcw-ref-input,
    .pcw-ref-check-btn {
        width: 100%;
    }
    
    .pcw-ref-code-display {
        flex-direction: column;
        text-align: center;
    }
}