/* ============================================================
   ONTIME FRONTEND TRACKING - Bodegas Alicia
   ============================================================ */

/* ── Formulario de búsqueda pública ── */
.ba-tracking-form-wrap {
    max-width: 600px;
    margin: 40px auto;
    font-family: 'Open Sans', sans-serif;
}
.ba-tracking-form-wrap h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.8em;
    color: #1a1a1a;
    margin-bottom: 8px;
}
.ba-tracking-form-wrap .ba-subtitle {
    color: #666;
    font-size: 14px;
    margin-bottom: 24px;
}
.ba-track-input-row {
    display: flex;
    gap: 10px;
}
.ba-track-input-row input {
    flex: 1;
    padding: 14px 18px;
    font-size: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: border-color 0.2s;
    font-family: inherit;
}
.ba-track-input-row input:focus {
    border-color: #C0392B;
    outline: none;
    box-shadow: 0 0 0 3px rgba(192,57,43,0.1);
}
.ba-track-input-row button {
    padding: 14px 28px;
    background: #C0392B;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}
.ba-track-input-row button:hover { background: #922B21; }

/* ── Widget de seguimiento (en Mi cuenta y resultado de búsqueda) ── */
.ba-tracking-widget {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    overflow: hidden;
    margin: 30px 0;
    border: 1px solid #f0f0f0;
}

.ba-tracking-header {
    background: linear-gradient(135deg, #1a0505 0%, #2d0808 100%);
    padding: 24px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}
.ba-tracking-header .track-title {
    color: #fff;
    font-size: 1.1em;
    font-weight: 700;
    margin: 0;
}
.ba-tracking-header .track-ref {
    color: rgba(255,255,255,0.6);
    font-size: 13px;
    margin-top: 4px;
}
.ba-tracking-header .track-status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.12);
    padding: 8px 16px;
    border-radius: 30px;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    backdrop-filter: blur(8px);
}
.ba-tracking-header .track-status-badge .badge-icon { font-size: 1.3em; }

/* ── Barra de progreso de 5 pasos ── */
.ba-progress-wrap {
    padding: 28px 28px 0;
    overflow-x: auto;
}
.ba-progress-steps {
    display: flex;
    align-items: flex-start;
    min-width: 480px;
    position: relative;
    padding-bottom: 24px;
}
.ba-progress-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 28px;
    right: 28px;
    height: 3px;
    background: #e0e0e0;
    z-index: 0;
}
.ba-progress-line-fill {
    position: absolute;
    top: 20px;
    left: 28px;
    height: 3px;
    background: #C0392B;
    transition: width 0.8s ease;
    z-index: 1;
}
.ba-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 2;
}
.ba-step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e0e0e0;
    border: 3px solid #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.4s ease;
}
.ba-step.active   .ba-step-circle { background: #C0392B; box-shadow: 0 4px 12px rgba(192,57,43,0.4); transform: scale(1.1); }
.ba-step.done     .ba-step-circle { background: #27ae60; }
.ba-step.failed   .ba-step-circle { background: #e74c3c; }
.ba-step-label {
    font-size: 11px;
    font-weight: 600;
    color: #999;
    text-align: center;
    max-width: 80px;
    line-height: 1.3;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.ba-step.active .ba-step-label,
.ba-step.done   .ba-step-label { color: #1a1a1a; }

/* ── Timeline de eventos ── */
.ba-events-wrap {
    padding: 20px 28px 28px;
}
.ba-events-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #aaa;
    margin-bottom: 16px;
}
.ba-events-list { list-style: none; margin: 0; padding: 0; }
.ba-event-item {
    display: flex;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px dashed #f0f0f0;
    animation: slideIn 0.4s ease;
}
.ba-event-item:last-child { border-bottom: none; }
@keyframes slideIn {
    from { opacity: 0; transform: translateX(-10px); }
    to   { opacity: 1; transform: none; }
}
.ba-event-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #C0392B;
    margin-top: 5px;
    flex-shrink: 0;
    box-shadow: 0 0 0 3px rgba(192,57,43,0.15);
}
.ba-event-dot.grey { background: #ccc; box-shadow: none; }
.ba-event-info { flex: 1; }
.ba-event-label {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 3px;
}
.ba-event-meta {
    font-size: 12px;
    color: #888;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.ba-event-location::before { content: '📍 '; }
.ba-event-time::before     { content: '🕐 '; }

/* ── Loading state ── */
.ba-tracking-loading {
    text-align: center;
    padding: 40px 20px;
    color: #888;
}
.ba-tracking-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #f0f0f0;
    border-top-color: #C0392B;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Sin datos ── */
.ba-no-tracking {
    text-align: center;
    padding: 40px 20px;
    color: #aaa;
    font-size: 14px;
}
.ba-no-tracking span { font-size: 3em; display: block; margin-bottom: 12px; }

/* ── Footer del widget ── */
.ba-tracking-footer {
    background: #fafafa;
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: #aaa;
    border-top: 1px solid #f0f0f0;
}
.ba-tracking-footer .ba-refresh-btn {
    background: none;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 11px;
    cursor: pointer;
    color: #666;
    transition: all 0.2s;
}
.ba-tracking-footer .ba-refresh-btn:hover { border-color: #C0392B; color: #C0392B; }
.ba-tracking-footer .ba-refresh-btn.spinning::before {
    content: '';
    display: inline-block;
    width: 10px; height: 10px;
    border: 2px solid #C0392B;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 6px;
    vertical-align: middle;
}

/* ── Formulario de devolución ── */
.ba-ontime-return-box {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 24px;
    margin-top: 28px;
    border-left: 4px solid #C0392B;
}
.ba-ontime-return-box h3 {
    margin: 0 0 10px;
    font-size: 1.1em;
    color: #1a1a1a;
}
.ba-return-form .ba-form-group {
    margin-bottom: 16px;
}
.ba-return-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 6px;
}
.ba-return-form select,
.ba-return-form textarea {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
}
.ba-return-form select:focus,
.ba-return-form textarea:focus {
    border-color: #C0392B;
    outline: none;
    box-shadow: 0 0 0 3px rgba(192,57,43,0.1);
}
.ba-return-submit {
    background: #C0392B !important;
    color: #fff !important;
    border: none !important;
    padding: 12px 24px !important;
    border-radius: 8px !important;
    font-weight: 700 !important;
    cursor: pointer;
    transition: background 0.2s;
}
.ba-return-submit:hover { background: #922B21 !important; }

.ba-ontime-return-status {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 14px 18px;
    margin-top: 24px;
    font-size: 14px;
    font-weight: 600;
    color: #856404;
}
.ba-ontime-return-rejected {
    background: #f8d7da;
    border: 1px solid #f5c2c7;
    border-radius: 8px;
    padding: 14px 18px;
    margin-top: 24px;
    font-size: 14px;
    color: #842029;
}

/* ── Responsive ── */
@media (max-width: 600px) {
    .ba-tracking-header     { padding: 18px; }
    .ba-progress-wrap       { padding: 20px 16px 0; }
    .ba-events-wrap         { padding: 16px 18px 24px; }
    .ba-tracking-footer     { padding: 12px 18px; flex-direction: column; gap: 8px; }
    .ba-track-input-row     { flex-direction: column; }
    .ba-ontime-return-box   { padding: 18px; }
}
