/* =================================================================
   Payment Plans Section Styles
   ================================================================= */

:root {
    --brand-primary: #f56614;
    --brand-primary-light: rgba(245, 102, 20, 0.1);
    --border-color: #e0e0e0;
    --background-light: #f8f9fa;
}

.f-bolder {
    font-weight: bolder;
}

a.btn-primary, button.btn-primary {
    color: #fff !important;
    background-color: var(--brand-primary) !important;
    border-color: var(--brand-primary) !important;
    font-size: 14px;
}

a.btn-primary:hover, button.btn-primary:hover {
    background-color: #e05a12 !important;
    border-color: #d05411 !important;
}

.c-f-color {
    color: var(--brand-primary);
}

/* --- Main Structure --- */
.payment-conditions-section {
    border: 1px solid var(--border-color);
    border-radius: .75rem;
    margin-top: 1.5rem;
    background-color: #fff;
    overflow: hidden;
}

/* Main Tab Styles */
.main-tabs {
    border-bottom: none;
    background-color: var(--background-light);
    padding: 0.5rem;
    border-radius: .5rem;
    margin: 0.5rem;
}

.main-tabs .nav-item {
    flex-grow: 1;
    text-align: center;
}

.main-tabs .nav-link {
    border: none;
    color: #5f5c6b;
    font-weight: bold;
    border-radius: .5rem !important;
    transition: all 0.2s ease-in-out;
    width: 100%;
}

.main-tabs .nav-link.active {
    background-color: #fff !important;
    color: var(--brand-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* --- Card Styles with Hover Effect --- */
.credit-plan-card, .monthly-option-card {
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.credit-plan-card:hover, .monthly-option-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.credit-plan-card {
    border: 1px solid var(--border-color);
    border-radius: .75rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    height: 100%;
}

/* --- Installment Section Specific Styles --- */
.nested-tabs {
    border-bottom: 1px solid var(--border-color);
    padding: 0 1rem;
}

.nested-tabs .nav-link {
    font-size: 15px;
    font-weight: 500;
    color: #6c757d;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 1rem 0.5rem;
    background-color: transparent !important;
    transition: all 0.2s ease-in-out;
    margin: 0 0.5rem;
}

.nested-tabs .nav-link.active {
    color: var(--brand-primary);
    border-bottom-color: var(--brand-primary);
    font-weight: bold;
}

/* Plan Header Style */
.plan-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
}

.plan-header img {
    max-width: 80px;
    flex-shrink: 0;
}

.plan-header-details h5 {
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.plan-header-details p {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 1rem;
}

.plan-header-details a.btn {
    min-width: 180px;
}

/* Monthly Option Card Styles */
.monthly-option-card {
    border: 1px solid var(--border-color);
    border-radius: .75rem;
    background-color: var(--background-light);
    padding: 1rem;
    height: 100%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.monthly-option-card .card-title {
    font-weight: bold;
    font-size: 1rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
}

.monthly-option-card ul {
    list-style: none;
    padding: 0;
    font-size: 14px;
}

.monthly-option-card ul li {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.monthly-option-card ul li span:first-child {
    color: #6c757d;
}

.monthly-option-card ul li span:last-child {
    font-weight: bold;
}

/* --- Animation & Loader Styles --- */
#animated-payment-section {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
    visibility: hidden;
}

#animated-payment-section.is-visible {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

.btn-outline-dashed {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
    border-style: dashed;
}

.btn-outline-dashed:hover {
    background-color: var(--brand-primary-light);
}

.loader-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--brand-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 3rem auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* --- استایل ساختار اصلی و دسته (نسخه نهایی و قطعی) --- */

/* ۱. پوشش اصلی */
.payment-section-wrapper {
    position: relative;
    /* margin-top به اینجا منتقل شد تا کل مجموعه با هم فاصله بگیرد */
    margin-top: 3.5rem;
}

/* ۲. استایل دسته (بدون تغییر) */
.plan-handle-container {
    position: absolute;
    top: -21px; /* نصف ارتفاع دسته به سمت بالا */
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.plan-handle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(to right, #ffaf29, #d9480f);
    color: #fff;
    padding: 0.5rem 1.5rem;
    border-radius: 50rem;
    font-weight: bold;
    font-size: 14px;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.plan-handle i {
    font-size: 1.2rem;
}

/* ۳. استایل باکس اصلی (اصلاح شده) */
.payment-conditions-section {
    /* position: relative از اینجا حذف شد */
    border: 1px solid var(--border-color);
    border-radius: .75rem;
    background-color: #fff;
    overflow: hidden;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.07);
    /* padding-top: 25px; <-- این خط حذف شد تا فاصله داخلی از بین برود */
}