/* TDD Order Tracking — Frontend styles v1.2.4 */

/* ─── Carte commande ────────────────────────────────────────────────── */
.tdd-ot-card {
    background: #fdf8f0;
    border: 1px solid #ddd0b8;
    border-radius: 8px;
    padding: 1.2rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 6px rgba(0,0,0,.06);
}

/* ─── Header carte ──────────────────────────────────────────────────── */
.tdd-ot-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1rem;
    padding-bottom: .8rem;
    border-bottom: 1px solid #e8dcc8;
}
.tdd-ot-order-meta { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.tdd-ot-order-num  { font-weight: 700; font-size: 1rem; color: #2a1a0a; }
.tdd-ot-order-num a { color: #7a4f20; text-decoration: none; font-weight: 800; }
.tdd-ot-order-num a:hover { text-decoration: underline; color: #5a3010; }
.tdd-ot-order-date, .tdd-ot-order-total { color: #555; font-size: .9rem; font-weight: 500; }
.tdd-ot-wc-status  { font-size: .85rem; color: #444; }
.tdd-ot-wc-status em { font-style: normal; font-weight: 700; color: #2a1a0a; }

/* ─── Badge statut courant ──────────────────────────────────────────── */
.tdd-ot-current-status {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .4rem 1rem;
    border-radius: 20px;
    background: var(--status-color, #9e9e9e);
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 1.2rem;
}
.tdd-ot-status-icon { font-size: 1.1rem; }

/* ─── Barre de progression ──────────────────────────────────────────── */
.tdd-ot-progress-wrap {
    position: relative;
    margin-bottom: 1.4rem;
    padding-bottom: .4rem;
    /* pas d'overflow:hidden ici — les dots doivent rester visibles */
}

/* Conteneur flex des étapes — au-dessus de la ligne */
.tdd-ot-steps {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    position: relative;
    z-index: 2;
    overflow-x: auto;
    overflow-y: visible; /* ne pas clipper le halo/scale du dot actif */
    padding-top: 6px;    /* espace pour le scale(1.18) + box-shadow du dot actif */
    padding-bottom: 2px;
}

/* Ligne fond gris — top = padding-top steps (6px) + moitié dot (18px) */
.tdd-ot-track {
    position: absolute;
    top: 24px;
    left: 18px;
    right: 18px;
    height: 3px;
    background: #e0d4c0;
    z-index: 0;
    border-radius: 3px;
}

/* Ligne colorée — largeur dynamique via CSS var injectée en PHP */
.tdd-ot-track-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 3px;
    width: var(--progress-pct, 0%);
    background: var(--status-color, #9e9e9e);
    border-radius: 3px;
    transition: width .6s cubic-bezier(.4,0,.2,1);
}

/* ─── Étape individuelle ────────────────────────────────────────────── */
.tdd-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 58px;
    position: relative;
    z-index: 1;
    text-align: center;
}

.tdd-step-dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e0d4c0;
    border: 3px solid #fdf8f0; /* couleur du fond carte */
    box-shadow: 0 0 0 2px #e0d4c0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    margin-bottom: .4rem;
    transition: background .3s, box-shadow .3s, transform .3s;
    position: relative;
    z-index: 2;
}

/* Étapes passées : fond couleur de l'étape + coche */
.tdd-step.done .tdd-step-dot {
    color: #fff;
    font-size: .8rem;
    font-weight: 900;
    box-shadow: 0 0 0 2px var(--step-color, #9e9e9e);
}

/* Étape active : pulsation + halo coloré */
.tdd-step.active .tdd-step-dot {
    box-shadow:
        0 0 0 3px #fdf8f0,
        0 0 0 5px var(--status-color, #9e9e9e);
    transform: scale(1.18);
    animation: tdd-pulse 2s ease-in-out infinite;
}

@keyframes tdd-pulse {
    0%   { box-shadow: 0 0 0 3px #fdf8f0, 0 0 0 5px var(--status-color, #9e9e9e), 0 0  0px 0px rgba(0,0,0,0); }
    50%  { box-shadow: 0 0 0 3px #fdf8f0, 0 0 0 5px var(--status-color, #9e9e9e), 0 0 10px 4px rgba(0,0,0,.12); }
    100% { box-shadow: 0 0 0 3px #fdf8f0, 0 0 0 5px var(--status-color, #9e9e9e), 0 0  0px 0px rgba(0,0,0,0); }
}

/* Étapes futures : grisées */
.tdd-step.future .tdd-step-dot {
    opacity: .4;
    filter: grayscale(.8);
}

/* Labels */
.tdd-step-label {
    font-size: .68rem;
    color: #888;
    line-height: 1.2;
    max-width: 62px;
    word-break: break-word;
}
.tdd-step.done   .tdd-step-label { color: #666; }
.tdd-step.active .tdd-step-label { font-weight: 700; color: #3a2a1a; }
.tdd-step.future .tdd-step-label { opacity: .45; }

/* ─── Barre impression (%) ──────────────────────────────────────────── */
.tdd-ot-print-progress-wrap {
    display: flex;
    align-items: center;
    gap: .8rem;
    margin-bottom: 1rem;
}
.tdd-ot-print-bar {
    flex: 1;
    height: 10px;
    background: #e8dcc8;
    border-radius: 6px;
    overflow: hidden;
}
.tdd-ot-print-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff9800, #ff5722);
    border-radius: 6px;
    transition: width .6s ease;
}
.tdd-ot-print-percent {
    font-size: .85rem;
    font-weight: 700;
    color: #ff6f00;
    white-space: nowrap;
    min-width: 36px;
}

/* ─── File d'attente ────────────────────────────────────────────────── */
.tdd-ot-queue {
    font-size: .85rem;
    opacity: .85;
    font-weight: 400;
    margin-left: .3rem;
}

/* ─── Note Naheulbeuk ───────────────────────────────────────────────── */
.tdd-ot-note {
    display: flex;
    gap: .6rem;
    align-items: flex-start;
    background: #fff8e7;
    border-left: 3px solid #c8a96e;
    border-radius: 4px;
    padding: .7rem 1rem;
    margin-bottom: .8rem;
    font-size: .9rem;
    color: #4a3a20;
}
.tdd-ot-note-icon { flex-shrink: 0; font-size: 1.1rem; }
.tdd-ot-note p    { margin: 0; }

/* ─── Dernière mise à jour ──────────────────────────────────────────── */
.tdd-ot-updated {
    font-size: .78rem;
    color: #aaa;
    text-align: right;
}

/* ─── Message vide ──────────────────────────────────────────────────── */
.tdd-ot-empty {
    background: #f5f0e8;
    padding: 1rem 1.2rem;
    border-radius: 6px;
    color: #666;
    font-style: italic;
}

/* ─── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .tdd-ot-card { padding: .9rem 1rem; }
    .tdd-step-label { font-size: .6rem; max-width: 48px; }
    .tdd-step-dot { width: 30px; height: 30px; font-size: .85rem; }
    .tdd-ot-track { top: 21px; } /* 6px padding + 15px (moitié dot 30px) */
}
