/* استفاده از متغیر رنگی که از PHP تزریق می‌شود */
:root {
    /* رنگ پیش‌فرض اگر PHP ست نکند */
    --kaman-color: #d4af37; 
}

/* کانتینر اصلی */
.kaman-calc-container {
    display: flex;
    flex-wrap: wrap;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.06);
    overflow: hidden;
    font-family: inherit;
    direction: rtl;
    max-width: 1200px;
    margin: 40px auto;
    position: relative;
    border: 1px solid #f0f0f0;
}

.kaman-col-form {
    flex: 1;
    min-width: 320px;
    padding: 40px;
    border-left: 1px solid #f0f0f0;
}

.kaman-col-results {
    width: 560px; 
    background: #fbfbfb;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* استایل تصاویر */
.kaman-product-image img {
    width: 510px !important;
    max-width: 100% !important;
    height: auto !important;
    border-radius: 8px;
    border: 8px solid #fff; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    display: block;
}

.kaman-mobile-img {
    display: none;
    width: 100%;
    padding: 20px;
    background: #fbfbfb; 
    justify-content: center;
    border-bottom: 1px solid #f0f0f0;
}
.kaman-desktop-img img { margin-bottom: 30px; }

.kaman-title {
    text-align: right;
    margin-bottom: 30px;
    font-size: 1.4rem;
    font-weight: 800;
    color: #222;
}

.form-group { margin-bottom: 25px; }
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #444;
    font-size: 0.9rem;
}
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e1e1e1;
    border-radius: 10px;
    background-color: #f5f5f5;
    font-size: 0.95rem;
    outline: none;
    transition: 0.3s;
    height: 48px;
    font-family: inherit;
}
.form-group select:focus {
    border-color: var(--kaman-color);
    background-color: #fff;
}


.loan-template-additional-data {
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #fffcf5;
    border: 1px solid rgba(212, 175, 55, 0.25);
    color: #555;
    font-size: 0.85rem;
    line-height: 1.8;
    white-space: pre-line;
    display: none !important;
}

.bank-list-wrapper {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    min-height: 90px;
}
.disabled-wrapper {
    opacity: 0.6;
    pointer-events: none;
    filter: grayscale(100%);
}
.bank-item {
    border: 2px solid #e1e1e1;
    border-radius: 12px;
    padding: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    width: 90px;
    height: 90px;
    background: #fff;
    transition: all 0.2s;
    text-align: center;
}
.bank-item img {
    width: 50px !important;
    height: 50px !important;
    max-width: 50px !important;
    max-height: 50px !important;
    object-fit: contain !important;
    margin: 0 0 5px 0 !important;
    display: block !important;
    box-shadow: none !important;
    padding: 0 !important;
}
.bank-item span {
    font-size: 0.75rem;
    font-weight: 600;
    color: #555;
    white-space: nowrap;
}
.bank-item:hover {
    border-color: var(--kaman-color);
    background: #fffcf5;
}
.bank-item.selected {
    border: 2px solid var(--kaman-color);
    background: #fff;
    /* سایه با کمی شفافیت از رنگ اصلی */
    box-shadow: 0 4px 10px rgba(0,0,0, 0.1); 
}
.bank-item.selected span { color: #000; }

.slider-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.amount-badge {
    color: var(--kaman-color);
    font-weight: 700;
    font-size: 1.1rem;
    background: rgba(0,0,0, 0.05); /* بک گراند خنثی */
    padding: 2px 10px;
    border-radius: 5px;
}
input[type=range] {
    width: 100%;
    accent-color: var(--kaman-color);
    cursor: pointer;
}
.amount-slider-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}
.amount-slider-controls #amount-slider {
    flex: 1;
}
.amount-step-btn {
    /* width: 34px; */
    height: 34px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    color: var(--kaman-color);
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: 0.2s;
}
.amount-step-btn:hover:not(:disabled) {
    border-color: var(--kaman-color);
    background: #fffcf5;
}
.amount-step-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.kaman-results-box { width: 100%; max-width: 510px; }
.kaman-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 0.95rem;
    color: #666;
    border-bottom: 1px dashed #eee;
    padding-bottom: 10px;
}
.kaman-row.highlight {
    color: #000;
    font-weight: 800;
    font-size: 1.2rem;
    border-bottom: none;
    margin-top: 25px;
    background: #fff;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}
.kaman-note {
    font-size: 0.75rem;
    color: #bbb;
    text-align: center;
    margin-bottom: 25px;
    margin-top: 5px;
}

.kaman-actions { width: 100%; }
.full-width-btn {
    display: block;
    width: 100%;
    text-align: center;
    background: var(--kaman-color);
    color: #fff !important;
    text-decoration: none;
    padding: 15px;
    border-radius: 10px;
    font-weight: bold;
    font-size: 1rem;
    transition: 0.3s;
    box-shadow: 0 4px 15px rgba(0,0,0, 0.15);
    border: none;
}
.full-width-btn:hover {
    filter: brightness(90%); /* تیره کردن خودکار در هاور */
    transform: translateY(-2px);
}
.kaman-black-btn {
    background: #000;
}
.kaman-black-btn:hover {
    filter: brightness(80%);
}

.kaman-calc-container.kaman-no-image .kaman-col-form {
    border-left: none;
}
.kaman-calc-container.kaman-no-image .kaman-col-results {
    width: 100%;
}

.kaman-loader {
    position: absolute;
    top:0; left:0; right:0; bottom:0;
    background: rgba(255,255,255,0.9);
    z-index: 20;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
}
.kaman-loader div {
    border: 3px solid #eee;
    border-top: 3px solid var(--kaman-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 0.8s linear infinite;
    margin-bottom: 15px;
}
.loader-text {
    color: #555;
    font-size: 0.9rem;
    font-weight: bold;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

@media (max-width: 900px) {
    .kaman-calc-container { flex-direction: column; }
    .kaman-mobile-img { display: flex; }
    .kaman-mobile-img img { width: 100% !important; max-width: 510px !important; margin: 0 auto; }
    .kaman-desktop-img { display: none; }
    .kaman-col-form { border-left: none; padding: 30px 20px; }
    .kaman-col-results { width: 100%; padding: 30px 20px; background: #fbfbfb; }
}
