/* ============================================================
   Custom 3-Step Checkout — Modern Graphic Styles
   Version: 3.0.0
   ============================================================ */

.c3c-wrapper *,
.c3c-wrapper *::before,
.c3c-wrapper *::after {
    box-sizing: border-box;
}

.c3c-wrapper {
    --c3c-primary: #6366f1;
    --c3c-primary-dark: #4f46e5;
    --c3c-accent: #8b5cf6;
    --c3c-success: #10b981;
    --c3c-success-dark: #059669;
    --c3c-danger: #ef4444;
    --c3c-warning: #f59e0b;
    --c3c-text: #1f2937;
    --c3c-muted: #6b7280;
    --c3c-border: #e5e7eb;
    --c3c-bg-soft: #f9fafb;
    --c3c-radius: 16px;
    --c3c-radius-sm: 10px;
    --c3c-shadow: 0 4px 24px rgba(15, 23, 42, .06);

    max-width: 1180px;
    margin: 30px auto;
    padding: 0 16px 60px;
    direction: rtl;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    color: var(--c3c-text);
    position: relative;
    line-height: 1.7;
}

.c3c-wrapper h1,
.c3c-wrapper h2,
.c3c-wrapper h3 {
    font-family: inherit;
    color: var(--c3c-text);
    line-height: 1.4;
}

.c3c-wrapper a { text-decoration: none; }

/* ============================================================
   پس‌زمینه تزئینی
   ============================================================ */
.c3c-bg-decoration {
    position: absolute;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}
.c3c-bg-decoration::before,
.c3c-bg-decoration::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: .35;
}
.c3c-bg-decoration::before {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, #a5b4fc, transparent 70%);
    top: -100px;
    right: -80px;
}
.c3c-bg-decoration::after {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, #ddd6fe, transparent 70%);
    bottom: 100px;
    left: -80px;
}

/* ============================================================
   هدر
   ============================================================ */
.c3c-header {
    text-align: center;
    margin-bottom: 40px;
}
.c3c-header-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: linear-gradient(135deg, #eef2ff, #f5f3ff);
    color: var(--c3c-primary-dark);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 16px;
    border: 1px solid #e0e7ff;
}
.c3c-header-badge svg {
    width: 14px;
    height: 14px;
}
.c3c-header h1 {
    margin: 0 0 8px;
    font-size: 32px;
    font-weight: 800;
    background: linear-gradient(135deg, #4f46e5, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.c3c-header p {
    margin: 0;
    color: var(--c3c-muted);
    font-size: 15px;
}

/* ============================================================
   نشانگر مراحل
   ============================================================ */
.c3c-steps-indicator {
    display: flex;
    justify-content: space-between;
    position: relative;
    max-width: 640px;
    margin: 0 auto 40px;
    padding: 0 20px;
}
.c3c-progress-line {
    position: absolute;
    top: 28px;
    left: 60px;
    right: 60px;
    height: 4px;
    background: #e5e7eb;
    border-radius: 999px;
    z-index: 0;
    overflow: hidden;
}
.c3c-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    border-radius: 999px;
    transition: width .5s ease;
}

.c3c-indicator-item {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 1;
}
.c3c-indicator-circle {
    width: 56px;
    height: 56px;
    margin: 0 auto 10px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .4s cubic-bezier(.4, 0, .2, 1);
    position: relative;
}
.c3c-indicator-icon svg {
    width: 24px;
    height: 24px;
    color: var(--c3c-muted);
    transition: color .3s;
    display: block;
}
.c3c-indicator-check {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0);
    transition: all .3s;
}
.c3c-indicator-check svg {
    width: 26px;
    height: 26px;
    color: #fff;
    display: block;
}

