/* =========================================================
   Seguimiento de Paquetes — Estilos del widget público
   ========================================================= */

.sp-widget {
    max-width: 480px;
    margin: 0 auto;
    padding: 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
        'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* ── Card ──────────────────────────────────────────────── */

.sp-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    padding: 32px 28px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
}

/* ── Encabezado ─────────────────────────────────────────── */

.sp-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 8px;
    line-height: 1.3;
}

.sp-subtitle {
    font-size: 0.9rem;
    color: #6b7280;
    margin: 0 0 24px;
    line-height: 1.55;
}

/* ── Formulario ──────────────────────────────────────────── */

.sp-form {
    margin: 0;
}

.sp-input-group {
    display: flex;
    gap: 8px;
    align-items: stretch;
    flex-wrap: wrap;
}

.sp-input {
    flex: 1;
    min-width: 0;
    padding: 10px 14px;
    font-size: 0.95rem;
    font-family: 'Courier New', 'Consolas', monospace;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #111827;
    background: #f9fafb;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.sp-input::placeholder {
    color: #9ca3af;
    text-transform: none;
    letter-spacing: 0;
    font-family: inherit;
}

.sp-input:focus {
    background: #ffffff;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* ── Botón ──────────────────────────────────────────────── */

.sp-btn {
    padding: 10px 22px;
    background: #3b82f6;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease, opacity 0.15s ease;
    line-height: 1.4;
}

.sp-btn:hover:not(:disabled) {
    background: #2563eb;
}

.sp-btn:focus-visible {
    outline: 3px solid rgba(59, 130, 246, 0.5);
    outline-offset: 2px;
}

.sp-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ── Mensajes de error de campo ─────────────────────────── */

.sp-field-error {
    color: #dc2626;
    font-size: 0.85rem;
    margin: 8px 0 0;
    display: none;
}

/* ── Resultado ─────────────────────────────────────────── */

.sp-result {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #f3f4f6;
}

.sp-result-inner {
    /* contenedor limpio */
}

.sp-result-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #374151;
    margin: 0 0 14px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.78rem;
}

.sp-result-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.sp-result-label {
    font-size: 0.83rem;
    color: #6b7280;
    min-width: 90px;
    flex-shrink: 0;
}

.sp-result-value {
    font-size: 0.95rem;
    color: #111827;
    font-weight: 600;
}

.sp-mono {
    font-family: 'Courier New', 'Consolas', monospace;
    letter-spacing: 0.06em;
}

/* ── Badges de estado ───────────────────────────────────── */

.sp-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.6;
}

/* en_bodega */
.sp-badge--amber {
    background: #fef3c7;
    color: #92400e;
}

/* en_transito */
.sp-badge--blue {
    background: #dbeafe;
    color: #1e40af;
}

/* entregado */
.sp-badge--green {
    background: #d1fae5;
    color: #065f46;
}

/* fallback */
.sp-badge--gray {
    background: #f3f4f6;
    color: #374151;
}

/* ── Mensaje de error general (código no encontrado, etc.) ─ */

.sp-notice {
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 0.88rem;
    line-height: 1.5;
}

.sp-notice--error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.sp-notice--info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* ── Responsive ─────────────────────────────────────────── */

@media (max-width: 480px) {
    .sp-card {
        padding: 24px 18px;
    }

    .sp-input-group {
        flex-direction: column;
    }

    .sp-btn {
        width: 100%;
        text-align: center;
    }
}
