/* محاسبه‌گر ارزی پیشرفته شریف ویزا - طراحی مدرن و بهینه */
.svc-calculator-wrapper {
    margin: 0 auto;
    padding: 0;
    /* استفاده از فونت‌های وردپرس */
    font-family:var(--awb-text-font-family);
    direction: rtl;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1), 0 8px 32px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 1;
}

/* تب‌های بالایی */
.svc-tabs-container {
    display: flex;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e0 transparent;
    padding: 8px 16px 0;
    position: relative;
    z-index: 2;
}

.svc-tabs-container::-webkit-scrollbar {
    height: 4px;
}

.svc-tabs-container::-webkit-scrollbar-track {
    background: transparent;
}

.svc-tabs-container::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 2px;
}

.svc-tab-btn {
    background: transparent;
    border: none;
    padding: 16px 24px;
    cursor: pointer;
    font-size: 14px;
    color: #64748b;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    min-width: fit-content;
    border-radius: 16px 16px 0 0;
    position: relative;
    margin: 0 4px;
    font-family: inherit;
}

.svc-tab-btn:hover {
    background: rgba(59, 130, 246, 0.05);
    color: #3b82f6;
    transform: translateY(-2px);
}

.svc-tab-btn.active {
    color: #3b82f6;
    background: linear-gradient(135deg, #ffffff 0%, #f0f9ff 100%);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
    border-bottom: 3px solid #3b82f6;
}

.svc-tab-icon {
    font-size: 18px;
    line-height: 1;
}

/* فرم محاسبه‌گر */
.svc-calculator-form {
background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    padding: 0px 30px;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
}

/* تغییرات CSS برای نمایش دسته‌بندی شده خدمات */

/* تنظیم Form Row برای 5 ستون شامل قیمت */
.svc-form-row {
    display: grid;
    grid-template-columns: 2fr 2fr 0.9fr 1.3fr 1fr auto;
    gap: 20px;
    align-items: end;
    margin-bottom: 24px;
    min-height: 140px;
}

/* استایل گروه قیمت */
.svc-price-group {
    display: flex;
    flex-direction: column;
}

.svc-price-group .svc-price-label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    text-transform: none;
    letter-spacing: 0.3px;
    font-family: inherit;
}

/* نمایش قیمت inline */
.svc-inline-price-display {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 14px 20px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    min-height: 52px; /* همان ارتفاع input و button */
    display: flex;
    align-items: center;
    justify-content: center;
}

.svc-inline-price-value {
    font-size: 16px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    font-family: inherit;
    line-height: 1.2;
}
input#svc-amount-input{
    height:52px;
}
/* placeholder وقتی قیمت محاسبه نشده */
.svc-no-price-placeholder {
    background: #f8fafc;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    padding: 14px 20px;
    text-align: center;
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.svc-placeholder-text {
    color: #9ca3af;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
}

/* انیمیشن نمایش قیمت */
.svc-inline-price-display.show {
    animation: priceSlideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes priceSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* پیام کارمزد زیر فرم */
/*.svc-commission-info {*/
/*    text-align: center;*/
/*    font-size: 13px;*/
/*    color: #6b7280;*/
/*    background: #f8fafc;*/
/*    padding: 12px 20px;*/
/*    border-radius: 12px;*/
/*    border: 1px solid #e5e7eb;*/
/*    margin-top: 16px;*/
/*    font-family: inherit;*/
/*}*/

/* تنظیم دکمه ثبت سفارش */
.svc-submit-btn {
    min-height: 52px; /* همان ارتفاع قیمت */
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 140px;
}

/* تنظیم برای موبایل */
@media (max-width: 1200px) {
    .svc-form-row {
        grid-template-columns: 1fr 1fr 1fr; /* 3 ستون در تبلت */
        gap: 16px;
    }
    
    .svc-price-group {
        grid-column: 1 / -1; /* قیمت در ردیف جداگانه */
        margin-top: 16px;
    }
    
    .svc-submit-btn {
        grid-column: 1 / -1;
        margin-top: 16px;
    }
}

@media (max-width: 768px) {
    .svc-form-row {
        grid-template-columns: 1fr; /* 1 ستون در موبایل */
        gap: 20px;
    }
    
    .svc-price-group,
    .svc-submit-btn {
        grid-column: auto;
        margin-top: 0;
    }
    
    /* در موبایل قیمت و دکمه در یک ردیف */
    .svc-mobile-price-submit {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 16px;
        align-items: center;
        margin-top: 20px;
    }
}

/* بهبود responsive */
@media (max-width: 1024px) {
    .svc-form-row {
        grid-template-columns: 2fr 1fr 1fr 1fr; /* 4 ستون */
        gap: 16px;
    }
    
    .svc-price-group {
        grid-column: 1; /* قیمت در 2 ستون اول ردیف بعد */
        grid-row: 4;
    }
    
    .svc-submit-btn {
        grid-column: 3 / 5; /* دکمه در 2 ستون آخر همان ردیف */
        grid-row: 2;
    }
}

/* تنظیم service-type-group وقتی نمایش داده می‌شود */
#svc-service-type-group.show ~ .svc-price-group {
    /* اگر نوع خدمت نمایش داده شود، باید grid تنظیم شود */
}

/* وقتی amount-group مخفی است (برای قیمت ثابت) */
#svc-amount-group[style*="display: none"] ~ .svc-price-group {
    /* تنظیمات خاص برای حالت قیمت ثابت */
}