.c3c-indicator-item.active .c3c-indicator-circle {
    border-color: var(--c3c-primary);
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    box-shadow: 0 0 0 8px rgba(99, 102, 241, .15), 0 10px 24px rgba(99, 102, 241, .4);
    transform: scale(1.08);
}
.c3c-indicator-item.active .c3c-indicator-icon svg { color: #fff; }

.c3c-indicator-item.completed .c3c-indicator-circle {
    border-color: var(--c3c-success);
    background: var(--c3c-success);
    box-shadow: 0 6px 18px rgba(16, 185, 129, .35);
}
.c3c-indicator-item.completed .c3c-indicator-icon { opacity: 0; }
.c3c-indicator-item.completed .c3c-indicator-check {
    opacity: 1;
    transform: scale(1);
}

.c3c-indicator-title {
    font-size: 13px;
    color: var(--c3c-muted);
    font-weight: 500;
    transition: all .3s;
}
.c3c-indicator-item.active .c3c-indicator-title {
    color: var(--c3c-text);
    font-weight: 700;
}
.c3c-indicator-item.completed .c3c-indicator-title {
    color: var(--c3c-success);
}

/* ============================================================
   بدنه اصلی
   ============================================================ */
.c3c-body {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 24px;
    align-items: start;
}

/* ============================================================
   کارت فرم
   ============================================================ */
.c3c-form-card {
    background: #fff;
    border-radius: var(--c3c-radius);
    padding: 32px;
    box-shadow: var(--c3c-shadow);
    border: 1px solid #f1f3f7;
    animation: c3cFadeIn .5s ease;
}

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

.c3c-step-content {
    animation: c3cSlideIn .45s cubic-bezier(.4, 0, .2, 1);
}

@keyframes c3cSlideIn {
    from { opacity: 0; transform: translateX(-15px); }
    to   { opacity: 1; transform: translateX(0); }
}

.c3c-step-header {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 2px dashed #f1f3f7;
}
.c3c-step-header-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, #eef2ff, #f5f3ff);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.c3c-step-header-icon svg {
    width: 24px;
    height: 24px;
    color: var(--c3c-primary);
    display: block;
}
.c3c-step-header h2 {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 700;
}
.c3c-step-header p {
    margin: 0;
    color: var(--c3c-muted);
    font-size: 14px;
}

/* ============================================================
   فیلدهای ورودی
   ============================================================ */
.c3c-row {
    display: flex;
    gap: 16px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.c3c-field {
    flex: 1;
    min-width: 200px;
}
.c3c-full { flex: 1 1 100%; }

.c3c-field label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}
.c3c-field .req { color: var(--c3c-danger); }

.c3c-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--c3c-bg-soft);
    border: 2px solid transparent;
    border-radius: var(--c3c-radius-sm);
    transition: all .25s;
}
.c3c-input-wrap:hover {
    background: #f3f4f6;
}
.c3c-input-wrap:focus-within {
    background: #fff;
    border-color: var(--c3c-primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, .12);
}

.c3c-input-wrap > svg {
    width: 18px;
    height: 18px;
    color: #9ca3af;
    margin-right: 14px;
    flex-shrink: 0;
    transition: color .2s;
    display: block;
}
.c3c-input-wrap:focus-within > svg {
    color: var(--c3c-primary);
}

.c3c-input-wrap input,
.c3c-input-wrap textarea {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    padding: 14px 14px 14px 16px;
    font-family: inherit;
    font-size: 14px;
    color: var(--c3c-text);
    resize: vertical;
    line-height: 1.6;
    min-width: 0;
}
.c3c-input-wrap input::placeholder,
.c3c-input-wrap textarea::placeholder {
    color: #9ca3af;
}

.c3c-textarea-wrap {
    align-items: flex-start;
}
.c3c-textarea-wrap > svg {
    margin-top: 16px;
}
.c3c-textarea-wrap textarea {
    padding-top: 14px;
    min-height: 80px;
}

/* حالت خطا */
.c3c-input-wrap.c3c-field-error {
    border-color: var(--c3c-danger);
    background: #fef2f2;
    animation: c3cShake .4s;
}
@keyframes c3cShake {
    0%, 100% { transform: translateX(0); }
    25%      { transform: translateX(-4px); }
    75%      { transform: translateX(4px); }
}

/* ============================================================
   گزینه‌های رادیویی
   ============================================================ */
.c3c-options-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.c3c-option-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    border: 2px solid var(--c3c-border);
    border-radius: var(--c3c-radius-sm);
    background: #fff;
    cursor: pointer;
    transition: all .25s cubic-bezier(.4, 0, .2, 1);
    position: relative;
    overflow: hidden;
    margin: 0;
}
.c3c-option-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(99, 102, 241, .04), rgba(139, 92, 246, .04));
    opacity: 0;
    transition: opacity .3s;
    pointer-events: none;
}
.c3c-option-card:hover {
    border-color: #c7d2fe;
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(99, 102, 241, .1);
}
.c3c-option-card:hover::before {
    opacity: 1;
}
.c3c-option-card.selected {
    border-color: var(--c3c-primary);
    background: linear-gradient(135deg, #f5f3ff, #eef2ff);
    box-shadow: 0 10px 28px rgba(99, 102, 241, .2);
}
.c3c-option-card.selected::before {
    opacity: 1;
}

.c3c-option-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}

