/* =========================================
   1. GENERAL LAYOUT & RESET
   ========================================= */
.lab-container, .lab-track-card {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 20px auto;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.08);
    font-family: inherit;
    position: relative;
    overflow: hidden;
    color: #444;
    line-height: 1.6;
    direction: rtl;
}

.lab-container { padding: 40px; }

/* انیمیشن تعویض مراحل */
.lab-step { display: none; animation: labFadeUp 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); }
.lab-step.active { display: block; }

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

/* =========================================
   2. FORM ELEMENTS & INPUTS
   ========================================= */
.lab-input {
    width: 100%;
    padding: 15px 18px;
    margin-bottom: 20px;
    border: 2px solid #f0f2f5;
    border-radius: 14px;
    background: #f9fafb;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s ease;
    box-sizing: border-box;
    color: #333;
}

.lab-input:focus {
    border-color: #3498db;
    background: #fff;
    outline: none;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.1);
}

.lab-input.half { width: 48%; display: inline-block; }
.row-lab { display: flex; justify-content: space-between; gap: 15px; }

/* حذف فلش‌های بالا/پایین در فیلد عدد (کد ملی) */
input[type=number]::-webkit-inner-spin-button, 
input[type=number]::-webkit-outer-spin-button { 
    -webkit-appearance: none; 
    margin: 0; 
}
input[type=number] { -moz-appearance: textfield; }

/* استایل اختصاصی برای Select Box */
select.lab-input {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    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='%233498db' 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 15px center;
    background-size: 18px;
    padding-left: 40px;
    cursor: pointer;
}

/* تیترهای جداکننده */
.lab-section-title {
    font-size: 16px; font-weight: 800; color: #2c3e50;
    margin: 35px 0 20px 0; padding-bottom: 10px;
    border-bottom: 2px solid #f0f2f5; display: flex; align-items: center;
}
.lab-section-title::before {
    content: ''; display: inline-block; width: 6px; height: 24px;
    background: #3498db; border-radius: 10px; margin-left: 12px;
}

.lab-radio-group {
    display: flex; gap: 20px; flex-wrap: wrap;
    background: #f8f9fa; padding: 15px; border-radius: 12px;
    border: 1px dashed #dce1e6; margin-bottom: 20px;
}
.lab-radio-group label { cursor: pointer; font-weight: 600; display: flex; align-items: center; gap: 8px; margin-left: 100px;}

/* =========================================
   3. BUTTONS & CARDS
   ========================================= */
