/* Reset and general */
.tracking-page {
    /* background-color: #f8f9fa; */
    padding: 30px 0;
}

.tracking-container {
    /* max-width: 1200px;
                margin: 0 auto; */
    padding: 0 15px;
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.tracking-main {
    flex: 1;
    min-width: 0;
}

.tracking-sidebar {
    width: 25%;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

/* Card Style */
.tracking-card {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid #f1f5f9;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Header Section */
.tracking-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.tracking-title-wrap h1 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 8px 0;
}

.tracking-title-wrap p {
    color: #666;
    margin: 0;
    font-size: 14px;
}

.btn-guide {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid #ff4d00;
    color: #ff4d00;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    background: #fff5f0;
    transition: all 0.2s ease;
    cursor: pointer;
}

.btn-guide:hover {
    background: #ff4d00;
    color: #fff;
}

/* Guide Modal Styles */
.guide-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.guide-modal-container {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 720px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    animation: modalFadeIn 0.3s ease;
    overflow: hidden;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.guide-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid #eee;
    background: #fff;
}

.guide-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: #111;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.guide-modal-close {
    background: #f1f3f5;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 22px;
    line-height: 1;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.guide-modal-close:hover {
    background: #e9ecef;
    color: #111;
}

.guide-modal-body {
    padding: 24px;
    overflow-y: auto;
    font-size: 15px;
    line-height: 1.6;
    color: #444;
}

.guide-modal-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 12px 0;
}

/* Search Tabs & Input */
.tracking-tabs {
    display: flex;
    gap: 24px;
    border-bottom: 1px solid #eee;
    margin-bottom: 24px;
}

.tracking-tabs .tab-item {
    padding: 12px 0;
    color: #666;
    font-weight: 500;
    cursor: pointer;
    position: relative;
}

.tracking-tabs .tab-item.active {
    color: #ff4d00;
}

.tracking-tabs .tab-item.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: #ff4d00;
}

.search-form {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.search-input-wrap {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 0 12px;
    background: #fff;
}

.search-input-wrap input {
    flex: 1;
    border: none;
    outline: none;
    padding: 12px 0;
    font-size: 15px;
}

.search-input-wrap button {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 4px;
}

.btn-search {
    background: #ff4d00;
    color: #fff;
    border: none;
    padding: 0 24px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.missing-order-link {
    font-size: 14px;
    color: #666;
}

.missing-order-link a {
    color: #ff4d00;
    font-weight: 600;
    text-decoration: none;
}

/* Result Section */
.section-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 20px 0;
}

.result-product {
    display: flex;
    justify-content: space-between;
    padding-bottom: 20px;
    border-bottom: 1px dashed #eee;
    margin-bottom: 20px;
}

.product-info {
    display: flex;
    gap: 16px;
}

.product-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #eee;
}

.product-details h3 {
    margin: 0 0 8px 0;
    font-size: 15px;
    line-height: 1.4;
}

.product-details p {
    color: #666;
    margin: 0 0 4px 0;
    font-size: 13px;
}

.product-details a {
    color: #666;
    text-decoration: none;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.order-status-info {
    text-align: right;
}

.status-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
}

.status-tag.orange {
    background: #fff5f0;
    color: #ff4d00;
}

.order-code {
    font-size: 13px;
    color: #666;
}

.order-code strong {
    color: #333;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-end;
    margin-top: 4px;
}

.result-stats {
    display: flex;
    justify-content: space-between;
}

.stat-label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-icon {
    display: none;
}

.stat-item h4 {
    color: #666;
    font-size: 13px;
    font-weight: normal;
    margin: 0 0 8px 0;
}

.stat-item p {
    margin: 0;
    font-weight: 600;
    font-size: 15px;
}

.stat-item .price-orange {
    color: #ff4d00;
    font-size: 16px;
}

.stat-item .percent {
    background: #e6f7ed;
    color: #00b14f;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    margin-left: 6px;
}

/* Stepper History */
.stepper-wrap {
    padding: 20px 0 20px;
}

.stepper {
    display: flex;
    justify-content: space-between;
    position: relative;
}

.stepper::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 40px;
    right: 40px;
    height: 2px;
    background: #eee;
    z-index: 0;
}

.step-item {
    position: relative;
    z-index: 1;
    text-align: center;
    width: 20%;
}

.step-icon {
    width: 32px;
    height: 32px;
    background: #fff;
    border: 2px solid #eee;
    border-radius: 50%;
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
}

.step-item.completed .step-icon {
    border-color: #00b14f;
    color: #00b14f;
}

.step-item.active .step-icon {
    border-color: #ff4d00;
    color: #ff4d00;
}

.step-item.completed~.step-item::after {
    /* Line completion logic could be handled via separate progress bar element in background, simplified for HTML */
}

.step-title {
    font-size: 13px;
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
}

.step-time {
    font-size: 12px;
    color: #999;
}

.step-item.completed .step-title {
    color: #00b14f;
}

.step-item.active .step-title {
    color: #ff4d00;
}

.stepper-note {
    background: #fff5f0;
    padding: 12px 16px;
    border-radius: 6px;
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 20px;
}

