/**
 * sngr Frontend Styles
 * استایل‌های تایم‌لاین، باکس رهگیری و باکس آماده‌سازی
 */

/* ============================================
   تایم‌لاین
   ============================================ */
.sngr-timeline-container {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin: 0 0 20px 0;
}
.sngr-timeline-title {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #333;
}
.sngr-timeline-progress-bar {
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    margin-bottom: 20px;
    overflow: hidden;
}
.sngr-timeline-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #007cba);
    border-radius: 3px;
    transition: width 0.5s ease;
}
.sngr-timeline-steps {
    display: flex;
    justify-content: space-between;
    position: relative;
    flex-wrap: wrap;
    gap: 10px 0;
}
.sngr-timeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 60px;
    position: relative;
    text-align: center;
}
.sngr-timeline-step .sngr-step-dot {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid #dee2e6;
    background: #fff;
    margin-bottom: 5px;
    transition: all 0.3s;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #fff;
    font-weight: bold;
}
.sngr-timeline-step .sngr-step-dot.active {
    border-color: #007cba;
    background: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.3);
}
.sngr-timeline-step .sngr-step-dot.completed {
    border-color: #28a745;
    background: #28a745;
}
.sngr-timeline-step .sngr-step-dot.completed::after {
    content: none !important;
    display: none !important;
}
.sngr-timeline-step .sngr-step-dot .sngr-icon {
    color: #fff;
    font-weight: bold;
    font-size: 14px;
    line-height: 1;
}
.sngr-timeline-step .sngr-step-label {
    font-size: 13px;
    color: #6c757d;
    max-width: 100px;
    word-wrap: break-word;
}
.sngr-timeline-step .sngr-step-label.active {
    color: #007cba;
    font-weight: 600;
}
.sngr-timeline-step .sngr-step-label.completed {
    color: #28a745;
}
.sngr-timeline-step .sngr-step-date {
    font-size: 13px;
    color: #adb5bd;
    margin-top: 2px;
}
.sngr-timeline-connector {
    position: absolute;
    top: 20px;
    left: 0;
    width: 100%;
    height: 3px;
    background: #dee2e6;
    z-index: 0;
}
.sngr-timeline-connector .sngr-connector-fill {
    height: 100%;
    background: #28a745;
    transition: width 0.5s ease;
}

/* ============================================
   باکس رهگیری
   ============================================ */
.sngr-tracking-box {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}
.sngr-tracking-box-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #333;
}
.sngr-tracking-info-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 15px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}
.sngr-tracking-info-item {
    flex: 1;
    min-width: 150px;
}
.sngr-tracking-info-item label {
    display: block;
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 3px;
}
.sngr-tracking-info-item span {
    font-size: 15px;
    font-weight: 500;
    color: #212529;
}
.sngr-tracking-info-item .sngr-tracking-code {
    font-weight: bold;
    color: #007cba;
}
.sngr-tracking-link-btn {
    display: inline-block;
    padding: 5px 15px;
    background: #007cba;
    color: #fff !important;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.3s;
}
.sngr-tracking-link-btn:hover {
    background: #005a87;
    color: #fff !important;
}
.sngr-copy-btn {
    margin-left: 5px;
    padding: 0 5px;
    font-size: 12px;
    border: 1px solid #ddd;
    border-radius: 3px;
    background: #f8f9fa;
    cursor: pointer;
    transition: background 0.3s;
}
.sngr-copy-btn:hover {
    background: #e9ecef;
}

/* ============================================
   باکس زمان آماده‌سازی (صفحه محصول و تسویه)
   ============================================ */
.sngr-preparation-box {
    background: #f8f9fa !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 8px !important;
    padding: 15px !important;
    margin: 15px 0 !important;
    clear: both !important;
}
.sngr-preparation-box h4 {
    margin: 0 0 5px 0 !important;
    font-size: 15px !important;
    color: #333 !important;
}
.sngr-preparation-box p {
    margin: 0 0 3px 0 !important;
    font-size: 14px !important;
    color: #555 !important;
}
.sngr-preparation-box .sngr-estimated-date {
    margin: 0 !important;
    font-size: 13px !important;
    color: #007cba !important;
}
.sngr-preparation-box .sngr-note {
    margin: 5px 0 0 0 !important;
    font-size: 12px !important;
    color: #6c757d !important;
}

/* اطمینان از نمایش در صفحه محصول */
.woocommerce div.product .sngr-preparation-box {
    background: #f8f9fa !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 8px !important;
    padding: 15px !important;
    margin: 15px 0 !important;
}

/* ============================================
   تایم‌لاین عمودی در صفحات کوچک (موبایل)
   ============================================ */
@media (max-width: 768px) {
    /* تغییر جهت اصلی از افقی به عمودی */
    .sngr-timeline-steps {
        flex-direction: column;
        align-items: flex-start;
        gap: 22px;
        padding: 5px 0;
    }
    
    /* هر مرحله به صورت ردیفی (دایره + متن در یک خط) */
    .sngr-timeline-step {
        flex-direction: row;
        width: 100%;
        gap: 14px;
        justify-content: flex-start;
        align-items: center;
        min-width: unset;
        padding: 0 10px;
        position: relative;
    }
    
    /* دایره‌ها در حالت عمودی */
    .sngr-timeline-step .sngr-step-dot {
        width: 28px;
        height: 28px;
        font-size: 14px;
        border-width: 3px;
        margin-bottom: 0;
        flex-shrink: 0;
    }
    
    /* برچسب مرحله در حالت عمودی */
    .sngr-timeline-step .sngr-step-label {
        font-size: 14px;
        max-width: 130px;
        text-align: right;
    }
    
    /* تاریخ مرحله در حالت عمودی */
    .sngr-timeline-step .sngr-step-date {
        font-size: 12px;
        margin-top: 0;
        margin-right: auto;
        color: #6c757d;
    }
    
    /* خط اتصال افقی را مخفی کن */
    .sngr-timeline-connector {
        display: none !important;
    }
    
    /* خط عمودی بین مراحل - اصلاح موقعیت */
    .sngr-timeline-step:not(:last-child)::after {
        content: '';
        position: absolute;
        right: 13px;  /* (28px / 2) - 1px = 13px */
        top: 28px;    /* ارتفاع دایره (28px) */
        width: 2.5px;
        height: calc(100% + 4px);
        background: #dee2e6;
        z-index: 0;
    }
    
    /* مرحله فعلی (active) - خط عمودی با رنگ آبی */
    .sngr-timeline-step.active:not(:last-child)::after {
        background: #007cba;
    }
    
    /* مراحل تکمیل شده - خط عمودی با رنگ سبز */
    .sngr-timeline-step.completed:not(:last-child)::after {
        background: #28a745;
    }
    
    /* نوار پیشرفت را کوچکتر کن */
    .sngr-timeline-progress-bar {
        height: 5px;
        margin-bottom: 15px;
    }
    
    /* عنوان تایم‌لاین در موبایل */
    .sngr-timeline-title {
        font-size: 18px;
    }
    
    /* فاصله باکس رهگیری */
    .sngr-tracking-box {
        padding: 15px;
        margin: 15px 0;
    }
    
    /* اطلاعات رهگیری در موبایل */
    .sngr-tracking-info-item {
        min-width: 100px;
        flex: 0 0 50%;
    }
	
}
