/**
 * MSC Order Tracking - Styles
 */

/* ==================== Forcer l'affichage en haut ==================== */
#msc-tracking-wrapper {
    order: -999 !important;
}

/* Pour les containers flexbox - forcer en premier */
.page-order-detail .msc-order-tracking,
#main .msc-order-tracking,
.page-content .msc-order-tracking {
    order: -999 !important;
}

/* ==================== Container principal ==================== */
.msc-order-tracking {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 16px;
    padding: 28px;
    margin: 24px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* ==================== En-tête ==================== */
.msc-tracking-header {
    margin-bottom: 28px;
    text-align: center;
}

.msc-tracking-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.msc-tracking-icon {
    font-size: 1.5rem;
}

/* ==================== Frise de progression ==================== */
.msc-tracking-timeline {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 10px;
    position: relative;
    margin-bottom: 24px;
}

/* Ligne de connexion en arrière-plan */
.msc-tracking-timeline::before {
    content: '';
    position: absolute;
    top: 40px;
    left: 10%;
    right: 10%;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    z-index: 0;
}

/* Étape individuelle */
.msc-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
    z-index: 1;
}

/* Marqueur de l'étape (cercle) */
.msc-step-marker {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    transition: all 0.3s ease;
    margin-bottom: 12px;
    position: relative;
}

/* États des étapes */
.msc-step-pending .msc-step-marker {
    background: #f1f5f9;
    border: 3px solid #cbd5e1;
    color: #94a3b8;
}

.msc-step-current .msc-step-marker {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border: 3px solid #2563eb;
    color: white;
    box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.2);
    animation: pulse-current 2s infinite;
}

.msc-step-completed .msc-step-marker {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: 3px solid #059669;
    color: white;
}

@keyframes pulse-current {
    0%, 100% { box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.2); }
    50% { box-shadow: 0 0 0 12px rgba(59, 130, 246, 0.1); }
}

/* Contenu de l'étape */
.msc-step-content {
    text-align: center;
    max-width: 100px;
}

.msc-step-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 4px;
}

.msc-step-pending .msc-step-label {
    color: #94a3b8;
}

.msc-step-current .msc-step-label {
    color: #2563eb;
}

.msc-step-completed .msc-step-label {
    color: #059669;
}

.msc-step-date {
    display: block;
    font-size: 0.75rem;
    color: #64748b;
}

/* Étape attente réassort (warning/orange) */
.msc-step-warning.msc-step-current .msc-step-marker {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border: 3px solid #d97706;
    color: white;
    box-shadow: 0 0 0 6px rgba(245, 158, 11, 0.2);
    animation: pulse-warning 2s infinite;
}

.msc-step-warning.msc-step-current .msc-step-label {
    color: #d97706;
}

.msc-step-warning.msc-step-completed .msc-step-marker {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border: 3px solid #d97706;
    color: white;
}

.msc-step-warning.msc-step-completed .msc-step-label {
    color: #92400e;
}

@keyframes pulse-warning {
    0%, 100% { box-shadow: 0 0 0 6px rgba(245, 158, 11, 0.2); }
    50% { box-shadow: 0 0 0 12px rgba(245, 158, 11, 0.1); }
}

/* Message explicatif attente réassort */
.msc-waiting-stock-message {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 2px solid #f59e0b;
    border-radius: 12px;
    padding: 16px 20px;
    margin-top: 20px;
}

.msc-waiting-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.msc-waiting-content {
    flex: 1;
}

.msc-waiting-content strong {
    display: block;
    color: #92400e;
    font-size: 1rem;
    margin-bottom: 6px;
}

.msc-waiting-content p {
    color: #a16207;
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.5;
}

/* Message personnalisé */
.msc-waiting-content .msc-custom-message {
    background: white;
    padding: 12px 16px;
    border-radius: 8px;
    border-left: 4px solid #f59e0b;
    margin: 10px 0;
    font-style: italic;
}

/* Date d'expédition prévue */
.msc-estimated-date {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: white;
    padding: 10px 16px;
    border-radius: 8px;
    border: 2px dashed #fcd34d;
    margin-top: 12px;
}

.msc-estimated-date .msc-date-icon {
    font-size: 1.2rem;
}

.msc-estimated-date .msc-date-label {
    color: #92400e;
    font-size: 0.9rem;
}

.msc-estimated-date .msc-date-value {
    color: #d97706;
    font-size: 1rem;
}

/* Reliquats : voir reliquat-override.css (priorité 999, après le thème) */

/* ==================== Section Suivi de colis ==================== */
.msc-shipping-section {
    margin: 20px 0;
}

.msc-shipping-card {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 2px solid #3b82f6;
    border-radius: 16px;
    overflow: hidden;
}

.msc-shipping-header {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    padding: 16px 20px;
}