/* بهبود visual feedback */
.svc-inline-price-display:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 25px rgba(16, 185, 129, 0.4);
}

.svc-no-price-placeholder:hover {
    border-color: #d1d5db;
    background: #f3f4f6;
}

/* حالت تیره */
@media (prefers-color-scheme: dark) {
    .svc-no-price-placeholder {
        background: #1f2937;
        border-color: #4b5563;
    }
    
    .svc-placeholder-text {
        color: #6b7280;
    }
    
    .svc-commission-info {
        background: #1f2937;
        border-color: #4b5563;
        color: #d1d5db;
    }
    
    .svc-price-group .svc-price-label {
        color: #f9fafb;
    }
}

/* اطمینان از alignment صحیح */
.svc-form-group {
    min-height: 76px; /* شامل label + input */
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.svc-form-group label {
    margin-bottom: 8px;
    flex-shrink: 0;
}

.svc-select,
.svc-input,
.svc-inline-price-display,
.svc-no-price-placeholder,
.svc-submit-btn {
    height: 52px; /* ارتفاع یکسان برای همه عناصر */
    flex-shrink: 0;
}

/* استایل مدرن برای Select ها */
.svc-select-container {
    position: relative;
    width: 100%;
    z-index: 10;
}

.svc-select {
    width: 100%;
    padding: 14px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
    font-size: 14px;
    color: #374151;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    outline: none;
    appearance: none;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    position: relative;
    z-index: 1;
}

.svc-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1), 0 8px 25px -5px rgba(59, 130, 246, 0.3);
    transform: translateY(-1px);
}

.svc-select:hover {
    border-color: #9ca3af;
    box-shadow: 0 8px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.svc-select.placeholder {
    color: #9ca3af;
}

/* آیکون فلش کشویی */
.svc-select-container::after {
    content: "▼";
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    pointer-events: none;
    font-size: 12px;
    transition: all 0.3s ease;
    z-index: 2;
}

.svc-select-container.open::after {
    transform: translateY(-50%) rotate(180deg);
    color: #3b82f6;
}

/* کشویی سفارشی - بهبود z-index */
.svc-custom-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-top: none;
    border-radius: 0 0 16px 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    z-index: 9999; /* افزایش z-index برای اطمینان از نمایش روی سایر المان‌ها */
    max-height: 300px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    display: none;
}

/* اطمینان از نمایش کشویی روی همه چیز */
.svc-select-container.open {
    z-index: 10000;
}

.svc-custom-dropdown.open {
    display: block;
    animation: dropdownSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10001;
}

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

/* جعبه جستجو */
.svc-search-box {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    background: #f8fafc;
}

.svc-search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    outline: none;
    transition: all 0.2s ease;
    font-family: inherit;
}

.svc-search-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

/* لیست گزینه‌ها */
.svc-options-list {
    max-height: 250px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e0 #f1f5f9;
}

.svc-options-list::-webkit-scrollbar {
    width: 6px;
}

.svc-options-list::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.svc-options-list::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.svc-option {
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    color: #374151;
    border-bottom: 1px solid #f8fafc;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
}

.svc-option:hover {
    background: #f1f5f9;
    color: #1f2937;
}

.svc-option.selected {
    background: #eff6ff;
    color: #3b82f6;
    font-weight: 500;
}

.svc-option.highlighted {
    background: #e0f2fe;
    color: #0369a1;
}

.svc-option-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

/* ورودی متن */
.svc-input {
    width: 100%;
    padding: 14px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 15px!important;
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
    font-size: 14px;
    color: #374151;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    outline: none;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.svc-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1), 0 8px 25px -5px rgba(59, 130, 246, 0.3);
    transform: translateY(-1px);
}

