*, *::before, *::after { box-sizing: border-box; }

/* Contenedor principal */
#tracking-kdcuba-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
}

.tracking-container {
    width: 100%;
}

/* Alertas */
.alert {
    padding: 15px;
    margin: 20px 0;
    border-radius: 8px;
    text-align: center;
    font-size: 16px;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Formulario */
form { 
    max-width: 400px; 
    margin: 0 auto 30px auto; 
    background: white; 
    padding: 20px; 
    border-radius: 10px; 
    box-shadow: 0 0 8px rgba(0,0,0,0.1); 
}

label { 
    display: block; 
    margin-bottom: 8px; 
    font-weight: bold; 
}

input[type="text"] { 
    width: 100%; 
    padding: 10px; 
    border-radius: 6px; 
    border: 1px solid #ccc; 
    font-size: 16px; 
}

button { 
    background-color: #2f80ed; 
    color: white; 
    padding: 12px; 
    margin-top: 15px; 
    border: none; 
    border-radius: 6px; 
    cursor: pointer; 
    width: 100%; 
    font-size: 16px; 
    transition: background 0.3s; 
}

button:hover { 
    background-color: #1c60c4; 
}

button i {
    margin-right: 8px;
}

/* Timeline */
.kdc-timeline {
    display: flex;
    justify-content: space-between;
    margin: 30px 0 10px 0;
    position: relative;
    padding: 0 10px;
    max-width: 100%;
    width: 100%;
    overflow: hidden;
}

.kdc-timeline::before {
    content: '';
    position: absolute;
    top: 36px;
    left: 10px;
    right: 10px;
    height: 3px;
    background: #ccc;
    z-index: 0;
}

.timeline-step {
    text-align: left;
    position: relative;
    z-index: 1;
    flex: 1 1 140px;
    min-width: 140px;
    padding: 0 5px;
    color: #333;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.timeline-step .icon {
    background: #ccc;
    color: #fff;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: background 0.3s;
    flex-shrink: 0;
}

.timeline-step .textos {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    padding-top: 0.2em;
}

.timeline-step .fecha {
    color: #666;
    font-size: 0.8em;
    line-height: 1.2em;
    margin: 0 0 3px 0;
    min-height: 1.2em;
}

.timeline-step small {
    font-weight: normal;
    color: #bbb;
    font-size: 1rem;
    line-height: 1.2em;
    margin: 0;
}

.timeline-step.active small {
    font-weight: 600;
    color: #000;
    font-size: 1rem;
    line-height: 1.2em;
    margin: 0;
}

.timeline-step.active .icon {
    background: #2f80ed;
}

.timeline-step.active small, 
.timeline-step.completed small {
    color: #000;
}

/* Card (si la usas) */
.card {
    background: white;
    padding: 20px;
    margin: 20px auto;
    border-radius: 10px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
    max-width: 1100px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.card-header h3 {
    margin: 0;
    font-size: 1.2rem;
    flex: 1 1 300px;
    word-break: break-word;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.card-header i {
    color: #2f80ed;
}

.card-header .cliente {
    flex: 1 1 300px;
    word-break: break-word;
    font-size: 0.95rem;
    text-align: right;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    color: #333;
}

.cliente i {
    color: #2f80ed;
    font-size: 18px;
}

.error {
    background: #ffe0e0;
    padding: 10px;
    max-width: 400px;
    margin: 20px auto;
    border-radius: 8px;
    color: #000;
    text-align: center;
}

/* Responsive */
@media (max-width: 700px) {
    .card-header .cliente {
        text-align: left !important;
        justify-content: flex-start !important;
    }
    
    .kdc-timeline {
        flex-direction: column;
        align-items: flex-start;
        padding-left: 10px;
        margin: 10px 0;
    }
    
    .kdc-timeline::before {
        top: 0;
        left: 24px;
        width: 3px;
        height: 100%;
        right: auto;
    }
    
    .timeline-step {
        flex: 0 1 auto;
        min-width: unset;
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        gap: 10px;
        margin-top: 25px;
        width: 100%;
    }
    
    .timeline-step .icon {
        width: 48px;
        height: 48px;
    }
    
    .timeline-step .textos {
        padding-top: 0;
    }
    
    .timeline-step .fecha {
        min-height: 1.2em;
    }
}