.msc-carrier-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.msc-carrier-icon {
    font-size: 2.5rem;
    background: white;
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.msc-carrier-logo {
    width: 80px;
    height: 50px;
    background: white;
    border-radius: 8px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    padding: 8px;
}

/* Logos des transporteurs */
.msc-logo-tnt {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 40"><rect fill="%23FF6600" width="100" height="40" rx="4"/><text x="50" y="28" font-family="Arial,sans-serif" font-size="20" font-weight="bold" fill="white" text-anchor="middle">TNT</text></svg>');
}

.msc-logo-dpd {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 40"><rect fill="%23DC0032" width="100" height="40" rx="4"/><text x="50" y="28" font-family="Arial,sans-serif" font-size="20" font-weight="bold" fill="white" text-anchor="middle">DPD</text></svg>');
}

.msc-logo-colissimo {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 40"><rect fill="%23FFCC00" width="100" height="40" rx="4"/><text x="50" y="26" font-family="Arial,sans-serif" font-size="12" font-weight="bold" fill="%23003DA5" text-anchor="middle">COLISSIMO</text></svg>');
}

.msc-logo-chronopost {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 40"><rect fill="%230055A4" width="100" height="40" rx="4"/><text x="50" y="26" font-family="Arial,sans-serif" font-size="11" font-weight="bold" fill="white" text-anchor="middle">CHRONOPOST</text></svg>');
}

.msc-logo-ups {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 40"><rect fill="%23351C15" width="100" height="40" rx="4"/><text x="50" y="28" font-family="Arial,sans-serif" font-size="20" font-weight="bold" fill="%23FFB500" text-anchor="middle">UPS</text></svg>');
}

.msc-logo-fedex {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 40"><rect fill="%234D148C" width="100" height="40" rx="4"/><text x="50" y="28" font-family="Arial,sans-serif" font-size="18" font-weight="bold" fill="white" text-anchor="middle">FedEx</text></svg>');
}

.msc-logo-gls {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 40"><rect fill="%23003B7E" width="100" height="40" rx="4"/><text x="50" y="28" font-family="Arial,sans-serif" font-size="20" font-weight="bold" fill="%23FFC72C" text-anchor="middle">GLS</text></svg>');
}

.msc-logo-mondial {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 40"><rect fill="%239E1B32" width="100" height="40" rx="4"/><text x="50" y="20" font-family="Arial,sans-serif" font-size="10" font-weight="bold" fill="white" text-anchor="middle">MONDIAL</text><text x="50" y="32" font-family="Arial,sans-serif" font-size="10" font-weight="bold" fill="white" text-anchor="middle">RELAY</text></svg>');
}

.msc-carrier-details {
    display: flex;
    flex-direction: column;
}

.msc-carrier-name {
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
}

.msc-carrier-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
}

.msc-shipping-body {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.msc-tracking-number-box {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.msc-tracking-label {
    color: #64748b;
    font-size: 0.85rem;
}

.msc-tracking-number {
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    font-weight: 700;
    color: #1e40af;
    background: white;
    padding: 8px 16px;
    border-radius: 8px;
    border: 2px dashed #93c5fd;
    letter-spacing: 1px;
}

.msc-tracking-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white !important;
    text-decoration: none !important;
    padding: 14px 28px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.msc-tracking-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
    color: white !important;
}

.msc-btn-icon {
    font-size: 1.2rem;
}

/* Responsive */
@media (max-width: 600px) {
    .msc-shipping-body {
        flex-direction: column;
        align-items: stretch;
    }
    
    .msc-tracking-btn {
        justify-content: center;
        width: 100%;
    }
    
    .msc-tracking-number {
        text-align: center;
    }
}

/* Connecteur entre les étapes */
.msc-step-connector {
    display: none; /* On utilise ::before sur le parent à la place */
}

/* ==================== Message de statut ==================== */
.msc-status-message {
    margin-bottom: 20px;
}

.msc-status-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
}

.msc-status-emoji {
    font-size: 1.5rem;
}

.msc-status-delivered {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #166534;
    border: 1px solid #86efac;
}

.msc-status-shipping {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
    border: 1px solid #93c5fd;
}

.msc-status-processing {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border: 1px solid #fcd34d;
}

.msc-status-received {
    background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
    color: #6b21a8;
    border: 1px solid #d8b4fe;
}

/* ==================== Responsive ==================== */
@media (max-width: 768px) {
    .msc-order-tracking {
        padding: 20px 16px;
    }

    .msc-tracking-timeline {
        flex-direction: column;
        gap: 0;
        padding: 10px 0;
    }

    .msc-tracking-timeline::before {
        top: 0;
        bottom: 0;
        left: 34px;
        right: auto;
        width: 4px;
        height: auto;
    }

    .msc-step {
        flex-direction: row;
        align-items: center;
        padding: 12px 0;
        gap: 16px;
    }

    .msc-step-marker {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .msc-step-content {
        text-align: left;
        max-width: none;
    }

    .msc-step-label {
        font-size: 0.95rem;
    }

    .msc-status-box {
        flex-direction: column;
        text-align: center;
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .msc-tracking-title {
        font-size: 1.2rem;
    }

    .msc-step-marker {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