.lab-btn {
    padding: 15px 35px; border: none; border-radius: 12px;
    cursor: pointer; font-size: 16px; font-weight: 700;
    transition: all 0.3s ease; color: #fff;
    background: #7f8c8d; text-decoration: none;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.lab-btn.primary { background: linear-gradient(135deg, #3498db, #2980b9); box-shadow: 0 8px 20px rgba(52, 152, 219, 0.3); }
.lab-btn.success {
    background: linear-gradient(135deg, #3497da, #0272b1);
    box-shadow: 0 8px 20px rgb(57 155 221 / 40%);
}
.lab-btn.small { padding: 8px 20px; font-size: 13px; border-radius: 8px; }

.lab-btn:hover { transform: translateY(-3px); box-shadow: 0 12px 25px rgba(0,0,0,0.15); filter: brightness(1.1); }
.lab-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; filter: grayscale(1); }

/* کارت‌های انتخاب مسیر */
.lab-cards-row { display: flex; gap: 20px; margin-top: 20px; flex-wrap: wrap; }

.lab-card-btn {
    flex: 1; min-width: 200px; padding: 35px 20px; text-align: center;
    border: 2px solid #f0f2f5; border-radius: 20px; cursor: pointer;
    transition: all 0.3s ease; font-weight: 700; font-size: 17px;
    color: #555; background: #fff;
}
.lab-card-btn:hover {
    border-color: #3498db; background: #f0f9ff; color: #3498db;
    transform: translateY(-5px); box-shadow: 0 15px 30px rgba(52, 152, 219, 0.15);
}
.lab-card-btn span { display: block; font-size: 12px; font-weight: normal; margin-top: 10px; }
.lab-card-btn i { font-size: 40px; margin-bottom: 15px; color: #0272b1; transition: 0.3s; display: inline-block; }
.lab-card-btn:hover i { color: #3498db; transform: scale(1.1); }

/* =========================================
   4. TABS & TEST ITEMS
   ========================================= */
.lab-tabs { display: flex; flex-wrap: wrap; gap: 10px; padding-bottom: 15px; margin-bottom: 15px; }
.lab-tab {
    background: #fff; border: 1px solid #eef0f2; padding: 10px 22px;
    border-radius: 10px; cursor: pointer; font-size: 13px; color: #555;
    font-weight: 600; transition: all 0.2s; box-shadow: 0 2px 5px rgba(0,0,0,0.03);
    flex-grow: 0; flex-shrink: 0;
}
.lab-tab:hover { background: #f8f9fa; color: #3498db; transform: translateY(-2px); border: 1px solid #dcebf7; }
.lab-tab.active { background: #3498db; color: #fff; border-color: #3498db; box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3); transform: translateY(-2px); }

.lab-tests-list { padding: 5px; }
.lab-test-item {
    background: #fff; border: 1px solid #f0f2f5; border-radius: 16px;
    margin-bottom: 15px; overflow: hidden; transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.02);
}
.lab-test-item:hover { transform: translateY(-3px); box-shadow: 0 10px 25px rgba(0,0,0,0.06); border-color: #a4d0ef; }

.lab-test-head {
    padding: 18px 20px; cursor: pointer; display: flex; justify-content: space-between;
    align-items: center; font-weight: 700; font-size: 15px; color: #333; background: #fff;
}
.lab-test-head i { 
    color: #ccc; background: #f5f5f5; border-radius: 50%; 
    width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; 
    transition: 0.3s; margin-right: 10px; font-size: 14px;
}
.lab-test-head.open i { transform: rotate(180deg); background: #e3f2fd; color: #3498db; }

.lab-test-body { display: none; background: #fcfcfc; border-top: 1px dashed #eee; padding: 20px; }
.lab-test-desc { font-size: 13px; color: #666; line-height: 1.8; margin-bottom: 15px; text-align: justify; }
.lab-test-footer {
    display: flex; justify-content: space-between; align-items: center;
    background: #fff; padding: 12px; border-radius: 10px; border: 1px solid #eee;
}
.lab-price { font-weight: 800; color: #2c3e50; }

.lab-cart { background: #fff; padding: 25px; border: 2px dashed #3498db; border-radius: 16px; margin-top: 20px; }

/* =========================================
   5. TRACKING & SUCCESS
   ========================================= */
.lab-track-header { background: linear-gradient(135deg, #2c3e50, #34495e); padding: 40px 30px; color: #fff; text-align: center; }
.lab-track-header h2 { margin: 0 0 10px 0; color: #fff; font-size: 24px; }
.lab-track-header p { opacity: 0.8; font-size: 14px; margin: 0; }
.lab-track-body { padding: 40px; }

.lab-status-steps {
    display: flex; justify-content: space-between; margin-bottom: 50px;
    position: relative; padding: 0 10px;
}
.lab-status-steps::before {
    content: ''; position: absolute; top: 20px; left: 20px; right: 20px;
    height: 3px; background: #e0e0e0; z-index: 1; border-radius: 5px;
}
.step-item { position: relative; z-index: 2; text-align: center; flex: 1; }
.step-icon {
    width: 40px; height: 40px; background: #fff;
    border: 3px solid #e0e0e0; border-radius: 50%; margin: 0 auto 10px;
    display: flex; align-items: center; justify-content: center;
    color: #ccc; transition: all 0.4s ease; font-size: 16px;
}
.step-text { font-size: 13px; color: #aaa; font-weight: 700; transition: 0.3s; }
.step-item.active .step-icon {
    border-color: #0272b1;
    background: #0272b1;
    color: #fff;
    transform: scale(1.2);
    box-shadow: 0 0 0 6px rgb(2 114 177 / 20%);
}
.step-item.active .step-text {
    color: #0272b1;
}

.success-icon-container {
    width: 100px; height: 100px; margin: 0 auto 25px;
    background: #e8f8f0; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    animation: pulseGreen 2s infinite;
}
@keyframes pulseGreen {
    0% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.4); }
    70% { box-shadow: 0 0 0 20px rgba(46, 204, 113, 0); }
    100% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); }
}
.success-icon-container i { font-size: 50px; color: #27ae60; }

.tracking-code-box {
    background: #f1f3f5; border: 2px dashed #ced4da;
    border-radius: 16px; padding: 25px; margin: 30px 0;
    text-align: center; position: relative;
}
.tracking-code-label { font-size: 12px; color: #888; text-transform: uppercase; letter-spacing: 1px; display: block; margin-bottom: 8px; font-weight: 700; }
.tracking-code-value { font-family: 'Courier New', monospace; font-size: 36px; font-weight: 900; color: #34495e; letter-spacing: 3px; display: block; user-select: all; }

.track-box { background: #fff; border: 1px solid #eee; border-radius: 16px; padding: 25px; margin-bottom: 25px; box-shadow: 0 5px 15px rgba(0,0,0,0.03); }
.track-box.payment {
    border-right: 5px solid #0272b1;
}
.track-box.result {
    border-right: 5px solid #0272b1;
}
button.lab-btn.small {
    background-color: #0272b1;
}
.result-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 15px; margin-top: 20px; }
.file-card {
    background: #f8f9fa; border: 1px solid #eee; border-radius: 12px;
    padding: 10px; text-align: center; transition: 0.3s;
    text-decoration: none; display: block; color: #555;
    width: 140px; flex-grow: 0; flex-shrink: 0;
}
.file-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.08); border-color: #3498db; color: #3498db; }
.file-card i { font-size: 40px; width: 40px; height: 40px; margin-bottom: 10px; display:block; margin-left:auto; margin-right:auto; }

/* =========================================
   6. LIGHTBOX
   ========================================= */
.lab-lightbox {
    position: fixed; top:0; left:0; width:100%; height:100%;
    background:rgba(0,0,0,0.95); z-index:10000; display:none;
    justify-content:center; align-items:center;
    user-select: none;
}
.lab-lightbox img { max-width:90%; max-height:85%; border-radius:4px; box-shadow: 0 0 50px rgba(0,0,0,0.8); border: 2px solid #333; }
.lab-lb-close {
    position:absolute; top:30px; left:40px; color:#fff; font-size:45px; cursor:pointer; opacity: 0.8; z-index: 10002; transition: 0.3s;
}
.lab-lb-close:hover { opacity: 1; color: #e74c3c; transform: rotate(90deg); }

.lab-lb-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 60px; height: 60px; background: rgba(255, 255, 255, 0.1);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 24px; cursor: pointer; transition: 0.3s; z-index: 10002;
    border: 1px solid rgba(255,255,255,0.2);
}
.lab-lb-nav:hover { background: rgba(255, 255, 255, 0.3); transform: translateY(-50%) scale(1.1); }
.lab-lb-nav.prev { right: 30px; } 
.lab-lb-nav.next { left: 30px; }

.lab-lb-counter {
    position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
    color: #fff; font-size: 16px; background: rgba(0,0,0,0.6);
    padding: 8px 20px; border-radius: 30px; letter-spacing: 2px;
}

/* =========================================
   7. ADMIN STYLES
   ========================================= */
.lab-modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.7); z-index: 9999; display: none; align-items: center; justify-content: center; backdrop-filter: blur(5px); }
.lab-modal { background: #fff; width: 95%; max-width: 700px; max-height: 90vh; border-radius: 16px; box-shadow: 0 30px 90px rgba(0,0,0,0.4); display: flex; flex-direction: column; }
.lab-modal-header { padding: 20px; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; background: #fafafa; border-radius: 16px 16px 0 0; }
.lab-modal-body { padding: 25px; overflow-y: auto; }
.lab-close-modal { background: none; border: none; font-size: 30px; cursor: pointer; color: #888; }
.lab-upload-area { border: 2px dashed #ccc; padding: 30px; text-align: center; border-radius: 12px; background: #fafafa; cursor: pointer; transition: 0.3s; position: relative; }
.lab-upload-area:hover { border-color: #3498db; background: #f0f8ff; }
.lab-upload-area input[type=file] { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }

/* =========================================
   8. DEFAULT STATE: DOTS HIDDEN ON DESKTOP
   ========================================= */
.lab-tabs-dots { display: none; }

/* =========================================
   9. RESPONSIVE (MOBILE)
   ========================================= */
@media (max-width: 600px) {
    .lab-container, .lab-track-card { padding: 20px 15px; margin: 15px auto; }
    .row-lab { flex-direction: column; gap: 0; }
        .lab-input.half {
        width: 90%;
        margin: 8px auto;
    }
    .lab-test-footer > div {
		justify-content: center;
		align-items: center !important;
	}
    /* باکس‌های انتخاب مسیر (زیر هم) */
    .lab-cards-row { flex-direction: column; gap: 15px; }
    .lab-card-btn { width: 100%; min-width: auto; font-size: 15px; padding: 25px; }
    
    /* --- تب‌های کاروسل --- */
    .lab-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
        margin-right: -15px; margin-left: -15px;
        padding-right: 15px; padding-left: 15px;
        padding-bottom: 10px;
        scrollbar-width: none; -ms-overflow-style: none;
    }
    .lab-tabs::-webkit-scrollbar { display: none; }
    .lab-tab { flex: 0 0 auto; white-space: nowrap; font-size: 12px; padding: 8px 16px; }

    /* --- استایل نقطه‌های موبایل --- */
    .lab-tabs-dots {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 6px;
        margin-bottom: 20px;
        margin-top: -5px;
    }
    .lab-dot {
        width: 8px;
        height: 8px;
        background-color: #dcdcdc;
        border-radius: 50%;
        transition: all 0.3s ease;
        cursor: pointer;
    }
    .lab-dot.active {
        width: 20px; /* حالت کپسولی */
        background-color: #3498db;
        border-radius: 10px;
    }
    /* ----------------------------- */

    .lab-test-head { padding: 15px; font-size: 14px; line-height: 1.4; }
    .lab-test-head span { width: 85%; }
    .lab-test-footer { flex-direction: column; align-items: stretch; gap: 10px; text-align: center; padding: 15px; }
    .lab-price { margin-bottom: 5px; font-size: 16px; }
    .lab-test-footer .lab-btn { width: 100%; display: block; }

    .lab-status-steps { padding: 0; margin-bottom: 30px; }
    .step-text { font-size: 10px; margin-top: 5px; display: block; }
    .step-icon { width: 32px; height: 32px; border-width: 2px; font-size: 14px; }
    .lab-status-steps::before { top: 16px; height: 2px; }
    
    .tracking-code-value { font-size: 24px; letter-spacing: 1px; }
    .success-icon-container { width: 80px; height: 80px; }
    .success-icon-container i { font-size: 40px; }
    
    .lab-btn { width: 100%; box-sizing: border-box; margin-bottom: 10px; padding: 12px; }

    .lab-lb-nav { width: 40px; height: 40px; font-size: 18px; background: rgba(255,255,255,0.2); }
    .lab-lb-nav.prev { right: 10px; }
    .lab-lb-nav.next { left: 10px; }
    .lab-lb-close { top: 20px; left: 20px; font-size: 35px; }
	.lab-radio-group label{margin-left:0px}
	.track-box.payment div {
		flex-direction: column;
		justify-content: center;
		align-items: center;
	}
	.track-box.payment button.lab-btn.success {
		padding: 5px 20px;
	}
}