.c3c-option-radio {
    width: 22px;
    height: 22px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
    transition: all .25s;
    background: #fff;
    z-index: 1;
}
.c3c-option-radio::after {
    content: '';
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    background: var(--c3c-primary);
    transform: scale(0);
    transition: transform .25s cubic-bezier(.4, 0, .2, 1);
}
.c3c-option-card.selected .c3c-option-radio {
    border-color: var(--c3c-primary);
}
.c3c-option-card.selected .c3c-option-radio::after {
    transform: scale(1);
}

.c3c-option-icon-box {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all .3s;
    z-index: 1;
}
.c3c-option-icon-box svg {
    width: 22px;
    height: 22px;
    color: var(--c3c-muted);
    display: block;
}
.c3c-option-card.selected .c3c-option-icon-box {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
}
.c3c-option-card.selected .c3c-option-icon-box svg {
    color: #fff;
}

.c3c-gateway-icon img {
    max-width: 36px;
    height: auto;
    display: block;
}

.c3c-option-content {
    flex: 1;
    position: relative;
    z-index: 1;
    min-width: 0;
}
.c3c-option-title {
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 2px;
}
.c3c-option-desc,
.c3c-option-price {
    color: var(--c3c-muted);
    font-size: 13px;
}
.c3c-option-price {
    font-weight: 700;
    color: var(--c3c-primary-dark);
    font-size: 14px;
}

/* ============================================================
   هشدارها
   ============================================================ */
.c3c-alert {
    padding: 16px 18px;
    border-radius: var(--c3c-radius-sm);
    font-size: 14px;
    border-right: 4px solid;
    margin-bottom: 18px;
}
.c3c-alert-warning {
    background: #fef3c7;
    border-color: var(--c3c-warning);
    color: #92400e;
}
.c3c-alert-error {
    background: #fee2e2;
    border-color: var(--c3c-danger);
    color: #991b1b;
}

/* ============================================================
   یادداشت امنیتی
   ============================================================ */
.c3c-security-note {
    display: flex;
    gap: 14px;
    padding: 18px;
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border-radius: var(--c3c-radius-sm);
    margin-top: 20px;
    border: 1px solid #a7f3d0;
}
.c3c-security-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(16, 185, 129, .15);
}
.c3c-security-icon svg {
    width: 22px;
    height: 22px;
    color: var(--c3c-success);
    display: block;
}
.c3c-security-note strong {
    display: block;
    color: #065f46;
    margin-bottom: 4px;
    font-size: 14px;
}
.c3c-security-note p {
    margin: 0;
    color: #047857;
    font-size: 13px;
    line-height: 1.6;
}

/* ============================================================
   دکمه‌ها
   ============================================================ */
.c3c-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 30px;
    padding-top: 24px;
    border-top: 2px dashed #f1f3f7;
}

.c3c-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 26px;
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: all .25s cubic-bezier(.4, 0, .2, 1);
    position: relative;
    overflow: hidden;
    line-height: 1;
}
.c3c-btn svg {
    width: 18px;
    height: 18px;
    display: block;
}

.c3c-btn-primary {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    box-shadow: 0 8px 20px rgba(99, 102, 241, .35);
    margin-right: auto;
}
.c3c-btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
    opacity: 0;
    transition: opacity .3s;
}
.c3c-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(99, 102, 241, .45);
    color: #fff;
}
.c3c-btn-primary:hover::before {
    opacity: 1;
}
.c3c-btn-primary span,
.c3c-btn-primary svg {
    position: relative;
    z-index: 1;
}

.c3c-btn-ghost {
    background: #f3f4f6;
    color: #4b5563;
}
.c3c-btn-ghost:hover {
    background: #e5e7eb;
    color: var(--c3c-text);
    transform: translateX(3px);
}

.c3c-btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    box-shadow: 0 8px 20px rgba(16, 185, 129, .35);
    margin-right: auto;
}
.c3c-btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 30px rgba(16, 185, 129, .45);
    color: #fff;
}
.c3c-btn-lg {
    padding: 16px 32px;
    font-size: 16px;
}

/* ============================================================
   خلاصه سفارش
   ============================================================ */