.svc-input:hover {
    border-color: #9ca3af;
    box-shadow: 0 8px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* دکمه ثبت سفارش */
.svc-submit-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 16px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    box-shadow: 0 10px 20px rgba(59, 130, 246, 0.3), 0 6px 6px rgba(59, 130, 246, 0.2);
    min-width: 140px;
    height: fit-content;
    position: relative;
    overflow: hidden;
    font-family: inherit;
    z-index: 1;
}

.svc-submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.svc-submit-btn:hover::before {
    left: 100%;
}

.svc-submit-btn:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(59, 130, 246, 0.4), 0 8px 16px rgba(59, 130, 246, 0.3);
}

.svc-submit-btn:active {
    transform: translateY(0);
}

.svc-submit-btn:disabled {
    background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* نمایش قیمت */
.svc-price-display {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-radius: 20px;
    padding: 28px;
    text-align: center;
    color: white;
    box-shadow: 0 20px 40px rgba(16, 185, 129, 0.3), 0 10px 20px rgba(16, 185, 129, 0.2);
    animation: slideInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 24px;
    backdrop-filter: blur(10px);
    overflow: hidden;
    z-index: 1;
}

/*.svc-price-display::before {*/
/*    content: '';*/
/*    position: absolute;*/
/*    top: -50%;*/
/*    left: -50%;*/
/*    width: 200%;*/
/*    height: 200%;*/
/*    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);*/
/*    animation: shimmer 3s linear infinite;*/
/*}*/

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

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

.svc-price-info {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.svc-price-label {
    font-size: 18px;
    font-weight: 500;
    opacity: 0.95;
    font-family: inherit;
}

.svc-price-value {
    font-size: 36px;
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    font-family: inherit;
}

.svc-commission-info {
    font-size: 14px;
    opacity: 0.9;
    padding: 10px 10px;
    display: flex;
    min-height: 75px;
    font-family: inherit;
    flex-direction: column-reverse;
}

/* پیام‌های هشدار */
.svc-warning {
    background: linear-gradient(135deg, #fef3cd 0%, #fde68a 100%);
    border: 1px solid #f59e0b;
    border-radius: 16px;
    padding: 20px 24px;
    color: #92400e;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    margin-top: 20px;
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.2);
    animation: shake 0.5s ease-in-out;
    font-family: inherit;
    z-index: 1;
    position: relative;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* حالت بارگذاری */
.svc-loading {
    text-align: center;
    padding: 24px;
    color: #6b7280;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 16px;
    backdrop-filter: blur(10px);
    font-family: inherit;
    z-index: 1;
    position: relative;
}

.svc-loading::before {
    content: "";
    width: 24px;
    height: 24px;
    border: 3px solid #e5e7eb;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* حالت مخفی برای فیلدهای اختیاری */
#svc-service-type-group {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#svc-service-type-group.show {
    display: flex !important;
    animation: fadeInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* لودینگ اسکلتون برای کشویی‌ها */
.svc-select.loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    color: transparent;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* بهبود برای موبایل */
@media (max-width: 1200px) {
    .svc-form-row {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 16px;
    }
    
    .svc-submit-btn {
        grid-column: 1 / -1;
        margin-top: 16px;
    }
}

@media (max-width: 768px) {
    .svc-calculator-wrapper {
        margin: 0 -16px;
        border-radius: 0;
    }

    .svc-calculator-form {
        padding: 24px 16px;
    }
    
    .svc-form-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .svc-tab-btn {
        padding: 12px 16px;
        font-size: 13px;
        gap: 6px;
    }
    
    .svc-tab-icon {
        font-size: 16px;
    }
    
    .svc-price-value {
        font-size: 28px;
    }
    
    .svc-price-info {
        flex-direction: column;
        gap: 8px;
    }
    
    .svc-select,
    .svc-input {
        padding: 1px 20px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .svc-custom-dropdown {
        max-height: 250px;
        /* در موبایل، z-index بیشتری نیاز داریم */
        z-index: 99999;
    }
    
    .svc-select-container.open {
        z-index: 100000;
    }
    
    .svc-custom-dropdown.open {
        z-index: 100001;
    }
}

@media (max-width: 480px) {
    .svc-tabs-container {
        flex-wrap: nowrap;
        overflow-x: scroll;
        padding: 8px;
    }
    
    .svc-tab-btn {
        padding: 10px 12px;
        font-size: 12px;
        min-width: 100px;
        justify-content: center;
    }
    
    .svc-calculator-form {
        padding: 16px 12px;
    }
    
    .svc-price-display {
        padding: 24px 16px;
        margin-top: 20px;
    }
    
    .svc-submit-btn {
        padding: 18px 24px;
        font-size: 16px;
        width: 100%;
    }
}

/* تنظیمات پرینت */
@media print {
    .svc-calculator-wrapper {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .svc-submit-btn {
        display: none;
    }
    
    .svc-tabs-container {
        background: #f5f5f5;
    }
    
    .svc-calculator-form {
        background: #fafafa;
    }
}

/* حالت تیره - با وراثت فونت */
@media (prefers-color-scheme: dark) {
    .svc-calculator-wrapper {
        background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
        color: #f9fafb;
    }
    
    .svc-tabs-container {
        background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
        border-bottom-color: #4b5563;
    }
    
    .svc-tab-btn {
        color: #d1d5db;
    }
    
    .svc-tab-btn:hover {
        background: rgba(59, 130, 246, 0.1);
        color: #60a5fa;
    }
    
    .svc-tab-btn.active {
        background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
        color: #f9fafb;
        border-bottom-color: #3b82f6;
    }
    
    .svc-calculator-form {
        background: linear-gradient(135deg, #374151 0%, #1f2937 100%);
    }
    
    .svc-select,
    .svc-input {
        background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
        border-color: #4b5563;
        color: #f9fafb;
    }
    
    .svc-custom-dropdown {
        background: #1f2937;
        border-color: #4b5563;
    }
    
    .svc-option {
        color: #d1d5db;
        border-bottom-color: #374151;
    }
    
    .svc-option:hover {
        background: #374151;
        color: #f9fafb;
    }
    
    .svc-search-box {
        background: #374151;
        border-bottom-color: #4b5563;
    }
    
    .svc-search-input {
        background: #1f2937;
        border-color: #4b5563;
        color: #f9fafb;
    }
}

/* بهبود عملکرد */
.svc-calculator-wrapper * {
    box-sizing: border-box;
}

.svc-tabs-container {
    will-change: scroll-position;
}

.svc-tab-btn {
    will-change: transform, background-color;
}

.svc-price-display {
    will-change: opacity, transform;
}

.svc-custom-dropdown {
    will-change: opacity, transform;
}

/* تصحیحات خاص مرورگر */
@supports (-webkit-appearance: none) {
    .svc-select {
        -webkit-appearance: none;
    }
}

@supports (-moz-appearance: none) {
    .svc-select {
        -moz-appearance: none;
    }
}

/* اطمینان از نمایش کشویی در تمام شرایط */
.svc-custom-dropdown {
    /* Fixed positioning برای موارد خاص */
    position: absolute !important;
    z-index: 999999 !important;
}

/* Override برای theme های که z-index بالایی دارند */
.svc-calculator-wrapper .svc-custom-dropdown.open {
    z-index: 999999 !important;
    position: absolute !important;
}

/* بهبود نمایش در صفحاتی با header sticky */
@media (min-width: 769px) {
    .svc-custom-dropdown {
        /* اگر header sticky دارید، این مقدار را تنظیم کنید */
        z-index: 9999 !important;
    }
}

/* بهبود accessibility */
.svc-select:focus-visible,
.svc-input:focus-visible,
.svc-submit-btn:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .svc-calculator-wrapper *,
    .svc-calculator-wrapper *::before,
    .svc-calculator-wrapper *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
/* Global Loading Overlay */
.svc-global-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    border-radius: 24px;
    min-height: 400px;
}

.svc-global-loading-content {
    text-align: center;
    padding: 40px;
}

.svc-loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: globalSpin 1.2s linear infinite;
    margin: 0 auto 20px;
}

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

.svc-loading-text {
    font-size: 18px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.svc-loading-subtext {
    font-size: 14px;
    color: #6b7280;
}

.svc-tab-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.svc-calculator-wrapper {
    /*position: relative;*/
}


/* مطمئن شو عرض ثابت باشه */
.select2-container {
    width: 100% !important;  /* یا عرض دلخواه */
    box-sizing: border-box;
}

/* fix برای dropdown در تب‌های مخفی */
.select2-dropdown {
    position: absolute !important;
    border-radius: 10px;
    margin-top:33px;
    z-index: 1050;  /* بالاتر از تب‌ها */
}

/* برای RTL */
.select2-container[dir="rtl"] .select2-selection--single {
    text-align: right;
    padding-right: 3px !important;
    padding-left: 3px;
}
.select2-selection__clear {
    display: none !important;
}
/* جلوگیری از تأثیر zoom یا resize */
body {
    transform: none !important;  /* fix pinch-zoom */
}

/* اگر تب‌ها مخفی/نمایش دارن */
.tab-pane .select2-container {
    display: block !important;
    visibility: visible !important;
}
.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered{
    padding-right: 3px !important;
    padding-left: 3px !important;
}
/* استایل سفارشی برای select ها بدون Select2 */
.svc-select {
    width: 100%;
    padding: 14px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
    font-size: 14px;
    color: #374151;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    height: 52px;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: left 10px center;
    background-size: 20px;
    padding-left: 40px;
}

.svc-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.svc-select:hover {
    border-color: #9ca3af;

/* ==================== استایل‌های Select2 سفارشی ==================== */

/* کانتینر اصلی */
.select2-container {
    width: 100% !important;
    display: block !important;
    box-sizing: border-box;
}

.select2-container * {
    box-sizing: border-box;
}

/* اطمینان از اینکه select2 در کانتینر والد به درستی نمایش داده شود */
.svc-form-group .select2-container {
    max-width: 100%;
}

.select2-container--default .select2-selection--single {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    height: 54px;
    padding: 0 16px;
    transition: all 0.3s ease;
    direction: rtl;
    display: flex;
    align-items: center;
}

.select2-container--default .select2-selection--single:hover {
    border-color: #cbd5e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

/* متن انتخاب شده */
.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #1e293b;
    line-height: 50px;
    padding: 0;
    font-size: 15px;
    font-weight: 500;
    text-align: right;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #94a3b8;
}

/* آیکون فلش */
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 50px;
    left: 12px;
    right: auto;
}

.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: #64748b transparent transparent transparent;
    border-width: 6px 5px 0 5px;
    margin-left: 0;
    margin-top: -3px;
}

.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
    border-color: transparent transparent #64748b transparent;
    border-width: 0 5px 6px 5px;
}

/* دراپ‌داون */
.select2-dropdown {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1), 0 4px 10px rgba(0, 0, 0, 0.06);
    margin-top: 4px;
    overflow: hidden;
    direction: rtl;
}

.select2-container--default.select2-container--open.select2-container--below .select2-selection--single {
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

/* جستجو */
.select2-search--dropdown {
    padding: 12px;
    background: #f8fafc;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    transition: border-color 0.2s;
    direction: rtl;
    text-align: right;
}

.select2-container--default .select2-search--dropdown .select2-search__field:focus {
    border-color: #3b82f6;
    outline: none;
}

/* آیتم‌های لیست */
.select2-results__options {
    max-height: 300px;
    padding: 4px;
}

.select2-container--default .select2-results__option {
    padding: 12px 16px;
    font-size: 14px;
    border-radius: 8px;
    margin: 2px 0;
    transition: all 0.2s;
    cursor: pointer;
    direction: rtl;
    text-align: right;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: #eff6ff;
    color: #1e40af;
}

.select2-container--default .select2-results__option[aria-selected=true] {
    background: #dbeafe;
    color: #1e40af;
    font-weight: 600;
}

/* گروه‌بندی (optgroup) */
.select2-container--default .select2-results__group {
    font-weight: 700;
    font-size: 13px;
    color: #64748b;
    padding: 12px 16px 8px;
    margin-top: 8px;
    border-bottom: 2px solid #e2e8f0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    direction: rtl;
    text-align: right;
}

.select2-container--default .select2-results__group:first-child {
    margin-top: 0;
}

.select2-container--default .select2-results__option[role="group"] {
    padding: 0;
}

.select2-container--default .select2-results__option--group .select2-results__option {
    padding-right: 24px;
}

/* پیام "نتیجه‌ای یافت نشد" */
.select2-container--default .select2-results__option--disabled {
    color: #94a3b8;
    cursor: default;
    background: transparent;
}

/* وضعیت غیرفعال */
.select2-container--default.select2-container--disabled .select2-selection--single {
    background-color: #f1f5f9;
    cursor: not-allowed;
    border-color: #e2e8f0;
}

.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__rendered {
    color: #94a3b8;
}

/* انیمیشن باز شدن */
.select2-dropdown {
    animation: slideDown 0.2s ease-out;
}

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

/* برای موبایل */
@media (max-width: 768px) {
    .select2-container--default .select2-selection--single {
        height: 58px;
    }
    
    .select2-container--default .select2-selection--single .select2-selection__rendered {
        line-height: 54px;
        font-size: 16px;
    }
    
    .select2-container--default .select2-selection--single .select2-selection__arrow {
        height: 54px;
    }
    
    .select2-results__options {
        max-height: 250px;
    }
}