.stepper-note svg {
    color: #ff4d00;
    flex-shrink: 0;
    margin-top: 2px;
}

.stepper-note p {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
}

.stepper-note strong {
    color: #333;
}

/* Other Orders Table */
.header-with-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.header-with-link a {
    color: #0066cc;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.orders-table {
    width: 100%;
    border-collapse: collapse;
}

.orders-table th {
    text-align: left;
    padding: 12px;
    font-size: 13px;
    color: #666;
    border-bottom: 1px solid #eee;
    font-weight: 500;
}

.orders-table td {
    padding: 16px 12px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
    vertical-align: middle;
}

.td-product {
    display: flex;
    align-items: center;
    gap: 12px;
}

.td-product img {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: cover;
}

.td-product p {
    margin: 0;
    font-size: 13px;
    max-width: 200px;
    line-height: 1.4;
}

.text-orange {
    color: #ff4d00;
    font-weight: 600;
}

.text-green {
    color: #00b14f;
    font-weight: 600;
}

.btn-detail {
    color: #ff4d00;
    border: 1px solid #ff4d00;
    background: transparent;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.badge-green {
    background: #e6f7ed;
    color: #00b14f;
}

.badge-blue {
    background: #e6f0fa;
    color: #0066cc;
}

/* Sidebar Widgets */
.sidebar-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 16px 0;
}

.sidebar-title.no-margin {
    margin: 0;
}

.sidebar-title.mb-8 {
    margin-bottom: 8px;
}

.support-text.mb-12 {
    margin-bottom: 12px;
    font-size: 12px;
}

.zalo-img {
    width: 50px;
}

.commission-sub {
    font-size: 12px;
    color: #666;
}

.status-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 16px;
}

.status-item {
    display: flex;
    gap: 12px;
}

.status-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.icon-grey {
    background: #f0f0f0;
    color: #666;
}

.icon-orange {
    background: #fff5f0;
    color: #ff4d00;
}

.icon-green {
    background: #e6f7ed;
    color: #00b14f;
}

.icon-blue {
    background: #e6f0fa;
    color: #0066cc;
}

.icon-red {
    background: #fee2e2;
    color: #ef4444;
}

.status-desc h5 {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.status-desc p {
    margin: 0;
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

.link-policy {
    display: inline-block;
    color: #0066cc;
    font-size: 13px;
    text-decoration: none;
    font-weight: 500;
}

.support-text {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    margin: 0 0 16px 0;
}

.btn-report {
    display: block;
    width: 100%;
    padding: 10px;
    text-align: center;
    color: #ff4d00;
    border: 1px solid #ff4d00;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 12px;
}

.btn-zalo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #0066cc;
    color: #fff;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
}

.support-zalo-flex {
    display: flex;
    justify-content: space-between;
    /* align-items: center; */
    gap: 10px;
}

/* Responsive */
@media (max-width: 991px) {
    .tracking-container {
        flex-direction: column;
        gap: 0;
    }

    .tracking-sidebar,
    .tracking-main {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .tracking-page {
        padding: 20px 0 0;
    }

    .tracking-card {
        padding: 20px 12px;
    }

    .tracking-header {
        flex-direction: column;
        gap: 16px;
    }

    .search-form {
        flex-direction: column;
    }

    .btn-search {
        padding: 12px;
    }

    .result-product {
        flex-direction: column;
        gap: 16px;
    }

    .order-status-info {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        flex-wrap: wrap;
        gap: 10px;
    }

    .status-tag {
        margin-bottom: 0;
    }

    .order-code {
        display: flex;
        align-items: center;
        gap: 4px;
        font-size: 13px;
    }

    .order-code strong {
        margin-top: 0;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        justify-content: flex-start;
    }

    .result-stats {
        display: flex;
        flex-direction: column;
        gap: 12px;
        width: 100%;
        margin-top: 0;
    }

    .stat-item {
        width: 100% !important;
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 4px 0;
    }

    .stat-item h4 {
        margin: 0;
        font-size: 14px;
        color: #475569;
    }

    .stat-item p {
        margin: 0;
        font-size: 14px;
        font-weight: 600;
        text-align: right;
        display: flex;
        align-items: center;
    }

    .stat-item .price-orange {
        font-size: 15px;
        font-weight: 700;
        color: #ff4d00;
    }

    .stat-label {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .stat-icon {
        display: inline-block;
        font-size: 18px;
        flex-shrink: 0;
    }

    .stat-icon.icon-orange {
        color: #ff7a38;
    }

    .stat-icon.icon-gray {
        color: #64748b;
    }

    .stepper {
        flex-direction: column;
        gap: 20px;
    }

    .stepper::before {
        left: 15px;
        top: 20px;
        bottom: 20px;
        height: auto;
        width: 2px;
    }

    .step-item {
        width: 100%;
        display: flex;
        align-items: center;
        text-align: left;
        gap: 16px;
    }

    .step-icon {
        margin: 0;
    }

    .orders-table-wrap {
        overflow-x: auto;
    }

    .orders-table {
        min-width: 700px;
    }
}