.c3c-summary-card {
    background: #fff;
    border-radius: var(--c3c-radius);
    padding: 24px;
    box-shadow: var(--c3c-shadow);
    border: 1px solid #f1f3f7;
    position: sticky;
    top: 20px;
}
.c3c-summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 2px dashed #f1f3f7;
}
.c3c-summary-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
}
.c3c-summary-count {
    background: #eef2ff;
    color: var(--c3c-primary-dark);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.c3c-summary-items {
    max-height: 320px;
    overflow-y: auto;
    margin-bottom: 16px;
    padding-left: 4px;
}
.c3c-summary-items::-webkit-scrollbar {
    width: 4px;
}
.c3c-summary-items::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 999px;
}
.c3c-summary-items::-webkit-scrollbar-track {
    background: transparent;
}

.c3c-summary-item {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px dashed #f1f3f7;
}
.c3c-summary-item:last-child {
    border-bottom: none;
}

.c3c-summary-thumb {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    overflow: hidden;
    background: #f3f4f6;
    flex-shrink: 0;
    position: relative;
}
.c3c-summary-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.c3c-summary-info {
    flex: 1;
    min-width: 0;
}
.c3c-summary-name {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.c3c-summary-qty {
    font-size: 12px;
    color: var(--c3c-muted);
}
.c3c-summary-price {
    font-size: 13px;
    font-weight: 700;
    color: var(--c3c-primary-dark);
    white-space: nowrap;
}

.c3c-summary-totals {
    padding-top: 14px;
    border-top: 2px dashed #f1f3f7;
}
.c3c-total-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
}
.c3c-total-row span:first-child {
    color: var(--c3c-muted);
}
.c3c-discount span:last-child {
    color: var(--c3c-success);
    font-weight: 700;
}

.c3c-grand-total {
    margin-top: 10px;
    padding-top: 14px;
    border-top: 2px solid #f1f3f7;
    font-size: 16px;
    align-items: center;
}
.c3c-grand-total span:first-child {
    color: var(--c3c-text);
    font-weight: 700;
}
.c3c-grand-total strong {
    font-size: 20px;
    background: linear-gradient(135deg, #4f46e5, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 800;
}

.c3c-summary-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
    padding: 12px;
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border-radius: 10px;
    color: #047857;
    font-size: 12px;
    font-weight: 600;
}
.c3c-summary-footer svg {
    width: 14px;
    height: 14px;
    display: block;
}

/* ============================================================
   فوتر اعتماد
   ============================================================ */
.c3c-trust-footer {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 2px dashed #f1f3f7;
    flex-wrap: wrap;
}
.c3c-trust-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--c3c-muted);
    font-size: 13px;
    font-weight: 600;
}
.c3c-trust-item svg {
    width: 18px;
    height: 18px;
    color: var(--c3c-primary);
    display: block;
}

/* ============================================================
   سبد خرید خالی
   ============================================================ */
.c3c-empty {
    text-align: center;
    padding: 80px 20px;
    background: #fff;
    border-radius: var(--c3c-radius);
    box-shadow: var(--c3c-shadow);
    direction: rtl;
    font-family: 'Vazirmatn', Tahoma, sans-serif;
    max-width: 600px;
    margin: 40px auto;
}
.c3c-empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
}
.c3c-empty h3 {
    margin: 0 0 20px;
    color: #1f2937;
    font-size: 20px;
}

/* ============================================================
   واکنش‌گرایی
   ============================================================ */
@media (max-width: 900px) {
    .c3c-body {
        grid-template-columns: 1fr;
    }
    .c3c-summary-card {
        position: static;
        order: -1;
    }
}

@media (max-width: 600px) {
    .c3c-wrapper {
        padding: 0 12px 40px;
        margin: 16px auto;
    }
    .c3c-header h1 {
        font-size: 24px;
    }
    .c3c-header {
        margin-bottom: 28px;
    }
    .c3c-form-card {
        padding: 22px 18px;
    }
    .c3c-row {
        flex-direction: column;
        gap: 14px;
    }
    .c3c-field {
        min-width: 100%;
    }
    .c3c-indicator-circle {
        width: 44px;
        height: 44px;
    }
    .c3c-indicator-icon svg {
        width: 20px;
        height: 20px;
    }
    .c3c-indicator-title {
        font-size: 11px;
    }
    .c3c-progress-line {
        top: 22px;
        left: 40px;
        right: 40px;
    }
    .c3c-actions {
        flex-direction: column-reverse;
    }
    .c3c-btn {
        width: 100%;
        justify-content: center;
    }
    .c3c-trust-footer {
        gap: 20px;
    }
    .c3c-step-header {
        gap: 12px;
    }
    .c3c-step-header-icon {
        width: 40px;
        height: 40px;
    }
    .c3c-step-header h2 {
        font-size: 17px;
    }
}