/* TMS Tracking Pro - Mobile First - Refined */

.tms-container-pro {
    max-width: 920px;
    margin: 1.5rem auto;
    padding: 0 1rem;
    text-align: center;
    font-size: clamp(14px, 3.4vw, 15px);
    line-height: 1.55;
    direction: rtl;
}

.tms-container-pro,
.tms-container-pro * {
    box-sizing: border-box;
}

.tms-form-combined {
    display: flex;
    align-items: stretch;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 9999px;
    overflow: hidden;
    height: 3.35rem;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tms-form-combined:focus-within {
    border-color: #e31e24;
    box-shadow: 0 12px 32px rgba(227, 30, 36, 0.14);
}

#tracking_code {
    flex: 1 1 auto;
    border: 0;
    padding: 0 1.125rem;
    font-size: 1rem;
    background: transparent;
    text-align: center;
    outline: none;
    color: #0f172a;
    font-weight: 500;
}

#tracking_code::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.tms-submit-btn {
    background: linear-gradient(135deg, #e31e24, #c41c1f);
    border: 0;
    width: 4.25rem;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.18s ease, opacity 0.18s ease;
}

.tms-submit-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #d51d22, #ad171b);
}

.tms-submit-btn:active:not(:disabled) {
    transform: scale(0.97);
}

.tms-submit-btn:disabled {
    cursor: not-allowed;
    opacity: 0.85;
}

.tms-btn-icon {
    width: 22px;
    height: 22px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") center / contain no-repeat;
}

.tms-submit-btn.is-loading .tms-btn-icon {
    display: none;
}

.tms-loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: tms-spin 0.9s linear infinite;
}

.tms-submit-btn.is-loading .tms-loader {
    display: block;
}

@keyframes tms-spin {
    to {
        transform: rotate(360deg);
    }
}

.tms-grid-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    margin-top: 1.75rem;
}

.tms-card {
    background: #ffffff;
    border-radius: 1.125rem;
    padding: 1.25rem;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
    border: 1px solid #eef2f7;
    text-align: right;
    transition: box-shadow 0.2s ease;
}

.tms-card:hover {
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.09);
}

.tms-card-header {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    margin-bottom: 1.125rem;
}

.tms-card-header.blue {
    color: #0056b3;
}

.tms-status-badge {
    background: rgba(227, 30, 36, 0.1);
    color: #c41c1f;
    border: 1px solid rgba(227, 30, 36, 0.18);
    padding: 0.3rem 0.8rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.tms-timeline-list {
    counter-reset: step;
}

.tms-timeline-item {
    position: relative;
    padding-right: 32px;
    padding-bottom: 1.25rem;
    border-right: 2px solid #e2e8f0;
    margin-right: 12px;
}

.tms-timeline-item:last-child {
    border-right: none;
    padding-bottom: 0;
}

.tms-timeline-marker {
    position: absolute;
    right: -8px;
    top: 8px;
    width: 14px;
    height: 14px;
    background: #ffffff;
    border: 3px solid #e31e24;
    border-radius: 50%;
    z-index: 2;
    box-shadow: 0 0 0 4px #fff, 0 0 0 6px rgba(227, 30, 36, 0.08);
}

.tms-timeline-info {
    margin-bottom: 0.25rem;
}

.tms-timeline-date {
    color: #64748b;
    font-size: 0.875rem;
}

.tms-good-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid #f1f5f9;
}

.tms-good-item:last-of-type {
    border-bottom: 0;
}

.tms-qnt-badge {
    background: #eff6ff;
    color: #0056b3;
    padding: 0.22rem 0.65rem;
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 700;
    white-space: nowrap;
}

.tms-goods-hidden {
    display: none;
    margin-top: 0.5rem;
}

.tms-show-more {
    color: #0056b3;
    font-size: 0.875rem;
    margin-top: 0.75rem;
    display: inline-block;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.18s ease, transform 0.18s ease;
}

.tms-show-more:hover {
    color: #e31e24;
}

.fade-in {
    animation: tmsIn 0.45s ease-out;
}

@keyframes tmsIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (min-width: 640px) {
    .tms-container-pro {
        padding: 0 1.5rem;
    }

    .tms-form-combined {
        height: 3.5rem;
    }
}

@media (min-width: 768px) {
    .tms-grid-wrapper {
        grid-template-columns: 1.35fr 1fr;
        gap: 1.5rem;
    }

    .tms-card-header {
        flex-wrap: nowrap;
    }

    .tms-card {
        padding: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .tms-container-pro {
        padding: 0;
    }
}